Repository navigation
soc: apple: sep: Touch ID retry limits, lock states and enrolment operation as on macOS - #1134
Merged
Merged
Conversation
… macOS does macOS has two Touch ID retry limits. LocalAuthentication ends a Touch ID prompt after three failed matches and offers the password, but the enclave stays unlocked and the next prompt offers Touch ID again. The enclave itself locks the user's biometry after five completed no-matches (lock state bit 0x40), and only a password clears that. Captured on macOS 26.6.2: an LA prompt with three misses kept lock state 0x228 throughout, while a lock screen with five misses moved it to 0x45. The driver had one limit, three failed matches in a row across prompts, and it locked Touch ID until a password. A person who missed three times in sudo could not use Touch ID at the next prompt, unlike on macOS. Apply both limits. The third miss in a prompt ends that prompt's match operation (MATCH_CANCEL), as LocalAuthentication does, without locking Touch ID. The fifth miss since the last match or password re-arm locks it on the host and records the lock, as before. macOS also keeps the match operation open across a touch that gave no usable frame (it cleans the image up and takes the next frame). The driver ended the prompt instead, cancelled the operation, closed the unlock evaluation and power-cycled the sensor, so the next touch paid for a full bring-up and a new evaluation. A retry straight from the capture (no finger in time, partial contact, a damaged frame) now keeps the prompt, its operation and the registered sensor. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
macOS starts every Touch ID enrolment with BEGIN_ENROL (0x03) and then, before the first capture, OPERATION_DEVICE_LIST (0x7d): the same request that opens a match operation, here for the enrolment. The driver sent only BEGIN_ENROL, so its enrolments ran without the device list macOS sets up for them. Captured on macOS 26.6.2 during a System Settings enrolment. Send it after BEGIN_ENROL and require a well-formed list with at least one device; otherwise cancel the enrolment before any capture. Require at least one device when a match operation opens too. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…ttempts across a restart The enclave announces a user's biometric lock state as a 16-bit word. macOS 26.6.2 names its bits: 0x02 password lockout, 0x04 biometry lockout, 0x08 unlock token, 0x10 before first unlock, 0x20 password validated, 0x40 identification lockout, 0x80 catacomb corrupted. The driver read only 0x40, so a password lockout, a biometry lockout without 0x40 or a state before the first password unlock still asked for a finger the enclave would refuse, and a damaged catacomb looked like a failed match. Treat 0x02, 0x04, 0x10 and 0x40 as a lockout that needs the password, in the verify gate and in the re-arm check; refuse a verify on 0x80 as an enclave failure, not a non-matching finger; and log every state with its bit names. Name the enclave's other notices: tag 0x02 is a user's new enrolled identity count, tag 0x04 says the device list changed. Neither needs an answer; they were logged as unhandled. On macOS a restart does not clear failed attempts: the enclave saves its count after every result and reloads it. The driver forgot its count at every restart (its LOAD_LOCKOUT is not accepted yet), so a restart reset the attempts. Keep the count in the host lockout record, next to the lock, and restore it at start-up. Records from older kernels read as zero failed attempts. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
…acombs At every start the driver hands the enclave its saved lockout record (LOAD_LOCKOUT, 0x71) after the catacombs, and every start the enclave refused it with 0x8002, so the enclave forgot its failed attempts. The enclave checks the record against the restored catacombs, and the record on disk was always older than them: the driver saves it right after a match result, then a template update saves the user and master catacombs, a newer generation. macOS treats 0x8002 from LOAD_LOCKOUT as a refused record, not as an empty one, and loads the record only after all catacombs, as here. Save the lockout record again whenever a catacomb transaction ends (the master is always saved last), so the record on disk matches the catacombs on disk. Say in the log that a 0x8002 is a refusal; the host record keeps the failed-attempt count in that case. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
When the enclave's image assessment (0x07) rejects an image, the driver reported every case as partial contact. The 238-byte assessment says more: macOS 26.6.2 reads a feedback word (bad image, damaged blocks, sensor noise, finger moved), a finger-problem class (wet finger) and a dirt-on-sensor byte, and turns them into its own messages (finger moved, clean the sensor). Decode those fields. A rejected verify or enrol image now reports the matching retry cause (SEP_BIO_GUIDANCE_TOO_FAST for a moved finger, SEP_BIO_GUIDANCE_CLEAN for dirt or a wet finger, LIFT_AND_MOVE for a bad image, CENTER otherwise) and logs the reason. The outcome is unchanged: another touch is asked for. Signed-off-by: Ryan Murray <[email protected]> Assisted-by: LLM
Contributor
Author
|
Gates at head 25ee9de:
The finger test is pending: TEST-touchid26 (3 misses end the prompt, the next prompt offers Touch ID again, 5 lock, password, match; partial touch keeps the prompt; enrolment with 0x7d). |
This was referenced Nov 7, 2026
RyanTheTide
marked this pull request as ready for review
November 8, 2026 03:24
Contributor
Author
|
Hardware finger test PASSED on the MacBook Neo, 2026-11-08 ~14:20, by Ryan on kernel 7.3.0-aurora-fleet22-tid27 (#1087 + #1134 + #1143), libfprint aurora10, aurora-touchid-rearm 1-2.
|
This was referenced Nov 8, 2026
RyanTheTide
changed the base branch from
fix/sep-touchid-lift-rearm
to
integration/aurora
November 8, 2026 04:36
Contributor
Author
|
Merged after the cross-Mac gate. The Touch ID path here has no SoC gating, and it now runs the same on every Touch ID Mac:
|
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.
Stacked on #1087 (base branch
fix/sep-touchid-lift-rearm). Retarget tointegration/auroraonce #1087 merges.Five commits that bring the Touch ID protocol closer to macOS 26.6.2. They come from our own macOS traces (unified log + dtrace of the J700, 11-04 and 11-07) and four clean-room research reports. No Apple binaries or bytes are in this tree.
Commits
Tests
drivers/soc/apple: 0 (see comment).apple_sep*: new testsprompt_limit_ends_the_operation_not_touch_id,unusable_touch_keeps_the_prompt, record round trip with the failure count,lock_state_bitsandassessment_reasons. The 4 knownapple_sep_host_storebase failures are unchanged (results in a comment).🤖 Generated with Claude Code