Repository navigation
Conversation
removeEnrollment deleted the template's persistent record before asking the sensor to delete the template. If the sensor call failed, the template stayed on the sensor untracked: it kept passing built-in UV, was no longer listed or removable, and survived reset. Delete the template from the sensor first and drop the record only after that succeeds, like reset() already does.
Collaborator
Contributor
Author
|
Makes sense, this one mostly goes away with the redesign in #844: check_fingerprint only matches enrolled templates there, so an untracked template can't pass built-in UV and the ordering in removeEnrollment stops mattering for the bypass. The only leftover I can see is that a failed delete_template leaves the template holding a sensor slot until init reconciles it on the next boot, which seems fine to me. Happy to close this in favour of #844 whenever you like. |
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_enrollmentdeletes the template's record from persistent storage before asking the sensor to delete the template. When the sensor call fails, removeEnrollment returns an error but the record is already gone, so the finger stays enrolled on the sensor without OpenSK tracking it.perform_built_in_uvidentifies against every sensor template, so that finger keeps passing built-in UV whenever another fingerprint is stored: it isn't listed by enumerateEnrollments, retrying removeEnrollment returnsCTAP2_ERR_INVALID_OPTION, and authenticatorReset doesn't remove it because reset only deletes the templates in persistent storage.On the FPC2534 board,
delete_templatefails withInvalidStatewhile another matcher operation is running, for example an enrollment started with enrollBegin and not finished or cancelled, or the identify that stays active after a built-in UV prompt times out (check_fingerprint_completedoesn't abort it). The template is now removed from the sensor first, and the record only after that succeeds, which is the orderreset()already uses. Unknown template IDs still returnCTAP2_ERR_INVALID_OPTIONwithout touching the sensor.The test sensor now refuses to delete during an enrollment, like the FPC2534 driver.
test_remove_enrollment_sensor_busytries to remove a template while an enrollment is running, cancels the enrollment, removes the template again and checks that built-in UV fails. Without this change the second removal returnsCTAP2_ERR_INVALID_OPTIONand the template keeps passing built-in UV.run_desktop_tests.sh; every step exceptcargo audit, which I don't have installed, and no dependencies changed)