You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(protocol): single signature encoding policy and canonical der (#744)
The signature encoding was carried by the attestation policy while assertions were governed by an experimental process global, so one deviation had two controls with different reach. Where both applied the global won, and a Relying Party which selected DER while the global was set had a BER signature accepted anyway. SignaturePolicy is now a member of webauthn.Config in its own right, threaded through both ceremonies, and the global and its setter are removed. The encoding is one decision which applies wherever a signature is verified.
Verification of an ECDSA signature against a credential public key now requires the DER encoding to be canonical. The decoder discards data trailing the signature and elements trailing the two integers within it rather than reporting either, so a signature carrying an appended integer or arbitrary appended bytes verified against the same message as the signature it was built from. Re-encoding the decoded integers and requiring the result to equal the input rejects both, along with the non-minimal integers which previously depended on the global. A Relying Party which accepts the BER encoding normalizes the signature before it reaches this point, so the relaxation stays in one place rather than being repeated at each verifier.
The helpers no longer wrap the errors they return, which the format handlers already describe in the terms of the attestation they were verifying, so a signature which fails to decode is reported once rather than twice.
BREAKING CHANGE: ConfigProvider requires GetSignaturePolicy. AttestationObject.Verify, AttestationObject.VerifyAttestation, ParsedCredentialAssertionData.Verify, ParsedCredentialCreationData.Verify, Credential.Verify, Credential.VerifyAttestationType and the attestation format validation handler registered by RegisterAttestationFormat take a SignaturePolicy. AttestationPolicy no longer carries a Signature member and webauthncose.SetExperimentalInsecureAllowBERIntegers is removed.
0 commit comments