feat/better-signature-verification #256
Merged
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.
This PR adds support for Ed25519 signature verification. Unfortunately this represents a breaking change to SimpleWebAuthn as
verifyAuthenticationResponse()
needed to be markedasync
and returnPromise<VerifiedAuthenticationResponse>
instead of simplyVerifiedAuthenticationResponse
in order to work with the library I pulled in to assist with the Ed25519 signature verification. The silver lining is that now bothverifyRegistrationResponse()
andverifyAuthenticationResponse()
returnPromise<boolean>
and it's simpler to internalize "both return promises" than "registration is a promise, and authentication is just aboolean
...or was it the other way around?"I also managed to completely remove elliptic and node-rsa libraries for more of Node's
crypto
module.I ran the Example server with this code again FIDO Conformance v1.7.2 and was able to pass all tests, including most of the optional algorithm tests:
This includes the Ed25519 test mentioned in #252:
Refactoring existing use of
verifyAuthenticationResponse()
Update your existing calls to
verifyAuthenticationResponse()
to work with them like promises, whether with.then()
orawait
depending on your code structure:Before
after