Skip to content

device: Return an error if trying to verify / identify using non-device stored prints (and cache them)

Marco Trevisan requested to merge 3v1n0/libfprint:verify-data-checks into master

In case we are verifying using a print template that is not stored anymore into the device storage we may want to delete the print reference locally, however not all the drivers may support this natively.

Said this, if a device has storage and does not support checking for templates data presence on storage during such stage we may want to do it once the verify / identify operation finished with a match failure (not to waste time before and assuming that we'd already notified using early reporting).

So in such case, go through the list of device saved prints and if that is not containing the required data, return an error instead of just simple match failure.

As per this, we may end up requesting a device to list its storage contents multiple times when the device is active for verification.

Given that during the time we keep a device opened we can be sure that nothing else will change its storage, we can keep a prints cache around and change or delete it only when doing destructive operations (such as enroll, delete and closing the device).

Added tests to check the various cases.


Ideally I wanted to move this only in fprintd, but then I noticed that we could optimize the cases if we make libfprint to collaborate, so that a driver can avoid this to happen setting the proper flag, and we can avoid doing multiple calls to list when a failure happen or during a verification cycle.

Edited by Marco Trevisan

Merge request reports