mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2026-05-18 21:18:11 +02:00
Comprehensive bugfix for issues found during code audit: 1. parse_match_result (CRITICAL): Replace dead while loop + hardcoded offsets with proper TLV dict parsing (tag LE16 + len LE16 + data) matching python-validity's parse_dict(). Extracts user_dbid (tag 1), subtype (tag 3), and hash (tag 4) from match result. 2. ENROLL_CREATE_USER (CRITICAL): Fix NULL user_id crash — g_uuid_string_random() now generates UUID for user identity instead of passing NULL to g_variant_new_string(). 3. Identify gallery matching: Match sensor result against gallery by comparing finger subtype instead of always returning first entry. 4. Field abuse: Add dedicated enroll_user_dbid field to FpiDeviceValidity instead of reusing delete_storage_dbid for enrollment state. 5. Delete SSM: Full implementation — enumerate users via get_user_storage, iterate users to find matching finger subtype, delete via cmd 0x48 (del_record). Proper error handling for missing records. 6. match_finger double allocation: Remove redundant 12-byte alloc/free, single clean 13-byte allocation per python-validity format. 7. clear_storage: Full SSM implementation — enumerate user storage, del_record for each user. Replaces NOT_SUPPORTED stub. 8. Clean stale TODO/placeholder comments. All 37 tests pass (0 fail, 2 skip — unchanged baseline). |
||
|---|---|---|
| .. | ||
| validity.c | ||
| validity.h | ||
| validity_blob_dbe_009a.inc | ||
| validity_capture.c | ||
| validity_capture.h | ||
| validity_db.c | ||
| validity_db.h | ||
| validity_enroll.c | ||
| validity_fwext.c | ||
| validity_fwext.h | ||
| validity_sensor.c | ||
| validity_sensor.h | ||
| validity_tls.c | ||
| validity_tls.h | ||
| validity_verify.c | ||
| vcsfw_protocol.c | ||
| vcsfw_protocol.h | ||