mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-06-10 18:24:19 +00:00
egis_etu905: Double-check that the identified ID is part of the enrolled list
This commit is contained in:
@@ -1203,6 +1203,7 @@ egis_etu905_identify_check_cb (FpDevice *device,
|
|||||||
rsp_identify_match_suffix,
|
rsp_identify_match_suffix,
|
||||||
rsp_identify_match_suffix_len))
|
rsp_identify_match_suffix_len))
|
||||||
{
|
{
|
||||||
|
gboolean id_known = FALSE;
|
||||||
FpiByteReader reader;
|
FpiByteReader reader;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -1225,6 +1226,32 @@ egis_etu905_identify_check_cb (FpDevice *device,
|
|||||||
|
|
||||||
fp_dbg ("Device-reported matched print id: %s", device_print_id);
|
fp_dbg ("Device-reported matched print id: %s", device_print_id);
|
||||||
|
|
||||||
|
/* While the returned ID should indeed be part of the enrolled list, since
|
||||||
|
* we got it, let's double check that this is really the case.
|
||||||
|
*/
|
||||||
|
if (self->enrolled_ids)
|
||||||
|
{
|
||||||
|
for (guint i = 0; i < self->enrolled_ids->len; i++)
|
||||||
|
{
|
||||||
|
if (memcmp (g_ptr_array_index (self->enrolled_ids, i),
|
||||||
|
device_print_id,
|
||||||
|
EGIS_ETU905_FINGERPRINT_DATA_SIZE) == 0)
|
||||||
|
{
|
||||||
|
id_known = TRUE;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!id_known)
|
||||||
|
{
|
||||||
|
fpi_ssm_mark_failed (self->task_ssm,
|
||||||
|
fpi_device_error_new_msg (FP_DEVICE_ERROR_PROTO,
|
||||||
|
"Device reported a match "
|
||||||
|
"for an unknown print id."));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Create a new print from this device_print_id and then see if it matches
|
/* Create a new print from this device_print_id and then see if it matches
|
||||||
* the one indicated
|
* the one indicated
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user