[webauthn] Update COSEAlgorithmIdentifier uses and examples to prefer fully-specified alg IDs (#2276)

emlun has just created a new issue for https://github.com/w3c/webauthn:

== Update COSEAlgorithmIdentifier uses and examples to prefer fully-specified alg IDs ==
[draft-ietf-jose-fully-specified-algorithms](https://datatracker.ietf.org/doc/draft-ietf-jose-fully-specified-algorithms/) has received "IANA OK" and thus seems close to finalized. We should update the defaults, recommended algorithms and examples to use these new identifiers as the [COSE algorithm identifiers -7 (ES256) and -8 (EdDSA) are now deprecated](https://www.ietf.org/archive/id/draft-ietf-jose-fully-specified-algorithms-08.html#name-deprecated-polymorphic-cose) ("replacement functionality SHOULD be utilized in new deployments in preference to the deprecated identifier").


## Proposed Changes for WebAuthn L3

Update non-normative examples, and update recommendations for RP to prefer the new values. These are not yet implemented by clients and authenticators, but will gracefully fall back to the legacy values until implemented.

- [§1.3.1. Registration](https://w3c.github.io/webauthn/#sctn-sample-registration): change example from using -7 (ES256) to -9 (ESP256) and from -8 (EdDSA) to -50 (Ed25519)

- [`pubKeyCredParams`](https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams): update algoritms recommended to RPS:

  >[Relying Parties](https://w3c.github.io/webauthn/#relying-party) that wish to support a wide range of [authenticators](https://w3c.github.io/webauthn/#authenticator) SHOULD include at least the following [COSEAlgorithmIdentifier](https://w3c.github.io/webauthn/#typedefdef-cosealgorithmidentifier) values:
  >
  >- -8 (Ed25519)
  >- -7 (ES256)
  >- -257 (RS256)
  >
  >Additional signature algorithms can be included as needed.

- [§5.8.5. Cryptographic Algorithm Identifier (typedef `COSEAlgorithmIdentifier`)](https://w3c.github.io/webauthn/#sctn-alg-identifier): update examples:
  >A [COSEAlgorithmIdentifier](https://w3c.github.io/webauthn/#typedefdef-cosealgorithmidentifier)’s value is a number identifying a cryptographic algorithm. The algorithm identifiers SHOULD be values registered in the IANA COSE Algorithms registry [[IANA-COSE-ALGS-REG]](https://w3c.github.io/webauthn/#biblio-iana-cose-algs-reg), for instance, -7 for "ES256" and -257 for "RS256".

- [§6.5.1.1. Examples of credentialPublicKey Values Encoded in COSE_Key Format](https://w3c.github.io/webauthn/#sctn-encoded-credPubKey-examples): add example(s) using fully-specified ID(s)

- [§6.5.5. Signature Formats for Packed Attestation, FIDO U2F Attestation, and Assertion Signatures](https://w3c.github.io/webauthn/#sctn-signature-attestation-types): add -9 (ESP256) in addition to -7 (ES256)


## Proposed Changes for WebAuthn L4

Update requirements on clients to support the new values. Advise RPs that -9 (ESP256) could appear in `fido-u2f` attestation statements.

- [§5.1.3. Create a New Credential - PublicKeyCredential’s [[Create]](origin, options, sameOriginWithAncestors) Internal Method](https://w3c.github.io/webauthn/#sctn-createCredential): add -9 (ESP256) before -7 (ES256) in default `pubKeyCredParams`:
  >If pkOptions.[pubKeyCredParams](https://w3c.github.io/webauthn/#dom-publickeycredentialcreationoptions-pubkeycredparams)’s [size](https://infra.spec.whatwg.org/#list-size)
  >is zero
  >- [Append](https://infra.spec.whatwg.org/#list-append) the following pairs of [PublicKeyCredentialType](https://w3c.github.io/webauthn/#enumdef-publickeycredentialtype) and [COSEAlgorithmIdentifier](https://w3c.github.io/webauthn/#typedefdef-cosealgorithmidentifier) values to credTypesAndPubKeyAlgs:
  >    - [public-key](https://w3c.github.io/webauthn/#dom-publickeycredentialtype-public-key) and -7 ("ES256").
  >    - [public-key](https://w3c.github.io/webauthn/#dom-publickeycredentialtype-public-key) and -257 ("RS256").

- [§5.2.1.1. Easily accessing credential data](https://w3c.github.io/webauthn/#sctn-public-key-easy): add -9 (ESP256) and -50 (Ed25519) as required supported algorithms (not for WebAuthn L3, but should be included in L4):
  >User agents MUST be able to return a non-null value for [getPublicKey()](https://w3c.github.io/webauthn/#dom-authenticatorattestationresponse-getpublickey) when the [credential public key](https://w3c.github.io/webauthn/#credential-public-key) has a [COSEAlgorithmIdentifier](https://w3c.github.io/webauthn/#typedefdef-cosealgorithmidentifier) value of:
  >- -7 (ES256), where [kty](https://tools.ietf.org/html/rfc9052#name-cose-key-common-parameters) is 2 (with uncompressed points) and [crv](https://tools.ietf.org/html/rfc9053#name-double-coordinate-curves) is 1 (P-256).
  >- -257 (RS256).
  >- -8 (EdDSA), where [crv](https://tools.ietf.org/html/rfc9053#name-double-coordinate-curves) is 6 (Ed25519).

- [§8.6. FIDO U2F Attestation Statement Format](https://w3c.github.io/webauthn/#sctn-fido-u2f-attestation) signing procedure: add -9 as a possible alg value:

  >**Signing procedure**
  >If the [credential public key](https://w3c.github.io/webauthn/#credential-public-key) of the [attested credential](https://w3c.github.io/webauthn/#authdata-attestedcredentialdata) is not of algorithm -7 ("ES256"), stop and return an error.


Please view or discuss this issue at https://github.com/w3c/webauthn/issues/2276 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Thursday, 27 March 2025 13:58:55 UTC