From a8228dce36530ac80c5250c88e098ed11c2a9472 Mon Sep 17 00:00:00 2001 From: Glenn Gore Date: Sun, 30 Aug 2026 10:24:41 +0200 Subject: [PATCH] fix(webauthn): offer RS256 for the PRF-wrapping credential MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- packages/extension/src/webauthn-prf-wrap.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/packages/extension/src/webauthn-prf-wrap.ts b/packages/extension/src/webauthn-prf-wrap.ts index 425dc6d..6ff4c1c 100644 --- a/packages/extension/src/webauthn-prf-wrap.ts +++ b/packages/extension/src/webauthn-prf-wrap.ts @@ -332,6 +332,22 @@ export class WebAuthnPrfSecretWrap implements SecretWrap { pubKeyCredParams: [ { type: "public-key", alg: -8 }, // EdDSA { type: "public-key", alg: -7 }, // ES256 + // RS256, last and least preferred. Nothing here ever verifies a + // signature from this credential — it exists only to carry the PRF + // extension, and the PRF output is independent of the key's + // algorithm — so admitting RSA costs nothing and widens the set of + // authenticators that can hold the wallet's wrapping secret. + // + // It also silences a Chromium console warning that offering neither + // ES256 *nor* RS256 risks registration failures on incompatible + // authenticators. The warning surfaces in chrome://extensions as an + // error against the extension, where it sits next to real faults + // and costs someone the time to rule out. Do NOT copy this 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. + { type: "public-key", alg: -257 }, // RS256 ], authenticatorSelection: { residentKey: "required",