Commit graph

510 commits

Author SHA1 Message Date
Bastien Nocera
0bdf801043 pam: Add helper to replace G_GNUC_UNUSED to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
6e3b053372 pam: Add include for bool to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
c6e72c5f28 pam: Add include for asprintf to copy/paste header 2020-01-23 18:45:43 +01:00
Bastien Nocera
986a42bcd1 pam: Update copyright notice 2020-01-23 18:45:43 +01:00
Bastien Nocera
0c6bab8640 main: Fix redeclaration linking error
Fix linking error as the "store" global variable gets redeclared in
each C file that includes the header. Move the actual declaration to
main.c.

Fixes:
 /usr/bin/ld: ./.libs/libfprintd.a(device.o):/builds/libfprint/fprintd/src/storage.h:51: multiple definition of `store'; main.o:/builds/libfprint/fprintd/src/storage.h:51: first defined here
2020-01-23 18:25:25 +01:00
Bastien Nocera
b99afd19f0 main: Use #pragma once 2020-01-23 18:25:18 +01:00
Bastien Nocera
3d6dfabd8d Revert "ci: Temporarily add newer pam_wrapper build"
This reverts commit db0ab55bef.
2020-01-23 18:25:14 +01:00
Marco Trevisan (Treviño)
67adcb59ed configure.ac: Depend on libfprint-2
libfprint changed SONAME to completely break with previous version, so
update fprintd dependency accordingly.
2020-01-23 18:24:53 +01:00
Bastien Nocera
db0ab55bef ci: Temporarily add newer pam_wrapper build
So that the test suite can pass.
2020-01-22 15:34:02 +01:00
Bastien Nocera
00b79d1a2f tests: Add test for the PAM module
Test the PAM module using pam_wrapper and our mock fprintd.

See https://lwn.net/Articles/671094/

Note that this requires a version of pam_wrapper with this bug fixed:
https://bugzilla.samba.org/show_bug.cgi?id=14245
2020-01-22 15:34:02 +01:00
Bastien Nocera
f1517af09a tests: Add fprintd-verify test that uses scripting 2020-01-20 17:31:46 +01:00
Bastien Nocera
c0bf1515fd tests: Check that verify test doesn't succeed early 2020-01-20 17:31:08 +01:00
Bastien Nocera
872089883c tests: Add scripting capabilities to the verification process
Add scripting capabilities to the verification process so that the mock
daemon can send its own results without needing the client to prod it to
do that. This is incredibly useful when the client is single threaded
and blocking.

Note that there are barely any safeguards, so the scripting task is not
cancelled if an error occurs, or the VerifyStatus signals are sent out
of order.
2020-01-20 17:26:24 +01:00
Bastien Nocera
431755becd tests: Add test for fprintd utils 2020-01-17 15:32:22 +01:00
Bastien Nocera
0a42b90390 tests: Add dbusmock template for fprintd daemon 2020-01-17 15:18:43 +01:00
Bastien Nocera
cd3ed2e450 device: Fix documentation for ERROR_INVALID_FINGERNAME 2020-01-17 14:41:22 +01:00
Bastien Nocera
c929d39df1 device: Fix "enrollemnt" typo 2020-01-17 14:40:36 +01:00
Bastien Nocera
1a5ef6c5a7 build: Add separate dependency for pam module 2020-01-14 15:52:21 +01:00
Bastien Nocera
ce3406b20f main: Fix typos in comments 2020-01-14 14:00:56 +01:00
Bastien Nocera
0d407db171 manager: Fix typo in comment 2020-01-14 14:00:56 +01:00
Bastien Nocera
4eb751a218 data: Fix typos in man pages 2020-01-14 14:00:56 +01:00
Bastien Nocera
0f44267ea1 README.transifex: Fix typo 2020-01-14 14:00:56 +01:00
Bastien Nocera
9baea4494b device: Replace deprecated g_type_class_add_private() 2020-01-14 14:00:56 +01:00
Bastien Nocera
41afbd1ced device: Simplify FprintDevicePrivate declaration 2020-01-14 14:00:56 +01:00
Bastien Nocera
f2d6921b74 manager: Replace deprecated g_type_class_add_private() 2020-01-14 14:00:56 +01:00
Bastien Nocera
b690daa95f all: Call setlocale() at the start of main()
This fixes some broken characters in the fprintd debug output.
2020-01-14 13:51:46 +01:00
Benjamin Berg
deb3c25e51 device: Adjust to new libfprint API for early match reporting
This API was added to libfprint to allow drivers to report the match
result early before the operation has been completed. No driver makes
use of this facility yet and instead drivers try to finish the
operation early for quick result reporting. This primarily means not
waiting for finger removal.

Once drivers are updated, fprintd reactivity will regress unless the
early match callback is implemented as they would only get an operation
finished callback when the whole of the operation was finished,
including finger removal and finishing up USB communications.

See: https://gitlab.freedesktop.org/libfprint/fprintd/issues/35
2020-01-14 13:41:57 +01:00
Marco Trevisan (Treviño)
a520896325 device: Use FP_FINGER_IS_VALID to check finger number 2019-12-19 14:29:04 +01:00
Marco Trevisan (Treviño)
707ed01059 file_storage: Remove definition of FP_FINGER_IS_VALID
This is now provided by libfprint
2019-12-19 14:28:35 +01:00
Marco Trevisan (Treviño)
6903c36157 file-storage: Use first/last fingers references instead of named ones
Don't depend in the hardcoded libfprint fingers order, but use instead the
aliases for first/last fingers in libfprint order
2019-12-18 17:34:04 +01:00
Bastien Nocera
d0df422f9b all: Bump required glib version
Require the same version of glib as libfprint, and remove support for
very old versions.
2019-12-18 17:03:37 +01:00
Benjamin Berg
882740f8a1 utils: Use new print deletion API
Use the new API that works by claiming the device and then deleting the
prints.

Fixes: #26
2019-12-05 17:54:21 +01:00
Benjamin Berg
5043ef3c7d device: Print warnings for fatal errors 2019-12-04 17:03:53 +01:00
Benjamin Berg
cdd79a0935 ci: Remove libfprint dependencies that are not needed
The dependency list of libfprint used to be a direct copy of the
libfprint CI list. However, many of the dependencies are not needed as
only a minimal version of libfprint is built for testing purposes.
2019-12-03 17:08:04 +01:00
Benjamin Berg
776b4f4cec device: Log offending API user if DeleteEnrolledFinger is used
When the DeleteEnrolledFinger API is used, log an additional warning
with the command that made the call.
2019-12-03 17:08:04 +01:00
Benjamin Berg
31bfd1b055 ci: Run make check in the test stage 2019-12-03 17:08:04 +01:00
Benjamin Berg
74838f9efc tests: Add basic integration test
This test uses the virtual image driver included in libfprint for
testing.
2019-12-03 17:08:04 +01:00
Benjamin Berg
54ba81191e tests: Add test prints from libfprint
These can be freely redistributed as they are in the public domain. See
the included README.
2019-12-03 17:08:03 +01:00
Benjamin Berg
521ba9b124 storage: Use $STATE_DIRECTORY when available
The state directory will generally be the same as the hardcoded one.
However, being able to override it is important for testing purposes, so
add the option.
2019-12-03 17:08:03 +01:00
Benjamin Berg
3db69c2c2f utils: Move test binaries into utils
These utilities are generally useful beyond only testing purproses. And,
since it is desirable to have automated tests inside the tests
subdirecty, it makes sense to move them elsewhere.
2019-12-03 17:08:03 +01:00
Benjamin Berg
b2ff316e20 device: Add new API and fallback to delete prints from device
Some devices require storing the print on the device, to support this,
try deleting prints from the device before deleting them from local
storage.

To handle these devices, add a new API that requires the device to be
claimed rather than allowing deletion without claiming the device first.
Also add appropriate fallbacks so that the old API will continue to
work, but warn about its use.
2019-12-03 17:08:03 +01:00
Benjamin Berg
94f54c0638 main: Register the common name after initializing the manager
When creating the FprintManager object the devices will be enumerated.
This operation calls the mainloop recursively. We do not want to receive
any client requests before the initial enumeration has happened. Because
of this, move the registration of the common name to happen after the
enumeration has finished.
2019-12-03 17:08:03 +01:00
Benjamin Berg
9c8d062669 device: Handle full device storage including garbage collection
The new libfprint version has support for devices that store data on the
sensor. In that case, the on-sensor storage might fill up when the user
tries to enroll a new print.

The strategy introduced here to handle this is to try and delete prints
from the device that we do not know about (assuming, it is e.g. from an
old installation and unusable).

It can also happen that we are not able to garbage collect old prints.
If that happens, a new error code "enroll-data-full" will be returned
signalling the situation to the enrolling application.
2019-12-03 17:08:03 +01:00
Benjamin Berg
ca482036c7 storage: Add function to discover users that have prints
For sensors with internal storage we may want to garbage collect prints.
Adding this API means we can list all local prints, allowing us to find
out whether there are prints on the device's storage with no
corresponding print on the host.
2019-12-03 17:08:03 +01:00
Benjamin Berg
d7821aa790 Initial port to libfprint2 2019-12-03 17:08:03 +01:00
Benjamin Berg
16cb1a8ec6 device: Use g_clear_pointer in places
Replace some g_free calls with subsequent NULL setting with
g_clear_pointer.
2019-12-02 16:20:01 +01:00
Benjamin Berg
31ba9ebea4 ci: libfprint master is now version two
libfprint master contains version 2 of the library now. This means we
need to add dependencies and change some other things a bit.
2019-12-02 16:19:55 +01:00
Benjamin Berg
8893c2f906 ci: Build against libfprint-1-0
The libfprint master branch will soon contain the v2 API. So change to
use the libfprint-1-0 which will mean that the CI will continue to work.

Note that the build_stable target will need to be removed when the new
libfprint version reaches fedora rawhide.
2019-10-07 16:39:25 +02:00
worldofpeace
3520cb56d1 build: Move D-Bus conf file to $(datadir)/dbus-1/system.d
Since D-Bus 1.9.18 configuration files installed by third-party should
go in share/dbus-1/system.d. The old location is for sysadmin overrides.
2019-09-16 11:43:51 -04:00
Benjamin Berg
96444b4156 pam: Fix rhost string length check 2019-08-13 14:16:32 +02:00