Skip to main content

Module passkeys

Module passkeys 

Source
Expand description

Passkeys (kernel spec §3.2, plan 3c): WebAuthn with webauthn-rs.

  • The relying party is public_url (decision 1): its host is the RP id and its origin the one origin accepted, with no subdomain and no other port. A public_url whose host is an IP address has no RP id, so passkeys are unavailable there.
  • The user handle is derived from the owner’s id (decision 3), not stored: an authenticator keeps it, and it names no one.
  • Ceremonies live in memory (decision 5, kernel spec §3.2), keyed by a random id: each is taken once, whatever its finish then finds, and lives at most CEREMONY_TTL_SECS. A restart drops them all; the browser starts again.
  • Passkeys add to the password (decision 2): registering one needs a stepped-up session (decision 7), and removing one always leaves the password. Every query names the owner (kernel spec §1).

Structs§

Ceremonies
The live ceremonies (decision 5).
PasskeyRecord
One of the owner’s passkeys, as Settings lists them (kernel spec §3.2).

Enums§

Ceremony
A ceremony begun and not yet finished: what it is for, and the state webauthn-rs checks its finish against.
Refused
Why a finish was refused. Nothing changed.
Start
The outcome of starting a ceremony.

Constants§

CEREMONY_TTL_SECS
How long a ceremony may take from its start to its finish, and the timeout the browser is given (decision 5).
MAX_LABEL_CHARS
The longest label a passkey takes, in characters.
MAX_LOGIN_CEREMONIES
At most this many login ceremonies are live at once, and as many registrations and step-ups: two pools, so a flood of unauthenticated login starts never pushes out a signed-in session’s ceremony (decision 5; 3c review, O1).
MAX_SESSION_CEREMONIES

Functions§

counter_moves_on
Whether an authenticator’s signature counter sent may follow stored, the one last accepted (decision 6): it must move on, unless both are 0, as they stay for an authenticator with no counter (synced passkeys). One that does not may be a clone.
relying_party
The relying party for public_url: None when its host is an IP address (decision 1). Any other None is a parsed public_url that webauthn-rs refuses, unreachable as PublicUrl::parse stands; it is logged, so passkeys never stop working unexplained.
user_handle
The owner’s WebAuthn user handle: the first 16 bytes of the SHA-256 of their id. The same owner always gets the same handle.