Repository navigation
Conversation
remove_enrollment forgot the template ID in persistent storage before asking the sensor to delete the template. If the sensor delete fails, for example because the FPC2534 refuses it while an enrollment started by enrollBegin is still in progress, the template stays on the sensor but is no longer listed. Built-in UV identifies against all sensor templates, so that finger keeps passing UV, can't be removed, and survives a reset. Delete the template from the sensor first and only then remove it from storage.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
remove_enrollmentinlibraries/opensk/src/ctap/fingerprint.rsremoves the template ID from persistent storage before it asks the sensor to delete the template. If the sensor delete fails, the template stays on the sensor but is no longer listed. One concrete way to hit this on the FPC2534 is to sendenrollBeginand thenremoveEnrollmentfor an existing template:delete_templatein wasefire'sfpc2534.rsreturnsInvalidStatewhile the enrollment is still in progress. Built-in UV identifies against every template on the sensor, so the "removed" finger keeps passing UV. It can't be removed through bioEnrollment anymore, and it survivesauthenticatorReset, which only deletes listed templates. This is the same outcome #840 fixed for failed enrollments.The fix checks that the template is listed, deletes it from the sensor first, and only then removes it from storage, which matches the order
reset()already uses. The test fingerprint fake now refuses deletes during an enrollment like the FPC2534 does.test_remove_enrollment_sensor_failurefails without the fix and passes with it.Tested with
cargo testinlibraries/opensk(--features=std,--features=std,fingerprint,--all-features), the clippy andcargo fmt --checksteps fromrun_desktop_tests.sh, andcargo check --target=thumbv7em-none-eabi --features=fingerprint. I did not run the fuzz or Python steps, and I did not test on hardware.run_desktop_tests.sh)