Support devices with in-sensor storage
There are some devices that only have in-sensor storage and do not allow to download/upload the data from the chip. One such case is are the Synaptics Prometeus devices (see also https://gitlab.freedesktop.org/vincenth/libfprint/).
In the Synaptics case, the device supports a 20 byte identifier that can be chosen freely (and a 1 byte finger ID). The experimental driver (see branch from @vincenth) simply fills this with a 20 byte random string. @vincenth also has branches to add new API so that prints will be deleted from the device when deleted locally (https://gitlab.freedesktop.org/vincenth/libfprint/tree/add-delete-finger and https://gitlab.freedesktop.org/vincenth/fprintd/tree/add-delete-finger).
There are a few open questions though. The specific Synaptics chip can only store up to 15 prints. This can fill up quickly if the user e.g. has dual boot or re-installs the machine regularly. Due to this, it will be desirable to garbage collect prints at some point.
An easy scheme to achieve this without user interaction might be the following:
- Add an API to list prints that are stored in the device
Add an error code to
enrollto notify when the device cannot store further prints
- In libfprint, query the prints and select one to delete; if one is found delete it, otherwise error out
- Retry enroll which should then work
However, this scheme is really simple, and we end up deleting prints randomly that we do not know about. This could create collateral damage in e.g. dual-boot setups.
We could consider prefixing our prints or encoding some more data into the IDs so that we can be smarter about which print to delete.