Commit Graph

1031 Commits

Author SHA1 Message Date
Benjamin Berg bdb7ebc317 upekts: Fix possible NULL pointer access
Reported by scan-build.
2020-05-15 17:55:02 +02:00
Benjamin Berg 79306adc24 vfs5011: Prevent too small images
We need more than 1 line for assembling, but in general, we should
have a reasonable amount of lines. So use the width in the hope we'll
get an image that is about square at least.

Closes: #135
2020-05-15 17:52:32 +02:00
Benjamin Berg 6c56e0369d upekts: Fix regression during initialisation
The driver has two helper functions to format a command. In one case,
the function was accidentally changed during the port to the new driver
APIs.

See https://bugzilla.redhat.com/show_bug.cgi?id=1832229
2020-05-15 17:52:10 +02:00
Marco Trevisan (Treviño) 737d41ee43 image-device: Terminate the current action with error on print failure
If we fail when setting the scanned image to a print, we'll have a fatal
error, in such case we can terminate the current action and deactivate the
device.
2020-05-15 17:50:18 +02:00
Marco Trevisan (Treviño) 1a2e525039 image: Return an error if we got an empty or NULL minutiae array
In some cases nbim's get_minutiae returns no minutiae without providing an
error code, and if this happens we would crash in the task callback function
as we would try to deference the data->minutiae pointer.

Related to: #251
2020-05-15 17:50:09 +02:00
Marco Trevisan (Treviño) 66a2df595f etes603: Return TOO_SHORT retry error for small images
If the image height is less than the sensor horizontal resolution, then
return a retry error rather than trying to submit the image for further
processing.

Related to: #251
2020-05-15 17:50:04 +02:00
Benjamin Berg 61efd09515 image: Check for task success rather than just cancellation
The minutiae detection might fail and we must not copy any data at that
point. So check g_task_had_error to ensure that we only do so when the
task was successful.

Fixes: #251
2020-05-15 17:49:58 +02:00
Bastien Nocera 72115bff04 upekts: Fix memory leak
Don't allocate a new finger print structure,
the fpi_device_get_enroll_data() just below will overwrite it.
2020-05-15 17:47:39 +02:00
Bastien Nocera 3722c875ec vfs0050: Fix incorrect destructor for GError 2020-05-15 17:46:04 +02:00
Bastien Nocera ee877259d7 aes1610: Fix memory leak
Fix small memory leak when reading some data that's not going to be
processed.
2020-05-15 17:45:50 +02:00
Marco Trevisan (Treviño) b1cf057468 Bump libfprint-tod version to v1.90.1+tod1 2020-02-28 17:49:44 +01:00
Marco Trevisan (Treviño) b2a78ddadc README.tod.md: Add a basic readme file 2020-02-28 17:49:44 +01:00
Marco Trevisan (Treviño) 19225aaa3e meson: Add fpi-compat.h to the private headers 2020-02-27 06:04:20 +01:00
Marco Trevisan (Treviño) 7b7fc2423e tod: Simplify the lib versioning as per upstream libname based on soname
No need to keep track of both revisions, as now that's part of the name
2020-02-27 05:58:33 +01:00
Marco Trevisan (Treviño) 337fe867e9 tod-shared-loader: Only allow drivers starting with "lib" prefix 2020-02-27 05:26:32 +01:00
Marco Trevisan (Treviño) 49fd3a5035 Merge tag 'v1.90.1' into tod
Tag 1.90.1
2020-02-27 05:24:32 +01:00
Benjamin Berg 66c9e4a829 Update for 1.90.1 release v1.90.1 2020-02-10 12:20:25 +01:00
Marco Trevisan (Treviño) 0bb8ad1313 tests: Make meson be aware of the single python unit tests
Scan for the unit tests in virtual-image suite and handle them individually
2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) 6eb06697e9 tests/virtual-image: Use introspection names for errors 2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) 355cae1bbd fp-device: Return error if trying to list a storage-less device
Devices with no storage don't allow listing prints, and if we try to do
that, we'd end up in trying to call a NULL function pointer, causing a crash

So always check if the device has storage before calling the list vfunc, and
if we fail, return an error.

Include an unit-test to verify this situation
2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) 15a90eb451 meson: Use gnu99 as default C standard 2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) 82ba69b1df meson: Depends on gusb 0.2.0, but only enable tests on 0.3.0 2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) ccd42bdece gitignore: Remove autotools ignores, add _build 2020-02-10 11:41:40 +01:00
Benjamin Berg e19a1a6550 meson: Create include directories in build tree
Without this we get warnings like the following:

  cc1: warning: .../_build/libfprint/nbis/libfprint-include: No such file or directory [-Wmissing-include-dirs]
2020-02-10 11:41:40 +01:00
Benjamin Berg 5ac770c614 tests: Return skip error if import fails
Rather than backtracing, just print the exception and return a skip
error if the import fails.
2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) 5faf8498d9 compat: Use new GDate autoptr and define if needed 2020-02-10 11:41:40 +01:00
Marco Trevisan (Treviño) cfbd5d27b7 comapt: Add FpDeviceClass compatibility autoptr and use it 2020-02-10 11:41:37 +01:00
Benjamin Berg 169ca1ba77 compat: Add compatibility defines for older GLib
We are already using a number of defines and autoptrs from newer GLib
releases. Add the appropriate compatibility defines rather than removing
the corresponding code.

Closes: #222
2020-02-10 11:40:40 +01:00
Marco Trevisan (Treviño) bb08d2e3c2 ci: Use extends to define extra libfprint variables
This allows to merge the values when included instead of replacing the whole
variables stanza.
2020-02-05 20:00:07 +01:00
Marco Trevisan (Treviño) ca5143ffa5 ci: Exclude flatpak job from the schedules 2020-02-05 19:37:42 +01:00
Marco Trevisan (Treviño) 7eb10178b8 ci: Use a template to define libfprint dependencies
This allows to share the configuration with fprintd
2020-02-05 18:04:00 +01:00
Marco Trevisan (Treviño) 2c9e252ca4 meson: Use versioned name for autosuspend udev rules
Given distros may have the previous value around, let's rename this too
2020-01-23 17:25:38 +01:00
Marco Trevisan (Treviño) 23fab3a20a Change SONAME and all the library paths to libfprint-2
To avoid conflicts with previous libfprint version and make sure that the
target version is the correct one (plus to allow parallel install in some
distros), let's use a versioned naming for the library keeping the abi
version in sync.

Fixes #223
2020-01-23 17:09:58 +01:00
Marco Trevisan (Treviño) 24e9363a46 doc/meson: Use ignore_headers instead of scan_args 2020-01-23 17:00:08 +01:00
Marco Trevisan (Treviño) a12d316aa4 meson: Use project name for log domain 2020-01-23 17:00:04 +01:00
Benjamin Berg 88461d53ec upekts: Fix use-after-free in an error condition
The callback function would continue processing even after having failed
the SSM already. This causes further invalid operations on the SSM.

This error was found using a coverity scan.
2020-01-21 14:19:33 +00:00
Marco Trevisan (Treviño) 3b47113122 synaptics: Immediately complete verification if finger removed
When quickly scanning a finger with the synaptic driver, it may wait forever
for finger removal even if this has already happened.

In fact we don't take care of the finger status when reporting the
verification.

To avoid this, add a function that delays the completion of the verification
until the finger removal if the finger is on sensor, otherwise it just
performs it.

Fixes #228
2020-01-20 18:24:16 +00:00
Marco Trevisan (Treviño) 7a7bec5a80 synaptics: Report a verify complete error on unexpected result
Also remove the unneeded verify report with match failure
2020-01-20 18:24:16 +00:00
Marco Trevisan (Treviño) 8be861b876 synaptics: Remove unneeded complete error/data parameters
Remove the never-used cmd_complete_data value and the repetition of
cmd_complete_error.

In fact now as per the fpi_device_verify_report() usage, we already pass
the match information to the device, such as the error and it will be
they will be used on completion if needed.

This allows to simplify cmd_ssm_done() as well.
2020-01-20 18:24:16 +00:00
Marco Trevisan (Treviño) 8893840ffa synaptics: Always report verify state early on non-match
In some cases we want to complete the verification after that the finger has
been removed, but we still need to promptly report the match state otherwise
fpi-device will complain about, and will eventually cause a match error
instead that reporting a non-match:

  synaptics: Finger is now on the sensor
  synaptics: Received message with 0 sequence number 0x91, ignoring!
  synaptics: interrupt transfer done
  synaptics: delaying match failure until after finger removal!
  synaptics: interrupt transfer done
  device: Driver reported successful verify complete but did not report the
          result earlier. Reporting error instead
  libfprint: Failed to verify print: An unspecified error occured!

Fixes #227
2020-01-20 18:24:16 +00:00
Marco Trevisan (Treviño) 4d6a7ec09d synaptics: Really check if a print is device database
Fix a typo causing the not-in-database print error to be fired, actually
checking the response result.
2020-01-20 18:24:16 +00:00
Benjamin Berg b9e546f05b tests: Add missing NULL terminator to g_object_new
The g_object_new call had a NULL argument for a property. This meant
that the compiler could not warn about the lack of NULL termination for
the argument list.

Add the missing NULL termination.
2020-01-20 13:34:31 +01:00
Marco Trevisan (Treviño) 05df5e2822 test-fpi-device: Verify driver enroll errors 2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) 58a9214610 test-fpi-device: Add tests for verify/identify warnings 2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) cdcc476325 examples/verify: Prompt match/no-match report in callback
Promptly show the match/no-match result in the match callback instead of
waiting the verification process to be finished.

Also exit in case of an hard error, while permit to try again in case of a
retry error.
2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) a87e9c546f test-fpi-device: Verify device action error operations 2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) ad514c3775 test-fpi-device: Fix file description 2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) 3c5b7f8ea6 test-fpi-device: Add more probe tests with errors 2020-01-17 19:44:52 +01:00
Marco Trevisan (Treviño) b09df0e40a test-fpi-device: Add tests for error message creation 2020-01-17 19:44:50 +01:00
Marco Trevisan (Treviño) 027ac8d843 fpi-device: Only mark a device as closed if the operation succeeded
We may fail during the close phase, in such case the device should not be
marked as closed.
2020-01-17 19:03:33 +01:00