Fix #59: PIN UV Auth Protocol One: Override pubkey alg to -25 #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
The CTAP specification calls out the
algvalue of the PIN protocol's public key must be set to-25. From 6.5.6. PIN/UV Auth Protocol One:This PR changes the key type from cose::P256PublicKey to cose::EcdhEsHkdf256Key. These are effectively the same, other than the algorithm identifier being changed to -25 (see source code).
At least one security key validates this strictly (Token2 PIN+R3), returning an unexpected Ctap(UnsupportedAlgorithm) error for PIN operations otherwise. See #59 (comment) for a more detailed analysis.
Cc @msirringhaus
Test with Token2 PIN+R3
Setting a PIN
WebAuthn Make Credential
Test with Yubikey
TBC - I'll test this tomorrow, to verify there are no regressions.