pub fn verify_authentication(
params: &AuthenticationParams,
) -> Result<AuthenticationResult, WebauthnError>Expand description
Verify an authentication response with full CTAP2/COSE signature verification.
Verification steps, in order:
- Credential ID membership in
allowed_credential_ids. clientDataJSONvalidation (challenge echo,type == "webauthn.get", origin allow-list, optionalrpIdcross-check).- Authenticator data parsing and
rpIdHashcomparison. - User Presence flag.
- Sign-count freshness (
check_sign_count). ringsignature verification overauthenticatorData || SHA-256(clientDataJSON).
§Security notes / threat assumptions
challenge_bytesmust be consumed from single-use storage before this call; this module does not (and cannot) detect a challenge used twice.- On success the caller MUST persist
AuthenticationResult::new_sign_count(ideally compare-and-swap) before considering the user logged in. - The UV flag is reported, not required; enforce your own policy on
AuthenticationResult::user_verified.
§Requirements
REQ-WA-002, REQ-WA-101, REQ-WA-102, REQ-WA-103, REQ-WA-104, REQ-WA-105, REQ-WA-106, REQ-WA-111, REQ-WA-114, REQ-WA-116
Returns the verified authentication data.