fix(pcd/webauthn-pcd): base64 encode expected challenge #2186
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.
Description
WebAuthnPCDPackage.verify
. A reproducible example of the bug is included below.consumer-client
app.Other changes
allowCredentials
configuration, wouldn't find my 1Password credential. I'm not sure if this is a bug, or just on my machine. Happy to revert this commit before merging, but I couldn't reproduce the bug without enabling this.Tested
Before bug fix
I added an example in the
consumer-client
app (as of commit 47398f3) to reproduce bug. You have to build and checkout theconsumer-client
at commit 47398f3 to reproduce the bug successfully.Steps to reproduce:
Run consumer client
Visit WebAuth example in consumer client:
http://localhost:3001/#/examples/add-pcd
Register new WebAuthn credential (I used 1Password to store it). Works as expected ✅
Sign PCD with WebAuthn. Works as expected ✅
Verify PCD with WebAuthn. Fails because the given challenge does not equal expect challenge ❌
The given challenge is simply base64 encoded, while the expected challenge is not:
After bug fix
Steps to reproduce:
Run consumer client
Visit WebAuth example in consumer client:
http://localhost:3001/#/examples/add-pcd
Register new WebAuthn credential (I used 1Password to store it). Works as expected ✅
Sign PCD with WebAuthn. Works as expected ✅
Verify PCD with WebAuthn. Fails because the given challenge does not equal expect challenge
Related issues
None. We discussed this in the Telegram group.
Backwards compatibility
Yes, fixes bug in existing WebAuthn PCD library.
Documentation
None beyond this PR.