Skip to main content

Module protocol

Module protocol 

Source
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 over authenticatorData || SHA-256(clientDataJSON).

§Threat assumptions

  • All base64/BOR/JSON/CBOR inputs originate from the client and are hostile: parsers return Err instead of panicking on arbitrary bytes (fuzz-tested in tests/fuzz.rs).
  • challenge_bytes MUST come from a single-use, server-side source (see crate::ChallengeStore); this module only checks that the client echoed them inside clientDataJSON.
  • Attestation statements are verified for the none, packed, and fido-u2f formats (crate::attestation); unknown formats are rejected unless the caller opts out via AttestationPolicy::allow_unknown_formats. Trust conveyed by an attestation is bounded by the configured trust anchors — see crate::attestation::AttestationPolicy before relying on provenance.

Structs§

AuthenticationParams
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.