libfprint/libfprint/drivers/validity
Leonardo Francisco f7ce74df1b validity: fix dead code, stubs, and broken logic across Iteration 6
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).
2026-04-10 22:18:43 +00:00
..
validity.c validity: Iteration 6 — Enrollment, Verification, and DB Management 2026-04-10 22:18:43 +00:00
validity.h validity: fix dead code, stubs, and broken logic across Iteration 6 2026-04-10 22:18:43 +00:00
validity_blob_dbe_009a.inc validity: Add firmware extension upload (Iteration 3) 2026-04-10 22:18:43 +00:00
validity_capture.c validity: Add capture program infrastructure (Iteration 5) 2026-04-10 22:18:43 +00:00
validity_capture.h validity: Add capture program infrastructure (Iteration 5) 2026-04-10 22:18:43 +00:00
validity_db.c validity: fix dead code, stubs, and broken logic across Iteration 6 2026-04-10 22:18:43 +00:00
validity_db.h validity: Iteration 6 — Enrollment, Verification, and DB Management 2026-04-10 22:18:43 +00:00
validity_enroll.c validity: fix dead code, stubs, and broken logic across Iteration 6 2026-04-10 22:18:43 +00:00
validity_fwext.c validity: Add firmware extension upload (Iteration 3) 2026-04-10 22:18:43 +00:00
validity_fwext.h validity: Add firmware extension upload (Iteration 3) 2026-04-10 22:18:43 +00:00
validity_sensor.c validity: Iteration 4 — Sensor identification and HAL tables 2026-04-10 22:18:43 +00:00
validity_sensor.h validity: Iteration 4 — Sensor identification and HAL tables 2026-04-10 22:18:43 +00:00
validity_tls.c validity: Fix compiler warnings in TLS code 2026-04-10 22:18:43 +00:00
validity_tls.h validity: Add TLS session management (Iteration 2) 2026-04-10 22:18:43 +00:00
validity_verify.c validity: fix dead code, stubs, and broken logic across Iteration 6 2026-04-10 22:18:43 +00:00
vcsfw_protocol.c validity: Iteration 4 — Sensor identification and HAL tables 2026-04-10 22:18:43 +00:00
vcsfw_protocol.h validity: Iteration 4 — Sensor identification and HAL tables 2026-04-10 22:18:43 +00:00