Skip to content

Keeps a fingerprint template stored until the sensor deletes it - #846

Open
nishat-06 wants to merge 1 commit into
google:developfrom
nishat-06:fingerprint-remove-order
Open

nishat-06 wants to merge 1 commit into
google:developfrom
nishat-06:fingerprint-remove-order

Conversation

@nishat-06

Copy link
Copy Markdown

remove_enrollment in libraries/opensk/src/ctap/fingerprint.rs removes 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 send enrollBegin and then removeEnrollment for an existing template: delete_template in wasefire's fpc2534.rs returns InvalidState while 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 survives authenticatorReset, 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_failure fails without the fix and passes with it.

Tested with cargo test in libraries/opensk (--features=std, --features=std,fingerprint, --all-features), the clippy and cargo fmt --check steps from run_desktop_tests.sh, and cargo check --target=thumbv7em-none-eabi --features=fingerprint. I did not run the fuzz or Python steps, and I did not test on hardware.

  • Local tests pass (running run_desktop_tests.sh)
  • Tested against boards
    • Nordic nRF52840 DK
    • Nordic nRF52840 Dongle
    • Makerdiary nRF52840 MDK USB Dongle
  • Appropriate changes to README are included in PR

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant