Commit graph

1319 commits

Author SHA1 Message Date
Benjamin Berg 3f13ddc40d list-supported: Relativate "support" statement for website
The website suggest that the devices are "supported", however, it is not
clear what this means and can be read to imply that all of the devices
are expected to work well and upstream will fix issues.

Unfortunately, that is not really the case for all drivers. As such, add
a statement that the quality and supportability of drivers varies widely.
2021-03-08 12:34:41 +01:00
Benjamin Berg e0f081c6e3 sdcp-device: Use a key DB for testing 2021-02-18 12:28:19 +01:00
Benjamin Berg ae1fb4094b sdcp-device: Use predictable keys and random numbers for testing
If FP_DEVICE_EMULATION is set, then switch to using predictable EC
ephemeral key and random numbers. This should allow recording and
replaying real device interactions using umockdev.
2021-02-18 12:28:19 +01:00
Benjamin Berg 13350e05a2 port to low level EC key functions
This will allow creating a fixed key for testing
2021-02-18 12:28:19 +01:00
Benjamin Berg 3ea9cc90fe saner public key param 2021-02-18 12:28:19 +01:00
Benjamin Berg e862e8e881 fixups: use static OID data 2021-02-18 12:28:19 +01:00
Benjamin Berg 60f5cd650a ci: Enable SDCP helper for tests 2021-02-18 12:28:19 +01:00
Benjamin Berg 7ff36888b7 tests: Add SDCP virtual device test 2021-02-18 12:28:19 +01:00
Benjamin Berg e3043123f5 virtual-sdcp: Add a virtual SDCP device
This device is designed to talk to an external executable. This
executable can be provided/created using the test implementation from
Microsoft.
2021-02-18 12:28:18 +01:00
Benjamin Berg 77400b7a60 sdcp: Add SDCP base class
This adds a base class for SDCP devices. Not all functionality has been
fully tested, in particular the code to verify the model certificate is
most likely broken or incomplete. One problem there is that there is no
code to find the root CA to trust.

See: #257
2021-02-18 12:27:57 +01:00
Benjamin Berg 8d83e5eb38 meson: Shuffle around driver/helper definition
This is in order to add a new SDCP helper without having to define more
complicated logic.
2021-02-18 12:27:56 +01:00
Benjamin Berg e59d5451cc meson: Move source generation into libfprint meson file 2021-02-18 12:04:25 +01:00
Benjamin Berg 798bc4ee1e scripts: Speed up uncrustify by running 4 jobs in parallel
There are some large files, and in most setups (including CI runners) we
have multiple cores available. Use xargs to run multiple parallel
uncrustify jobs rather than one large one. Just hardcode 4 jobs and 4
files at the same time for now.
2021-02-18 12:00:52 +01:00
Benjamin Berg 0e732dbafa ssm: Add API to get device
This can be useful in some cases and it was simply missing.
2021-02-18 12:00:52 +01:00
Benjamin Berg 84112abc71 device: Add new FP_DEVICE_ERROR_UNTRUSTED error code
Throw a specific error when we are unable to verify the integrety of the
device.
2021-02-18 12:00:51 +01:00
Benjamin Berg c221c6b63e print: Add an SDCP print type
For now it is identical to a RAW print. However, this is likely to
change in the future.
2021-02-18 11:59:54 +01:00
Benjamin Berg 6e28b9a8c4 print: Fix pspec of print type to match real default
The default is actually FPI_PRINT_UNDEFINED and not FPI_PRINT_RAW.
2021-02-18 11:59:54 +01:00
Benjamin Berg e5589a0ec2 ci: Include SDCP test binary in image 2021-02-18 11:59:54 +01:00
Benjamin Berg 966703057d synaptics: Fix lost messages when sequence counter overflows
The device will always use sequence number 0 for certain messages. We
use this knowledge to filter the messages and assume that it is one of
these special messages rather than a response to a command.

However, we could end up sending a command with a sequence counter of 0
which would result in the response being ignored. Fix this by ensuring
we correctly wrap from 255 to 1 instead of 0.

Fixes: #358
2021-02-05 16:09:24 +01:00
weilei 9e164485f0 goodixmoc:Add new PID
Add PID 6594 used by LENOVO
2021-02-04 18:51:36 +08:00
fengqiangguo 3bb38e2ff6 goodixmoc: support power button shield feature
Some OEM will integrate fingerprint device with powerButton. It's
possible that a user may press the power button during fingerprint
enroll or identify. This would lead to unintended PC shutdown or
hibernation. We add pwr_btn_shield cmd  and related process to shield
the power button function when the fingerprint functionality (enroll and
identify) is used and restore power button function afterwards.
2021-02-02 09:04:45 +08:00
Marco Trevisan (Treviño) 6a62d32c81 goodix: Consume the retry errors during verify/identify reports
We should not pass such kind of errors to complete functions, or we'll
fail the identification without ability to retry immediately.
2021-01-29 20:02:15 +01:00
Marco Trevisan (Treviño) b2a64cc980 virtual-device: Do actual errors codes checks instead of regex checks 2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 88117c172e tests/virtual-device: Add enroll and verify script test 2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 27a62443a1 virtual-device: Add SET_KEEP_ALIVE command, to keep the listener up
We may want to be able to talk with the device while it's closed to
queue commands to be performed once it opens (could be even a script),
so to do this we need to close the device first, send those commands and
eventually process them.

We used a trick to send an invalid command before that was ignored by
release, but having the device available is just easier to handle.

So, when keep alive is enabled we don't stop the listener when closing
but only on actual device disposition.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 2f7c78eb97 virtual-device: Make possible to use a script to perform enroll operations 2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 74f8a8ee27 virtual-device: Handle cancelled state gracefully in should_wait_to_sleep 2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) acd0a10e76 virtual-device: Add test that open fails with a busy error if is still ongoing
The idea of the test was just checking what happens when we're opening a
device multiple times while a first request is still going.

However, it actually ends up also checking the previous commit change
because without it we'd stop the close iteration before the device is
actually closed and stop the open iteration before the device is
actually opened, leading to an infinite loop.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 27c2466bda fpi-device: Mark the device as open and notify it on idle callback
We're delaying any completed operation until we've completed an idle,
but the open/close state is changed and notified as soon as the device
completes the operation.

While this can be true, it means that we notify earlier than the finish
callback is actually called, while iterations are still needed to get
the actual state completed, and the current_task reset.

So if we'd open/close and iterate till fp_device_is_open() returns TRUE
we'd end up in a state in which the device is marked as ready, but it's
actually still busy since it's priv->current_task isn't unset yet.
The same if we'd try to do any action on notify::opened.
2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 33ba248c44 virtual-device: Add test checking for early errors during dev API calls 2021-01-28 15:49:22 +01:00
Marco Trevisan (Treviño) 43cf28b9da fp-device: Do not try to deference potentially NULL task data
In case we do an early error return in verify and identify calls we
do not initialize the task data, but still in the finish functions we
still try to use it.

Avoid doing this, but just nullify the returned values.
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño) 4da52f78f6 virtual-device: Check properties match the getters 2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño) e4e0937848 tests/virtual-*: Check for enrolled prints properties 2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño) 25a6c916aa fp-device: Fix property getters for enroll stages and driver ID
We were returning an invalid type for the enroll stages, while trying to
get the class from the private instance for the device driver
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño) 51009b48a0 virtual-device: Process supported commands on device open
When opening the device we can process commands that we left for that
after the previous close, to do that we only have to inject an invalid
command that will be processed (and ignored) while closing, so that at
next device opening we will be able to proceed with the previously
sent commands.

Add tests to finally check this case!
2021-01-28 15:39:48 +01:00
Marco Trevisan (Treviño) e1e3f6955e virtual-device: Remove messages we can't process from queue when not scanning
Commands that are not valid for non-scan operations should be removed
from queue, or these may be re-proposed forever.
2021-01-28 15:38:57 +01:00
Marco Trevisan (Treviño) c495b82000 virtual-device: Use python's with idiom to check GLib expected error messages
And we can properly provide a real traceback as well
2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño) d90ee96df8 virtual-device: Return an duplicated data error if trying to re-enroll a print 2021-01-28 15:38:56 +01:00
Marco Trevisan (Treviño) 36304b736b tests/virtual-device: Properly handle exceptions on enroll callback
We need to get them back to the caller function to be caught by the test
suite.
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño) 31e34bd4bd virtual-device: Emit data not found during verify/identify
If trying to identify a print not in the storage we emit data not found
error, this can be helpful to do further fprintd testing too
2021-01-28 15:38:29 +01:00
Marco Trevisan (Treviño) ec4c7ca5a9 virtual-device-storage: Don't listed prints 2021-01-28 02:32:28 +01:00
Benjamin Berg 8d21a9c27c ssm: Catch more errors in FpiSsm without crashing 2021-01-27 17:03:59 +00:00
Marco Trevisan (Treviño) c4069065f9 virtual-device: Ensure we've an error before dereferencing it 2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño) 31541edc58 tests/virtual-device: Use a sleep multiplier when under valgrind 2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño) 549718753f fpi-device: Fix argument name on report_finger_status() annotation 2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño) cfde050220 virtual-device: Add ability to close a device with delay or with error 2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño) 88a38c38af virtual-device: Add support for sleeping and sending errors on list and delete 2021-01-26 16:54:14 +01:00
Marco Trevisan (Treviño) 7ffcc2f9e7 virtual-device: Make possible to inject sleep events while verifying/identifying
Each command should be separated by SLEEP to be considered as something
we want to perform during the current operation, otherwise will be used
by next operation consuming it.
2021-01-26 16:53:24 +01:00
Marco Trevisan (Treviño) 1dae6796f7 virtual-device: Report finger presency when we receive a 'SCAN' event 2021-01-26 04:49:50 +01:00
Marco Trevisan (Treviño) 0bb0492025 virtual-device: Mark finger as needed only after we start scanning
In case we sent a sleep event to the device we may want to wait it to
emit the finger needed state before the timeout is completed.

So add a function to manage this for all the scan cases
2021-01-26 04:49:50 +01:00