Skip to content

fido: per-user passkey agent (aurora-passkeyd): keys under the user's key bag, native front-end on D-Bus - #25

Merged
RyanTheTide merged 9 commits into
mainfrom
passkeys/agent
Nov 11, 2026
Merged

RyanTheTide merged 9 commits into
mainfrom
passkeys/agent

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

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-key interface 4). The default stays vault = system, so nothing changes unless this is set.

Transport (fidod → agent)

  • remote.RemoteAuthenticator has the same handle(data, ctx) interface as ctap2.Authenticator, so ctaphid.CtapHid is unchanged.
  • It connects to /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.
  • With no active user or no agent, getInfo answers from that user's last reply or a fixed one, and everything else gets OPERATION_DENIED. U2F is not forwarded.

Keys (interface 4; backend.py)

  • New calls: SEP_KEY_CREATE_USER, SEP_KEY_SIGN_PASSWORD, SEP_KEY_UNSEAL_PASSWORD; version-2 handles carrying the uid; BagLocked / PasswordRefused errors. Struct sizes and ioctl numbers were checked against the interface-4 header: 2128/2428/2648 bytes.
  • UserBagBackend lets an agent make only .userPresence keys under its own bag, and refuses other uids' handles.
  • The vault key is 64 bytes sealed to a no-list key under the bag. It opens with no touch while the bag is unlocked and not at all while it is locked.

User verification

  • Touch ID through 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 is PIN_INVALID, and the buffer is wiped.
  • CTAP has no password route while clientPIN stays off.

Per-site policy

  • ~/.config/aurora-passkeys/sites.conf picks 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.py exposes it on the session bus as org.aurora.Passkeys1 / org.aurora.Passkeys.Provider1. The password comes as a memfd (password_fd). Callers must be the same uid, and with [native] portal_names set, 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-key interface 4 kernel, no finger, run as throwaway non-root uids, Enforcing, 0 AVC). Each row passed:

  • vault key: a no-list key under the bag; it reopens with no touch;
  • passkey: a .userPresence key under the bag;
  • makeCredential and getAssertion with the password checked by the enclave verify;
  • a wrong password is refused (wrong-password), and the enclave counts it (failed 0 → 1);
  • listing works;
  • another uid gets EPERM on SIGN and on SIGN_PASSWORD;
  • a uid with no bag gets no vault key;
  • the agent serves as the user, and getInfo goes through it;
  • after a bag LOCK, the vault key and SIGN_PASSWORD are refused;
  • after an UNLOCK, a fresh agent signs again.

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

RyanTheTide and others added 8 commits November 11, 2026 21:00
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>
@RyanTheTide RyanTheTide changed the title fido: per-user passkey agent (aurora-passkeyd) behind vault = user fido: per-user passkey agent (aurora-passkeyd): keys under the user's key bag, native front-end on D-Bus Nov 11, 2026
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>
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