Skip to content

soc: apple: sep: sep-key interface 4 (keys under a user's key bag, password checked by the enclave); Touch ID lockout record after the first password - #1544

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
fidohw/pin-v4b
Nov 11, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
fidohw/pin-v4b

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor
  • SEP_KEY_CREATE_USER (variant-5 key store, INFO.features PASSWORD): a .userPresence key under uid's per-user key bag, or with flags 0 a key with no list that works only while the bag is unlocked. Version-2 handles name the uid.
  • SIGN / UNSEAL on a user-presence key wait for a Touch ID match under the user's bag (one KeyGrant per match, as for biometric keys); SEP_KEY_SIGN_PASSWORD / SEP_KEY_UNSEAL_PASSWORD hand the bag's password to the enclave instead (VERIFY_SECRET into a fresh OwnedContext; the enclave counts a wrong one).
  • Root or the bag's own user may make these calls.
  • User bags are designated at 0x01000000 + uid, so no uid shares the Linux identity bag's designation (1000).
  • FEATURE_PERSISTENT_ATTEMPTS is defined and not set: the enclave's wrong-password count does not survive a reboot.
  • Touch ID: LOAD_LOCKOUT is sent after the first password of the boot instead of during the Catacomb restore.

Neo, no finger (same changes on fleet61, before the rebase): interface 4 rows 11/11 (no-list key signs while unlocked, refused while locked, signs again after unlock; SIGN_PASSWORD right password signs, wrong password EACCES and counted, refused while locked); LOAD_LOCKOUT accepted (status 0) after the first password, refused with 0x8002 at every boot before; Enforcing, 0 failed. KUnit: handle v2, designation, password checks, ioctl sizes, INFO.

🤖 Generated with Claude Code

RyanTheTide and others added 3 commits November 11, 2026 23:07
…ssword

The enclave refuses LOAD_LOCKOUT (0x8002) at every boot because Linux
sends it during the Catacomb restore, before the user's first unlock and
the sensor's registration; macOS loads the record only after all three.
Note at restore time whether a record is stored and hand it back on the
first password authentication of the boot, before the re-arm clears any
count. A refusal is no longer reported as an empty record: the host
record keeps the failed-attempt count and the next SAVE_LOCKOUT replaces
the stored one.

Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ssword checked by the enclave

With the per-user key bag whose secret is the login password, the enclave
can check the user's own password, so macOS's .userPresence (Touch ID or
the password) works without a root-held passcode (variant-5 key store,
INFO feature PASSWORD):

- SEP_KEY_CREATE_USER makes a .userPresence key under uid's bag, or with
  flags 0 a key with no list that works only while the bag is unlocked
  (class 9). Version-2 handles name the uid.
- SIGN / UNSEAL on a user-presence key wait for a Touch ID match under the
  user's bag, through the same one-grant-per-match KeyGrant as biometric
  keys; a no-list key runs directly.
- SEP_KEY_SIGN_PASSWORD / SEP_KEY_UNSEAL_PASSWORD hand the bag's password
  to the enclave (VERIFY_SECRET into a fresh OwnedContext; the enclave
  counts a wrong one), run the one operation and drop the context. The
  kernel keeps no copy; the request copy is wiped when it drops.
- Root or the bag's own uid may make these calls (new euid shim).
- User bags are designated at USER_BAG_BASE + uid, so no uid shares the
  identity bag's designation (1000, Touch ID's catacomb user).

INFO feature PERSISTENT_ATTEMPTS is defined and not set: on the Neo the
enclave counts wrong passwords live (1, 2, 3) but a bag exported after
three failures imports after a reboot with none, and the enclave keeps no
xART record for user bags, so a PIN retry limit built on it would not be
root-proof.

Assisted-by: LLM
Co-Authored-By: Claude Opus 5.5 <[email protected]>
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