fpi-device: Warn if a device returns a scanned print that is not matching match

Devices can scan even without a match, but if they do match a print then
they must match.

Ensure this in code to prevent drivers to return inconsistent data.
This commit is contained in:
Marco Trevisan (Treviño)
2026-07-12 13:17:34 +02:00
parent 2f6b46b91f
commit 7e579f0f36
2 changed files with 110 additions and 3 deletions
+14
View File
@@ -2062,6 +2062,12 @@ fpi_device_verify_report (FpDevice *device,
{
fpi_device_get_verify_data (device, &data->match);
g_object_ref (data->match);
if (print && !fpi_print_match (print, data->match))
{
g_warning ("Driver reported a match providing a scanned print that is not matching it.");
g_clear_object (&print);
}
}
data->print = g_steal_pointer (&print);
@@ -2150,6 +2156,14 @@ fpi_device_identify_report (FpDevice *device,
}
else
{
if (match && print &&
!g_ptr_array_find_with_equal_func (data->gallery, print,
(GEqualFunc) fpi_print_match, NULL))
{
g_warning ("Driver reported a match providing a scanned print that is not matching any in the gallery.");
g_clear_object (&print);
}
if (match)
data->match = g_steal_pointer (&match);