mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-09-09 12:46:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6f9479c3d5 | ||
|
|
1f335cd58a | ||
|
|
2373a8f208 | ||
|
|
dd0f15bf02 | ||
|
|
629860c965 | ||
|
|
3f1e2817ed | ||
|
|
3a41fa7ccc | ||
|
|
26d38779e4 | ||
|
|
83346fc8bc | ||
|
|
c4654fdc85 |
@@ -176,6 +176,7 @@ usb:v04F3p0CA7*
|
||||
usb:v04F3p0CA8*
|
||||
usb:v04F3p0CB0*
|
||||
usb:v04F3p0CB2*
|
||||
usb:v04F3p0CB6*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
@@ -218,6 +219,7 @@ usb:v10A5p9B24*
|
||||
# Supported by libfprint driver goodixmoc
|
||||
usb:v27C6p5840*
|
||||
usb:v27C6p6014*
|
||||
usb:v27C6p6082*
|
||||
usb:v27C6p6090*
|
||||
usb:v27C6p6092*
|
||||
usb:v27C6p6094*
|
||||
@@ -253,6 +255,10 @@ usb:v27C6p6890*
|
||||
usb:v27C6p689A*
|
||||
usb:v27C6p66A9*
|
||||
usb:v27C6p6984*
|
||||
usb:v27C6p65BA*
|
||||
usb:v27C6p6515*
|
||||
usb:v27C6p66AC*
|
||||
usb:v27C6p660A*
|
||||
ID_AUTOSUSPEND=1
|
||||
ID_PERSIST=0
|
||||
|
||||
@@ -298,6 +304,7 @@ usb:v06CBp0107*
|
||||
usb:v06CBp0108*
|
||||
usb:v06CBp0109*
|
||||
usb:v06CBp010A*
|
||||
usb:v06CBp010B*
|
||||
usb:v06CBp010D*
|
||||
usb:v06CBp010E*
|
||||
usb:v06CBp0123*
|
||||
|
||||
@@ -41,6 +41,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x04f3, .pid = 0x0ca8, },
|
||||
{ .vid = 0x04f3, .pid = 0x0cb0, },
|
||||
{ .vid = 0x04f3, .pid = 0x0cb2, },
|
||||
{ .vid = 0x04f3, .pid = 0x0cb6, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -1423,9 +1423,14 @@ gx_fp_probe (FpDevice *device)
|
||||
case 0x659A:
|
||||
case 0x6890:
|
||||
case 0x6984:
|
||||
case 0x65BA:
|
||||
self->max_enroll_stage = 12;
|
||||
break;
|
||||
|
||||
case 0x6515:
|
||||
self->max_enroll_stage = 17;
|
||||
break;
|
||||
|
||||
default:
|
||||
self->max_enroll_stage = DEFAULT_ENROLL_SAMPLES;
|
||||
break;
|
||||
@@ -1653,6 +1658,7 @@ fpi_device_goodixmoc_init (FpiDeviceGoodixMoc *self)
|
||||
static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x27c6, .pid = 0x5840, },
|
||||
{ .vid = 0x27c6, .pid = 0x6014, },
|
||||
{ .vid = 0x27c6, .pid = 0x6082, },
|
||||
{ .vid = 0x27c6, .pid = 0x6090, },
|
||||
{ .vid = 0x27c6, .pid = 0x6092, },
|
||||
{ .vid = 0x27c6, .pid = 0x6094, },
|
||||
@@ -1688,6 +1694,10 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = 0x27c6, .pid = 0x689A, },
|
||||
{ .vid = 0x27c6, .pid = 0x66A9, },
|
||||
{ .vid = 0x27c6, .pid = 0x6984, },
|
||||
{ .vid = 0x27c6, .pid = 0x65BA, },
|
||||
{ .vid = 0x27c6, .pid = 0x6515, },
|
||||
{ .vid = 0x27c6, .pid = 0x66AC, },
|
||||
{ .vid = 0x27c6, .pid = 0x660A, },
|
||||
{ .vid = 0, .pid = 0, .driver_data = 0 }, /* terminating entry */
|
||||
};
|
||||
|
||||
|
||||
@@ -516,7 +516,7 @@ fp_check_duplicate_cb (FpiDeviceRealtek *self,
|
||||
if (in_status == FP_RTK_SUCCESS)
|
||||
{
|
||||
fpi_ssm_mark_failed (self->task_ssm,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||
fpi_device_error_new_msg (FP_DEVICE_ERROR_DATA_DUPLICATE,
|
||||
"Current fingerprint is duplicate!"));
|
||||
}
|
||||
else if (in_status == FP_RTK_MATCH_FAIL)
|
||||
@@ -909,9 +909,6 @@ fp_verify_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
|
||||
fp_info ("Verify complete!");
|
||||
|
||||
if (fpi_ssm_get_error (ssm))
|
||||
error = fpi_ssm_get_error (ssm);
|
||||
|
||||
if (error && error->domain == FP_DEVICE_RETRY)
|
||||
{
|
||||
if (fpi_device_get_current_action (dev) == FPI_DEVICE_ACTION_VERIFY)
|
||||
@@ -936,9 +933,6 @@ fp_enroll_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
|
||||
fp_info ("Enrollment complete!");
|
||||
|
||||
if (fpi_ssm_get_error (ssm))
|
||||
error = fpi_ssm_get_error (ssm);
|
||||
|
||||
if (error)
|
||||
{
|
||||
fpi_device_enroll_complete (dev, NULL, error);
|
||||
@@ -958,9 +952,6 @@ fp_init_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
|
||||
fp_info ("Init complete!");
|
||||
|
||||
if (fpi_ssm_get_error (ssm))
|
||||
error = fpi_ssm_get_error (ssm);
|
||||
|
||||
fpi_device_open_complete (dev, error);
|
||||
self->task_ssm = NULL;
|
||||
}
|
||||
@@ -972,9 +963,6 @@ fp_delete_ssm_done (FpiSsm *ssm, FpDevice *dev, GError *error)
|
||||
|
||||
fp_info ("Delete print complete!");
|
||||
|
||||
if (fpi_ssm_get_error (ssm))
|
||||
error = fpi_ssm_get_error (ssm);
|
||||
|
||||
fpi_device_delete_complete (dev, error);
|
||||
self->task_ssm = NULL;
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@ static const FpIdEntry id_table[] = {
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0108, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0109, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x010A, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x010B, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x010D, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x010E, },
|
||||
{ .vid = SYNAPTICS_VENDOR_ID, .pid = 0x0123, },
|
||||
|
||||
+2
-1
@@ -59,6 +59,7 @@ drivers_tests = {
|
||||
'fpcmoc': {},
|
||||
'realtek': {},
|
||||
'realtek-5816': {},
|
||||
'realtek-storage-errors': {},
|
||||
'focaltech_moc': { 'timeout': 30 },
|
||||
'focaltech_moc-6553': {},
|
||||
'mafpmoc': {},
|
||||
@@ -292,7 +293,7 @@ else
|
||||
args: ['-c', 'exit 77']
|
||||
)
|
||||
|
||||
foreach driver_test: drivers_tests
|
||||
foreach driver_test, _args : drivers_tests
|
||||
test(driver_test,
|
||||
sh,
|
||||
args: ['-c', 'exit 77']
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,98 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
# Deleting a print that is not in the sensor's storage makes the realtek driver
|
||||
# fail its task SSM, which is the path that used to hand an already-freed GError
|
||||
# to fpi_device_delete_complete(). Reading the reported error is therefore the
|
||||
# point of this test: before the fix it read freed memory, and the GError was
|
||||
# freed a second time when the GTask finalized.
|
||||
#
|
||||
# The print below is a stored realtek print, serialized, whose template is
|
||||
# deliberately not on the device.
|
||||
#
|
||||
# The same session then enrolls a finger and enrolls it again, checking that the
|
||||
# duplicate is reported as FP_DEVICE_ERROR_DATA_DUPLICATE rather than PROTO.
|
||||
|
||||
import base64
|
||||
import traceback
|
||||
import sys
|
||||
import gi
|
||||
|
||||
gi.require_version('FPrint', '2.0')
|
||||
from gi.repository import FPrint, GLib
|
||||
|
||||
# Exit with error on any exception, included those happening in async callbacks
|
||||
sys.excepthook = lambda *args: (traceback.print_exception(*args), sys.exit(1))
|
||||
|
||||
# A stored print for user 'testuser', right index finger, user id
|
||||
# 'FP1-20260101-7-DEADBEEF-test'.
|
||||
STORED_PRINT = base64.b64decode(
|
||||
'RlAzAQAAAHJlYWx0ZWsAMAABB3Rlc3R1c2VyAABGUDEtMjAyNjAxMDEtNy1ERUFEQkVFRi10ZXN0AAAhSQsAAAAAAP9GUDEtMjAyNjAxMDEtNy1ERUFEQkVFRi10ZXN0ACh5YXkpAHZAOBoODA==')
|
||||
|
||||
ctx = GLib.main_context_default()
|
||||
|
||||
c = FPrint.Context()
|
||||
c.enumerate()
|
||||
devices = c.get_devices()
|
||||
|
||||
d = devices[0]
|
||||
del devices
|
||||
|
||||
assert d.get_driver() == "realtek"
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_DELETE)
|
||||
assert d.has_feature(FPrint.DeviceFeature.STORAGE_CLEAR)
|
||||
|
||||
d.open_sync()
|
||||
|
||||
# Make sure the device holds no templates, so the print below cannot match.
|
||||
d.clear_storage_sync()
|
||||
|
||||
p = FPrint.Print.deserialize(STORED_PRINT)
|
||||
assert p.get_driver() == "realtek"
|
||||
assert p.get_device_stored()
|
||||
assert p.get_finger() == FPrint.Finger.RIGHT_INDEX
|
||||
|
||||
print("deleting a print that is not in the device storage")
|
||||
try:
|
||||
d.delete_print_sync(p)
|
||||
except GLib.Error as error:
|
||||
print("delete reported: {}".format(error.message))
|
||||
assert error.matches(FPrint.DeviceError.quark(), FPrint.DeviceError.PROTO)
|
||||
assert error.message
|
||||
else:
|
||||
assert False, "deleting a template that is not stored should fail"
|
||||
del p
|
||||
print("delete attempt done")
|
||||
|
||||
# Storage is still empty, so enrolling the same finger twice must report the
|
||||
# error class expected by fprintd.
|
||||
|
||||
def enroll_progress(*args):
|
||||
print('enroll progress: ' + str(args))
|
||||
|
||||
template = FPrint.Print.new(d)
|
||||
|
||||
print("enrolling")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
p = d.enroll_sync(template, None, enroll_progress, None)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("enroll done")
|
||||
|
||||
print("enrolling duplicate")
|
||||
template = FPrint.Print.new(d)
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
try:
|
||||
d.enroll_sync(template, None, enroll_progress, None)
|
||||
except GLib.Error as error:
|
||||
assert error.matches(FPrint.DeviceError.quark(),
|
||||
FPrint.DeviceError.DATA_DUPLICATE)
|
||||
else:
|
||||
raise AssertionError("Duplicate enrollment unexpectedly succeeded")
|
||||
assert d.get_finger_status() == FPrint.FingerStatusFlags.NONE
|
||||
print("duplicate enrollment rejected")
|
||||
|
||||
d.delete_print_sync(p)
|
||||
d.close_sync()
|
||||
|
||||
del d
|
||||
del c
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user