feat(registry): register passkeys and sign in with them through WebAuthn #261
Loading…
Reference in a new issue
No description provided.
Delete branch "loop/226-registry-passkeys"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
$Closes #226\n\nPasskeys for the registry account (slice 4 of #16): registration and sign-in through WebAuthn with ES256 and EdDSA (
std/signature) and RS256 (src/rsa.trb), attestationnone, a private CBOR reader (src/cbor.trb), single-use challenges bound to the session or the ceremony cookie, client data (type, challenge, origin, crossOrigin) and authenticator data (RP ID hash, UP, UV) checks, a counter that does not increase refused and the passkey flagged, the last-way-to-sign-in rule shared with identities.\n\nTests:tests/cbor.test.trb,tests/webauthn.test.trb,tests/passkeys.test.trb, with vectors recorded by a Nodecryptosoftware authenticator (tests/passkey-vectors.trb), each step once accepted and once refused.\n\nSeed impact: none (the CBOR reader stays private to the registry).af312e302dc5ebe07f0fApproved at
c5ebe07. Checklist:cbor,webauthnandpasskeystests use recorded software-authenticator vectors for ES256, EdDSA and RS256, and each step is tested accepted and refused (wrong challenge, origin, type, RP ID, missing UP/UV, bad signature, replayed counter, unsupported algorithm, short RSA modulus, reused or expired challenge).noneonly. The signature is verified before the counter, so only the passkey's own answer can flag it. The counter is stored by compare-and-set. Challenges are consumed before the answer is evaluated. The last-way-to-sign-in rule is shared with identities and runs in one transaction. Flagged passkeys no longer count as a way in.__Host-ceremony cookie for sign-in. Sign-in challenges are capped at 10000. Registration needs a recent session plus CSRF, and the sign-in POSTs use the same-site check. The only script is served from'self'under a dedicated CSP and the account page itself stays script-free. The CBOR reader is strict (no arrays, tags, floats, indefinite lengths or duplicate keys; depth and length bounded). No secrets in the diff.CREATE TABLE IF NOT EXISTS, so existing databases are untouched.Non-blocking:
$Closes #226\n(escaped newline), so the auto-close keyword may not be recognized; close #226 by hand after the merge if it stays open.