Expand description
CTAP2 protocol parsing and ceremony verification.
Implements the two server-side WebAuthn ceremonies per the W3C
WebAuthn Level 2/3 model and CTAP2 authenticator data layout:
verify_registration: parse and validate an attestation object, extract the new credential (ID + COSE public key) and flags.verify_authentication: validate an assertion (challenge, origin, RP ID hash, user presence, sign-count freshness) and verify the signature overauthenticatorData || SHA-256(clientDataJSON).
§Threat assumptions
- All base64/BOR/JSON/CBOR inputs originate from the client and are
hostile: parsers return
Errinstead of panicking on arbitrary bytes (fuzz-tested intests/fuzz.rs). challenge_bytesMUST come from a single-use, server-side source (seecrate::ChallengeStore); this module only checks that the client echoed them insideclientDataJSON.- Attestation statements are verified for the
none,packed, andfido-u2fformats (crate::attestation); unknown formats are rejected unless the caller opts out viaAttestationPolicy::allow_unknown_formats. Trust conveyed by an attestation is bounded by the configured trust anchors — seecrate::attestation::AttestationPolicybefore relying on provenance.
Structs§
- Authentication
Params - Parameters for verifying an authentication response.
Functions§
- verify_
authentication - Verify an authentication response with full CTAP2/COSE signature verification.
- verify_
registration - Verify a registration response with full CTAP2/COSE verification and attestation statement verification.