MasterKale / SimpleWebAuthn

WebAuthn, Simplified. A collection of TypeScript-first libraries for simpler WebAuthn integration. Supports modern browsers, Node, Deno, and more.
https://simplewebauthn.dev
MIT License
1.63k stars 138 forks source link

fix/fido-mds-authr-pubkey-check #178

Closed MasterKale closed 2 years ago

MasterKale commented 2 years ago

This PR fixes FIDO MDS statement authenticationAlgorithms verification to confirm the algorithm used to generate the keypair. This should fix #174; I specifically tested "android-safetynet" direct attestation from an OG Pixel using metadata available from https://mds.fidoalliance.org/ and was able to successfully register the device:

Screenshot_20220209-230702

This new functionality was tested against a preview build of FIDO Conformance Tools that supports FIDO MDS3 and passed all good tests (the two failures are a known issue with TPM tests):

Screen Shot 2022-02-09 at 11 10 41 PM

Additionally, certificate chain issues are handled more gracefully so that multiple root certificates have a chance of being tested instead of the first bad one short-circuiting path validation before a good cert can be tested. In the case of a bad cert detected the error thrown will include the bad certificate.