fix(webauthn): offer RS256 for the PRF-wrapping credential - #142
Merged
Conversation
Chromium warns when `pubKeyCredParams` offers neither ES256 nor RS256, and surfaces the warning in chrome://extensions as an error against the extension — where it sits beside real faults and costs a reader the time to rule it out. One did exactly that while diagnosing an unrelated mediator problem. The credential enrolled here exists only to carry the PRF extension: the wallet consumes `prf.results.first` and never verifies a signature from it, and the PRF output does not depend on the key's algorithm. So admitting RSA costs nothing and widens the set of authenticators that can hold the wrapping secret. Deliberately not applied to `enrollPasskey` in core, whose key IS registered as a DID verification method: `importSpkiForAlg` accepts only ES256/EdDSA/ES384, so an RSA credential there would enroll and then fail to import. The comment says so at the point someone would copy it. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Adds RS256 (
alg: -257) topubKeyCredParamsfor the WebAuthn credential that carries the PRF extension, last in the preference list after EdDSA and ES256.Why
Chromium warns when
pubKeyCredParamsoffers neither ES256 nor RS256:It surfaces in
chrome://extensionsas an error against the extension, where it sits next to real faults. A user hit exactly that while diagnosing an unrelated mediator connectivity problem, and it cost time to rule out.The credential enrolled in
enrollOrLoadCredentialexists only to carry the PRF extension — the wallet consumesprf.results.firstand never verifies a signature from it, and the PRF output is independent of the key's algorithm. Admitting RSA therefore costs nothing and widens the set of authenticators that can hold the wallet's wrapping secret.What this deliberately does not touch
enrollPasskeyinpackages/core/src/webauthn/register.tskeeps ES256/EdDSA only. That key is registered as a DID verification method, andimportSpkiForAlgaccepts only ES256/EdDSA/ES384 — an RSA credential there would enroll successfully and then fail to import. The comment records this at the point someone would be tempted to copy the change across.Pre-merge checklist
npm run lintcleannpm run buildcleannpm test— all suites passdist/background.jssingle bundle, no dynamicimport(), nochrome.cookies, no staticcontent_scripts