Commit graph

1852 commits

Author SHA1 Message Date
Leonardo Francisco
a87d2f4041 validity: Fix compiler warnings in TLS code
- Migrate from deprecated HMAC_* API to EVP_MAC (OpenSSL 3.x):
  tls_hmac_sign(), validity_tls_prf(), handle_priv_block()
- Remove unused ec_privkey_from_coords() function
- Remove unused x_le/y_le variables in handle_priv_block()
- Fix const discard in OSSL_PARAM_utf8_string() call
- Restore crt_hardcoded[] with G_GNUC_UNUSED (needed in Iter 6)
2026-04-10 22:18:43 +00:00
Leonardo Francisco
244f923441 validity: Iteration 4 — Sensor identification and HAL tables
Add post-TLS sensor identification infrastructure:

TLS command mechanism (vcsfw_tls_cmd_send):
- Reusable 2-state subsm for sending VCSFW commands inside TLS channel
- Uses 0x44 prefix + TLS app_data wrapping for sends
- Decrypts TLS response and extracts VCSFW status + payload

Sensor identification (cmd 0x75):
- validity_sensor_parse_identify() parses hw_major/hw_version
- DeviceInfo table (26 entries): maps (major, version) to device name
  and sensor type, with exact and fuzzy matching
- SensorTypeInfo table (14 entries): maps sensor_type to geometry
  parameters (bytes_per_line, line_width, calibration blob, etc.)

Factory bits retrieval (cmd 0x6f):
- validity_sensor_build_factory_bits_cmd() builds 9-byte command
- Response stored in sensor state for calibration (Iteration 5)

Open sequence integration:
- 4 new SSM states: OPEN_SENSOR_IDENTIFY, OPEN_SENSOR_IDENTIFY_RECV,
  OPEN_SENSOR_FACTORY_BITS, OPEN_SENSOR_FACTORY_BITS_RECV
- Sensor state init/clear wired into dev_open/dev_close

New files: validity_sensor.h, validity_sensor.c
Tests: 14 unit tests in test-validity-sensor.c (all passing)
Full suite: 6/6 OK, 0 failures
2026-04-10 22:18:43 +00:00
Leonardo Francisco
4ade76ea90 validity: Add firmware extension upload (Iteration 3)
Implement the firmware extension (fwext) upload module for
Validity/Synaptics VCSFW sensors. When the sensor reports no
firmware loaded (GET_FW_INFO returns status 0xB004), the driver
uploads the .xpfwext firmware file using the following sequence:

  1. WRITE_HW_REG32 (0x08) to prepare hardware register
  2. READ_HW_REG32 (0x07) to verify register state
  3. Load .xpfwext file from filesystem search paths
  4. For each 4KB chunk:
     a. Send db_write_enable blob (encrypted auth token)
     b. WRITE_FLASH (0x41) with chunk payload
     c. CLEANUP (0x1A) to commit chunk
  5. WRITE_FW_SIG (0x42) to upload RSA signature
  6. GET_FW_INFO (0x43) to verify successful upload
  7. REBOOT (0x05 0x02 0x00) to activate new firmware

Architecture: Uses the NULL-callback subsm pattern where SEND
states call vcsfw_cmd_send(self, ssm, cmd, len, NULL) and RECV
states read self->cmd_response_status/data directly. This avoids
the double-advance bug with fpi_ssm_start_subsm auto-advancing
the parent.

New files:
  - validity_fwext.h: Structures, SSM state enum, API declarations
  - validity_fwext.c: Upload SSM, file parser, command builders
  - validity_blob_dbe_009a.inc: db_write_enable blob for 06cb:009a
  - test-validity-fwext.c: 19 unit tests covering all pure functions

Modified files:
  - validity.h: Add cmd_response_status field to FpiDeviceValidity
  - validity.c: Add OPEN_UPLOAD_FWEXT state to open sequence
  - vcsfw_protocol.c: Save status in cmd_receive_cb for RECV states
  - meson.build: Add validity_fwext.c to driver sources

Test results: 34 OK, 0 Fail, 2 Skipped
2026-04-10 22:18:43 +00:00
Leonardo Francisco
5cee45025a validity: Add TLS session management (Iteration 2)
Implement the TLS handshake and encrypted channel for VCSFW sensors:

- validity_tls.c/h: TLS PRF (P_SHA256), AES-256-CBC encrypt/decrypt,
  PSK derivation from DMI (machine binding), flash partition parsing
  (cert/privkey/ECDH blocks with SHA-256 integrity), ClientHello/
  ServerHello builders, full TLS handshake state machine
- validity.c: Integrate TLS into open sequence — check fwext status,
  read flash partition 1, perform TLS handshake when keys available,
  graceful skip when fwext not loaded
- validity.h: Add ValidityTlsState, fwext_loaded flag, TLS fields
- OpenSSL dependency for ECDH, AES-256-CBC, HMAC-SHA256

Tests (18 total in test-validity-tls):
  - 13 unit tests: init/free, ClientHello format, PRF determinism/
    length/short, encrypt roundtrip/alignment, decrypt invalid,
    PSK derivation/determinism, flash parse empty/truncated,
    unwrap invalid
  - 5 regression tests for bugs found during hardware testing:
    - flash parse ordering (PSK must precede parse)
    - READ_FLASH command format (13-byte layout)
    - flash response 6-byte header unwrap
    - ServerHello expects raw TLS (no VCSFW prefix)
    - ClientHello TLS record prefix (0x44000000)
  - Hardware integration test script (test_tls_hardware.py)

All 33 project tests pass (0 fail, 2 skipped).
2026-04-10 22:18:43 +00:00
Leonardo Francisco
9779493380 validity: Add new driver for Validity/Synaptics VCSFW sensors
Add a new "validity" driver for Validity/Synaptics fingerprint sensors
that use the VCSFW protocol (as opposed to BMKT). This is iteration 1
of a multi-phase effort to bring native libfprint support to these
widely-deployed sensors found in ThinkPad T480/T480s/T580/X1 Carbon
Gen6 and many other laptops.

This initial iteration implements:
- VCSFW command/response transport layer over USB bulk endpoints
- GET_VERSION command parsing (firmware version, product ID, build)
- Synchronous probe and async open/close state machines
- Stub implementations for enroll/verify/identify (return NOT_SUPPORTED)
- umockdev replay test with real hardware capture

Supported USB IDs (VCSFW protocol):
- 138a:0090 (Validity VFS7500)
- 138a:0097 (Validity VFS5011)
- 06cb:009a (Synaptics Metallica MIS Touch)
- 138a:009d (Validity VFS7552)

These were previously (incorrectly) claimed by the synaptics driver
which uses the BMKT protocol.
2026-04-10 22:18:43 +00:00
Ken
ee422fc3c5 elanmoc: Add new PID 0xCB2 2026-03-20 11:23:09 +08:00
FIM43-Redeye
66b1ada0d6 tests: Update goodixmoc capture for verify finger-up wait
Re-record the umockdev USB capture to include the new
GOODIX_VERIFY_WAIT_FINGER_UP state's USB exchanges during
verify and identify operations.

Captured on a Goodix MOC sensor (27c6:609c, Framework Laptop 13)
with FP_DEVICE_EMULATION=1 as required by the test framework.
2026-03-17 17:55:38 +00:00
FIM43-Redeye
7893c2cb36 goodixmoc: Wait for finger removal before completing verify
The goodixmoc driver's verify state machine was missing a
WAIT_FINGER_UP state between IDENTIFY and PWR_BTN_SHIELD_OFF.
After the sensor reported a match/no-match result, the driver
immediately completed the verify operation without waiting for
the finger to be lifted from the sensor.

This caused problems when fprintd retried verification after a
no-match: the finger was still on the sensor, so the same
(wrong) finger was scanned again instantly. On fast match-on-chip
readers, all retry attempts could be exhausted in under a second,
giving the user no time to reposition their finger.

Add GOODIX_VERIFY_WAIT_FINGER_UP to the verify state machine,
mirroring the existing GOODIX_ENROLL_WAIT_FINGER_UP in the
enroll flow. The new state sends MOC_CMD0_FINGER_MODE /
MOC_CMD1_SET_FINGER_UP to the sensor and waits for the finger
to be removed before advancing to PWR_BTN_SHIELD_OFF.

The callback handles the same cases as the enroll equivalent:
- Timeout (5s): retry the finger-up wait
- Protocol error: fail the SSM
- Success: clear FINGER_STATUS_PRESENT and advance

Link: https://gitlab.freedesktop.org/libfprint/fprintd/-/issues/209
2026-03-17 17:55:38 +00:00
Daniel Schaefer
2c7842c905 focaltech_moc: add new pid:0x077A pid:0x079A
Tested on working hardware with examples/enroll and examples/verify

Signed-off-by: Daniel Schaefer <dhs@frame.work>
2026-02-12 17:09:41 +08:00
Marco Trevisan (Treviño)
e8c55c5939 data/autosuspend.hwdb: Sync with unsupported devices wiki 2026-02-10 05:41:06 +00:00
Marco Trevisan (Treviño)
fedb62f091 ci: Make jobs interrumpible 2026-02-10 06:35:26 +01:00
Marco Trevisan (Treviño)
cc41f805f2 tests/valgrind-python.supp: Ignore PyGObject leaks
They are unrelated to fprint itself, so let's ignore them
2026-02-10 06:33:00 +01:00
Marco Trevisan (Treviño)
1ee7df6cf2 ci: Add PyGObject symbols 2026-02-10 06:33:00 +01:00
Marco Trevisan (Treviño)
3f43c9356c build: Ignore -Werror=unused-but-set-variable for nbis 2026-02-10 06:33:00 +01:00
Marco Trevisan (Treviño)
0c97a47d8e Release 1.94.10 2026-02-10 03:18:14 +01:00
Petko Bordjukov
5f1da71e70 synaptics: Add 06cb:00e9
Tested working on an HP x360 1040 G8

Reverts: 0edae7b641
2026-02-10 02:01:08 +00:00
Ankur
87092d74ff Add support for 04f3:0ca7 Elan Microelectronics Corp. ELAN:ARM-M4 2025-12-18 10:59:29 -08:00
herman lin
df67c08a97 elanmoc: Add new PID 0xCB0 2025-12-16 16:20:35 +08:00
Marco Trevisan (Treviño)
b069c78348 fpcmoc: Do not leak the interrupt cancellable
g_set_object adds a reference already so we need to cleanup the original
reference first if we do not want to leak it
2025-12-09 20:37:34 +01:00
Marco Trevisan (Treviño)
bd7c745b02 ci: Use rawhide for testing again
Reverts commit: 9141014456
2025-12-06 03:17:52 +01:00
Marco Trevisan (Treviño)
aa010b5c3b fp-device: Clarify getter for open property 2025-12-06 03:17:52 +01:00
Marco Trevisan (Treviño)
a9c6621119 focaltech_moc: add new pid:0xA27A 2025-12-06 01:39:32 +00:00
Ryan Wong
3cd4f4d80d Realtek: Add new ID 2541:fa03
This FPreader was found on Minisforum X1 Pro MiniPC, and it is
listed by lsusb as "Generic Realtek USB2.0 Finger Print Bridge".
Though the VID is not the same as the well-known "0bda", we can
confirm it's from Realtek by analyzing Windows version driver.

Signed-off-by: Ryan Wong <colorfulshark@gmail.com>
2025-12-06 01:33:10 +00:00
Himura Kazuto
3460b020e1 egismoc: support ETU905A88-E device (1c7a:0584) 2025-12-06 01:26:29 +00:00
herman lin
0202368f17 elanmoc: Add new PID 0x0CA8 2025-12-06 01:21:04 +00:00
Hao Chen
b039469711 focaltech: add support for 2808:1579 2025-12-06 01:15:36 +00:00
Marco Trevisan (Treviño)
c2988ae33d drivers: Do not use Fp-prefix for driver-specific types
It's a libfprint specific prefix, so let's avoid confusion.
2025-12-06 01:09:38 +00:00
Marco Trevisan (Treviño)
9a4faf378e libfprint: Use fatal-warnings on g-i-scanner
Be strict on introspection checks, so that we are sure to do the things
properly.
2025-12-06 01:03:51 +00:00
jialei
1af1acd81c goodixmoc:add new PID 0x66A9 2025-12-06 00:52:02 +00:00
Aris Lin
83367979a1 synaptics: add new PID 0x1A0 2025-12-06 00:42:44 +00:00
SilverDiamond
ebbf806d5c egismoc: add 1c7a:0588 2025-12-06 00:35:37 +00:00
With Mask
35956799e7 Edit autosuspend.hwdb 2025-11-08 20:57:52 +00:00
With Mask
c7ab8e992c feat: Add support for Synaptics 06cb:0169 2025-11-08 10:30:27 +00:00
Danny
596b5f8032 fpcmoc: add 10a5:a306 fingerprint reader 2025-08-08 21:30:32 +02:00
Aris Lin
7f5304d6ee synaptics: add new PID 0x019F, 0x109 and 0x10A 2025-07-31 23:56:39 +00:00
Aris Lin
bde868f05e synaptics: add usb reset in probe to recover stall condition 2025-07-31 23:56:39 +00:00
Marco Trevisan (Treviño)
a7448fbb4a ci: Only run pages step on push events 2025-08-01 01:47:17 +02:00
Marco Trevisan (Treviño)
f84ab3d104 gcovr: Add gcovr project configuration
And mark suspicious hits as warnings instead of failures
2025-08-01 01:42:01 +02:00
Benjamin Berg
da42268911 goodixmoc: fix crash in exit callback handler
If the button shield command cannot be executed due to an underlying
error then resp is NULL. Avoid the crash by adding the appropriate
check.

Closes: #694
2025-07-24 08:39:54 +02:00
Benjamin Berg
d83a785260 ci: permit coverage failures for now
gcovr seems to fail for unclear reasons. Permit failures to not block
merge requests.
2025-07-23 19:09:54 +02:00
Jordan Petridis
2b100a912b ci: Pin the version of the Flatpak template
In [1] the template broke due to the inclusion of
a sub-include which doesn't resolve across different
gitlab instances without the same group setup.

Pin the template for now to the previous working commit

[1] https://gitlab.gnome.org/GNOME/citemplates/-/merge_requests/104#note_2501085
2025-07-23 19:09:04 +02:00
Marco Trevisan (Treviño)
dc8b05f0a3 Release 1.94.9 2025-02-20 18:41:27 +01:00
Marco Trevisan (Treviño)
c37da8568f build: Use fs to get files basename
We can safely bump meson
2025-02-20 18:41:27 +01:00
Marco Trevisan (Treviño)
e401fc10e8 build: Do not use deprecated features in meson 2025-02-20 18:28:15 +01:00
Marco Trevisan (Treviño)
db48d1a4e4 build: Adapt meson version to requirements 2025-02-20 18:28:15 +01:00
Marco Trevisan (Treviño)
d1504a30b7 fp-device: Clarify docs about FP_DEVICE_RETRY_TOO_FAST
This is an error that is valid also for touch devices, so let's make it
more generic in description
2025-02-20 17:20:03 +01:00
Marco Trevisan (Treviño)
7208b29756 tests: Ignore testing external tools with valgrind 2025-02-20 15:50:46 +00:00
Marco Trevisan (Treviño)
e9dbfbec39 ci: Install appstream for testing metainfo 2025-02-20 15:50:46 +00:00
Marco Trevisan (Treviño)
c6ca915067 tests: Validate the generated metainfo if appstreamcli is available 2025-02-20 15:50:46 +00:00
Marco Trevisan (Treviño)
385bc5e384 libfprint/fprint-list-metainfo: Generate AppStream metainfo
UI tools can use this information to see what package provides support
for specific devices, so let's provide the data since we have it.
2025-02-20 15:50:46 +00:00