100 Commits
Author SHA1 Message Date
Marco Trevisan (Treviño) 80a4b5ec61 build: Release libfprint 1.94.100 2026-07-26 00:36:25 +02:00
Marco Trevisan (Treviño) 5f49a0fa1f NEWS: Update for libfprint 1.94.100
A bigger micro version as we have enough changes, but not as many to do
a minor version bump yet, that is planned for next one.
2026-07-26 00:36:11 +02:00
Marco Trevisan (Treviño) facbb5f73b build: Bump meson dependency to 0.62 2026-07-26 00:33:46 +02:00
Marco Trevisan (Treviño) 1dd419de3e data, udev-hwdb: Sync unsupported devices with wiki 2026-07-26 00:33:46 +02:00
Marco Trevisan (Treviño) 77f9ad2df1 build: Make sync-udev-hwdb dependent on hwdb list re-generation 2026-07-26 00:24:36 +02:00
Marco Trevisan (Treviño) a6240828c1 tests/egis_etu905: Actually test the device identify cancellation path 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) b8154bf466 egis_etu905: Handle cancel as part of the device SSM return
Cancelling an operation does allow the driver to do perform async ops
at the moment, but rather we are supposed to just send the the cancel
commands while another action may running.

So we should handle this as part of the SSM final stage, if cancellation
happened.
2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 4bc5213e08 egis_etu905: Split cancellable handling in commands
cancel command cannot be cancellable, while we want others to be, so
let's split the two cases, and handle them separately
2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) de5d539b50 fpi-device: Use the error quark string to debug unknown error domains 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 1b589a9245 fpi-device: Add more specific debug info for usb errors 2026-07-25 21:21:50 +00:00
Marco Trevisan (Treviño) 91012c3690 ci: Use ninja to generate coverage files
meson compile -C <build-dir> coverage is not a thing

See: https://github.com/mesonbuild/meson/issues/7895
2026-07-24 17:58:18 +02:00
Marco Trevisan (Treviño) 157ec7e544 fp-device: Add debug for task cancellation requests 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) d938dc0278 mafpmoc: Remove unused cancel vfunc 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) dcf37cf476 egismoc: Remove unneeded length definitions 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) ebb4b058b4 egis_etu905: Remove unneeded length definitions 2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) f3d17a24f9 egis_etu905: Decouple SSM and command data from device
While most of commands should run separated, others such as cancellation
can run concurrently so we cannot share command data in the device
structure, but it has to be rather per command.

Move it there
2026-07-24 10:54:02 +00:00
Marco Trevisan (Treviño) ffdb0a84b8 ci/build: Use meson compile rather than ninja 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 1b9bee4b6d build: Use run_target for sync-udev-hwdb 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) c890325589 build: Add dist check script that checks if there are unsupported devices 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 5113f7ec3b ci: Use sync unsupported devices tool to check for diffs 2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) b72feabc58 build: Add script to update the unsupported devices from wiki
Avoid some more manual labor
2026-07-24 10:44:26 +00:00
Marco Trevisan (Treviño) 833d39ab59 aes2550: Complete deactivation from dev_deactivate on broken loops
The driver relied on a running finger-detection or capture callback to
observe the deactivating flag and call complete_deactivation(). When the
async loop was broken by a session error from a terminal callback (such
as capture_sm_complete), no further iteration was left to notice the
flag, so the deactivation never completed.

Rather than scatter complete_deactivation() calls after every
fpi_image_device_session_error(), track whether an operation is actually
pending with an "active" flag and let dev_deactivate() complete the
request itself when nothing is in flight.

This keeps the deactivation lifecycle owned by dev_deactivate.
2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño)andShengyu Qu 87a7023831 aes2550: Add basic test to check too-short errors
Traces provided by Shengyu Qu

Co-Authored-By: Shengyu Qu <wiagn@4d2.org>
2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 44f3bbc43a build: Allow to run umockdev tests separately 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) fc9fd638a8 tests/umocdev-test: Allow to run just one test at time 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) c02d58a369 tests/create-driver-test: Use argparse and allow to record only one case 2026-07-23 14:36:02 +02:00
Marco Trevisan (Treviño) 71cff7966e tests/create-driver-tests.py: Allow to create both capture and custom tests
A device may provide both tests, so let's make this easier to achieve
2026-07-23 13:08:54 +02:00
Marco Trevisan (Treviño) 6df065c399 Revert "fpi-print: Add function to check if two prints match"
This reverts commit b4d78e7c0f.
2026-07-13 12:10:21 +02:00
Marco Trevisan (Treviño) 323d8c3f85 fpi-device: Do not check for scanned prints equalty on NBIS prints
We cannot assume that two NBIS prints are matching without going through
proper NBIS checks, so we cannot do a check on the scanned print without
an extra thread, which is rather an overkill.

So let's just do the check for prints we can actually compare (raw ones
for now)
2026-07-13 12:09:36 +02:00
Marco Trevisan (Treviño) 73f641344b fpi-print: Expose a method to get the internal print type
We could use the property, but a getter is handier to use
2026-07-13 12:09:35 +02:00
Marco Trevisan (Treviño) 0abe22bd94 virtual-image: Do print enroll and verification using transformed images
We used to enroll and verify always the same prints, which made
generating the very same enrolled prints, that simplifies the libfprint
matching.

To make this a bit more real, let's apply some transformations to the
print images before sending them each time
2026-07-13 11:24:10 +02:00
Marco Trevisan (Treviño) 973aa65d4c vfs301: Handle unexpected data length gracefully 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 7f9504afd5 vfs301: Fix error handling on peeking events 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 98891dc042 vfs301: Handle a read failure as a protocol error 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ba6f87584a vfs101: Prevent a division by zero 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 62c8554dac vfs101: Fix an use-after-free issue 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2aa415f233 upekts: Validate inner length value before using it 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 5ccf66dd2c realtek: Do not check for negative values for gsize 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 873bca59ee realtek: Consider any non-success status as a failure during enroll 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 0a446df6f9 realtek: Handle missing missing or invalid templates as errors 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2a4e68d64a elanmoc: Do not pass NULL error to SSM mark failed
The error has been already checked and it's null here, so we need to
return a new error
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2dee163512 elan: Prevent division by zero 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) db316a59f4 elan: Use safer check on linear frame processing 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 0ca34709cd egismoc: Add bounds check to validate responses 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c30f767887 aesx660: Ignore oversized payloads 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 215974f211 aesx660: Fix strips leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) b04c11963e aes2510: Fix strips leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c3244f38dc aes1610: Fix strips memory leak 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 791d17e4c3 synaptics: Do not trust device's enrolled fingers if it leads to an overflow
The device may report a number of enrolled fingers but this value is not
checked against the data, so let's do it to prevent an overflow

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) da497eed89 synaptics: Bound device-supplied lengths when parsing messages
The message parser trusted the device-supplied payload length without
checking it against the number of bytes actually received.

A malicious or malfunctioning reader could thus drive an out-of-bounds
read past the received buffer.

Reject a header whose declared payload would extend past the received
data (and a too-short header).

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ecbc2affb2 upektc_img: Cleanup image bits on deactivation
Also ensure we never leak data
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 44dd97bf5e upektc_img: Prevent image frame overflow
The frame length and the offset (which depends on the device-supplied
frame type) are derived from device bytes, so validate both the source
read (against the response buffer) and the destination write (against
the image buffer) before copying.
A malicious or malfunctioning device could otherwise drive a negative
(huge once unsigned) or out-of-bounds length.

Note: the response is reassembled across several USB transfers, so the
bound here is the response buffer capacity rather than a single
transfer's actual_length.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 07152e43ef realtek: Fail on shorter data read that may lead to an underflow
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 2e2ba8b227 uru4000: Unset allocated data on completion 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 657c764b73 uru4000: Ensure we do not overflow image buffer on reading
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) ad8a6f6b17 uru4000: Prevent a buffer overflow on reading the device image data
num_lines comes from the device for each block and is summed into
the source row index (r) and destination byte offset (to).
Neither the per-block value nor the running totals are otherwise bound,
so a malicious device could drive the copy past the source
(IMAGE_HEIGHT rows) or destination buffer.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 63be3884d6 etes603: Handle buffer over/under-flows
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) c025abcd15 fpc: Prevent overflow when reading the print identity
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 3cc0ae79e7 fpc: Prevent a buffer-overflow on data reading
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 092c0dfc31 fpcmoc: Copy the error before sending to the SSM
The SSM error is stolen and then we pass to the resume/suspend callback
potentially leading to a double-free.

So copy it before re-using it.

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 3138ad0c8a goodixmoc: Cleanup the byte reader usage 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 0c0baf639e goodixmoc: Ensure we do not overflow when reading the payload
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) f15a62b5aa goodixmoc: Handle invalid finger number
A modified device may supply invalid data, leading to libfprint crashes

Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) d9374963cd goodixmoc: Handle cases in which the header lenght is smaller than CRC size
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 19719bf2da goodixmoc: Add missing return on CRC failure
Reported by: Keith Linneman (LinnemanLabs)
2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 11b8930d35 fpi-device: Fix device action error docstring and transfer 2026-07-13 08:13:46 +00:00
Marco Trevisan (Treviño) 5597082804 uncrustify: Add g_autolist and g_autoslist to auto types 2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) dac36a8d59 fp-device: Fix double free in device finalization with pending timeout sources
fp_device_finalize calls g_slist_free_full() to destroy any still-pending
timeout sources.
Each g_source_destroy call triggers timeout_finalize, which tries to
remove the current source from the sources list.
This may lead to a double-free, as iterating over a list deleting items
is not supported.

Add a regression test that adds a timeout with a long delay and immediately
finalizes the device while the timeout is still pending.
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 55b934b02e tests/fpi-device: Increase warmup/cooldown test timeouts
The slack of 250ms wasn't enough on loaded CI systems, causing frequent
flaky failures (e.g. 2276ms actual vs 2250ms limit, or 2294ms vs 2250ms).

Double the slacks to 500ms for the 2s transitions and 1000ms for the
5s transition to absorb system load noise while still catching real
timing regressions.
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 3cae9ea4ae build/tests: Add ability to define more per-test meson parameters 2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) a1713fab6b synaptics: Fix a comment typo 2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 18f60cb47f fpi-device: Improve logging on driver reported data
And perform data allocations only if debug logging is enabled
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) ebcab4ac1a fp-device: Use GLib API to deep copy the prints gallery 2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 91dd69475f tests/fpi-device: Add test identifying with an empty gallery
We're still going into the device in this case because technically the
identify operation may still return a print, although never a match of
course.

Adding tests so that we are not tempted to modify the behavior of the
identify function to return an error on prints->len == 0 or to just not
call the driver on such case.
2026-07-12 13:17:35 +02:00
Marco Trevisan (Treviño) 7e579f0f36 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.
2026-07-12 13:17:34 +02:00
Marco Trevisan (Treviño) 2f6b46b91f tests-fpi-device: Do not hardcode the gallery random pick limit 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) b4d78e7c0f fpi-print: Add function to check if two prints match
While for raw prints this is just an equality check, for NBIS prints
they match if at least one of the minutiae match
2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) 3ac3c7b082 tests-fpi-device: Add unit tests for prints equality 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) 7730146af0 fp-print: Just consider equal prints pointers to be equal 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) 7e3453e796 fpi-device: Do not potentially leak a nested error 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) cb862ccfad fpi-device: Remove commented function 2026-07-12 13:16:33 +02:00
Marco Trevisan (Treviño) c5e49592cd drivers: Remove redundant verify implementations
As per recent changes, drivers can just avoid implementing verify vfunc
unless the driver has specific commands to do it.

So let's just drop the duplicated code in drivers that have the very
same code path for both identification and verification.
2026-07-12 12:58:52 +02:00
Marco Trevisan (Treviño) bebaa80c99 fp-image-device: Drop explicit verification support
It's just the same logic repeated across one or multiple templates, so
let's just define one
2026-07-12 12:58:52 +02:00
Marco Trevisan (Treviño) 7fee92884d fp-device: Implement verify using identification
In case a device has not support for verification through an explicit
verify function, the verification can still be implemented using
identification with a gallery of a single print.

In fact that's what most of drivers these days do it, so let's just
avoid to them to handle this duplication unless a driver has really some
specific commands to do it.
2026-07-12 12:58:50 +02:00
Marco Trevisan (Treviño) 0e64435628 focaltech_moc: Simplify interface claiming error handling 2026-07-02 13:18:26 +02:00
Marco Trevisan (Treviño) 3c4bee9e82 ci: Add test build in s390x to verify BE behavior
Most of drivers supports both endiannesses but we do not test this so
let's add a CI job to verify this
2026-07-02 02:14:37 +02:00
Marco Trevisan (Treviño) 72188c0eb8 aes2501: Fix endianness of instogram 2026-07-02 02:14:37 +02:00
Marco Trevisan (Treviño) 141a63b0a4 egis_etu905: Use fpi writer to build the commit data 2026-07-01 17:59:34 +02:00
Marco Trevisan (Treviño) a042240b67 egis_etu905: Use little endian commit data in all the archs 2026-07-01 17:56:41 +02:00
Marco Trevisan (Treviño) 1d6ebb0ee8 uru4000: Fix computation of num lines in big endian 2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) e2ff73df3f elan: Use guint16 in LE for frame value 2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) e821d0f83f build: Enable elanspi in big endian archs
It works fine so no need to do anything there
2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 2ff99be5db goodixmoc: Fix handling of CRC32 in big endian archs 2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 2dec3f57ea mafpmoc: Use fpi-bytes-writer to build command packet 2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 5395d1d2c5 elanspi: Include fcntl properly 2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 10c0b68549 mafpmoc: Copy the most significant bit of the cmd instead of LSB
This was causing the command not to be properly used in big endian archs
2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 47583db988 build: Do not mark secugen endian-dependent
The driver works fine in big endian machine
2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) 050476e1ba fpcmoc: Use fpi-byte-{reader,writer} to parse/build the device data
In this way we have not endianness limitations
2026-07-01 17:49:34 +02:00
Marco Trevisan (Treviño) c039ab4754 fpcmoc: Add support to big endian architecture 2026-07-01 14:36:08 +02:00
Marco Trevisan (Treviño) 3e04f15179 build: Use a dict to define drivers build info
We used multiple arrays, making things more complicated than we should
with current meson
2026-07-01 14:00:56 +02:00