Repository navigation
fido: per-user passkey agent (aurora-passkeyd): keys under the user's key bag, native front-end on D-Bus - #25
Merged
Merged
Conversation
aurora-fidod can forward each CTAP2 request to the passkey agent of seat0's active user instead of answering from /var/lib/aurora-fido. The agent runs as the user, keeps that user's credential records and calls /dev/sep-key as the user. The two speak a small CBOR protocol on a SOCK_SEQPACKET socket in the user's runtime dir (request, keepalive 'user present', cancel, response); both sides check the peer's uid. With no active local user or no agent, getInfo still answers and everything else is refused. U2F is not forwarded in this mode. The agent's vault key needs a key under the user's own key bag (sep-key interface 4); until that kernel interface exists the agent refuses to start instead of keeping a host-readable key. Default stays vault = system. Tests: tests/test_agent.py (10, stub enclave: passkey register + username-less sign-in through the agent, user isolation, no active user, agent down, wrong peer uid both ways, cancel and disconnect reach the enclave wait, interface-4 refusal). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
aurora-passkeyd reads ~/.config/aurora-passkeys/sites.conf (site = policy, longest suffix on a label boundary wins) and the authenticator uses that policy's CREATE flags for the new key, so the enclave enforces it. A rule the kernel cannot make refuses the registration instead of making a weaker key; malformed lines are skipped with a warning. Tests: rule matching, the key made with the rule's flags and still signing, refusal without a weaker key when the kernel lacks the flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The methods a platform-authenticator portal calls (credentialsd's proposed Provider1): get_info, list_credentials (display metadata from the vault, no enclave operation), make_credential and get_assertion on the same ctap2.Authenticator, so both front-ends share one vault and every signature stays an enclave-checked touch. The provider checks that the rp id is the origin's host or a parent of it over https before anything reaches the enclave, and maps CTAP status to WebAuthn DOMException names. The D-Bus binding comes separately. Tests: tests/test_provider.py (7, stub enclave). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the user's bag, enclave-checked password backend: SEP_KEY_CREATE_USER (a .userPresence key, or with flags 0 a key with no list that works only while the bag is unlocked), SEP_KEY_SIGN_PASSWORD and SEP_KEY_UNSEAL_PASSWORD, version-2 handles (uid), BagLocked and PasswordRefused errors; our copy of the password in the request buffer is zeroed after the call. UserBagBackend gives a user's agent only .userPresence keys under that user's bag and refuses handles of other uids, so a site rule asking for a biometric-only key is refused there. agent: the vault key is 64 random bytes sealed to a no-list key under the user's bag (vault.key); it opens with no touch while the bag is unlocked and not at all while it is locked. The agent needs interface 4 and refuses to start otherwise. enclave/ctap2/provider: a request may carry the user's password (native front-end only; CTAP has no route while clientPIN stays off): the enclave checks it instead of a touch, one call, no retries, a wrong password is CTAP2_ERR_PIN_INVALID (provider reason 'wrong-password'), a locked bag is OPERATION_DENIED. The provider wipes the password bytearray after the call. Tests (stub with a user bag): user-presence key under the bag, plain vault key reopens across an agent restart, locked bag refuses everything and the vault key, password route (sign, wrong password counted, wiped buffer), biometric site rule refused, another uid's handle refused. make check: 61 + 18 + 7. Struct sizes and ioctl numbers checked against the interface-4 header (2128/2428/2648). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e user's bag, password route, device access) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…Passkeys1) dbus_provider.py binds provider.py with jeepney: GetInfo, ListCredentials, MakeCredential, GetAssertion, Cancel and the UserActionNeeded signal on org.aurora.Passkeys.Provider1 at /org/aurora/Passkeys1. options carry the origin and, optionally, password_fd (a memfd or pipe holding the login password, read once and wiped) for the enclave to check instead of a touch; errors are org.aurora.Passkeys.Error.<DOMException name>, a wrong password is ...WrongPassword. Callers: the session's own uid, and with [native] portal_names only the current owner of one of those names. Cancel works only from the connection that started the request. aurora-passkeyd starts it when jeepney and a session bus are there (--no-dbus to skip). Tests: tests/test_dbus_provider.py on a private bus (dbus-run-session; skipped without jeepney): introspection, info, touch register/list/sign-in, wrong origin, password by fd (wrong counted, right signs), cancel from the right connection only, portal-name gate. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The cached reply counts that user's passkeys (remainingDiscoverableCredentials); another user at the seat without a running agent gets the fixed description. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
VaultGate unseals the vault key from the user's bag at the start of each request (one enclave key exchange, no touch), across the CTAP socket and the native front-end, and closes the vault when the request ends. The key is in memory only during a request and only while the bag is unlocked: after logout or a bag lock the next request finds the vault closed (getInfo still answers; everything else is denied, the provider reports reason 'locked'). Test: the vault is closed after a request; with the bag locked getInfo works, getAssertion is denied and list_credentials is refused; after the unlock both work again. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RyanTheTide
marked this pull request as ready for review
November 11, 2026 13:37
This was referenced Nov 12, 2026
Closed
This was referenced Nov 20, 2026
Closed
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.
aurora-fidod can forward each CTAP2 request to a per-user agent,
aurora-passkeyd, that keeps the active seat0 user's credentials. The keys live under that user's own Secure Enclave key bag (/dev/sep-keyinterface 4). The default staysvault = system, so nothing changes unless this is set.Transport (fidod → agent)
remote.RemoteAuthenticatorhas the samehandle(data, ctx)interface asctap2.Authenticator, soctaphid.CtapHidis unchanged./run/user/<uid>/aurora-passkeys/ctap.sock(SOCK_SEQPACKET, CBOR messages;agentproto.py) and checks the peer uid on both ends. UPNEEDED keepalives and cancel are relayed.Keys (interface 4;
backend.py)SEP_KEY_CREATE_USER,SEP_KEY_SIGN_PASSWORD,SEP_KEY_UNSEAL_PASSWORD; version-2 handles carrying the uid;BagLocked/PasswordRefusederrors. Struct sizes and ioctl numbers were checked against the interface-4 header: 2128/2428/2648 bytes.UserBagBackendlets an agent make only.userPresencekeys under its own bag, and refuses other uids' handles.User verification
SEP_KEY_SIGN, or the login password checked by the enclave. The password route is on the native front-end only: one call, no retries, a wrong password isPIN_INVALID, and the buffer is wiped.Per-site policy
~/.config/aurora-passkeys/sites.confpicks the CREATE flags per site. A rule the kernel cannot make refuses the registration rather than making a weaker key.Native front-end
provider.py: get_info, list_credentials (no enclave operation), make_credential and get_assertion. It checks the rp id against the origin before anything reaches the enclave, and returns DOMException names.dbus_provider.pyexposes it on the session bus asorg.aurora.Passkeys1/org.aurora.Passkeys.Provider1. The password comes as a memfd (password_fd). Callers must be the same uid, and with[native] portal_namesset, only the current owner of one of those names. Cancel works only from the connection that started the request.Tests (stub enclave; Fedora 44 arm64):
make -C fido check= 61 + 19 (agent, incl. the user-bag tests and the per-request vault) + 7 (provider) + 11 (D-Bus, under dbus-run-session; skipped without jeepney).Vault per request: the vault key is unsealed at the start of each request and dropped at the end (
VaultGate). While the bag is locked, getInfo still answers and everything else is denied.Hardware (Neo,
/dev/sep-keyinterface 4 kernel, no finger, run as throwaway non-root uids, Enforcing, 0 AVC). Each row passed:.userPresencekey under the bag;wrong-password), and the enclave counts it (failed 0 → 1);The touch-path makeCredential was refused at once (0x27) rather than waiting, because Touch ID is not armed until the first password login after a boot. Nothing was signed.
🤖 Generated with Claude Code