Key directory alg: the drafts name HTTP Signature Algorithms values, and verifierFromJWK accepts only JOSE values

Aperta
#168 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@konippi ci sta già lavorando.

Dal 19/11/2026.

  • #201 di @konippi — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust

Direzione di ricerca

Read packages/web-bot-auth/src/crypto.ts, especially jwkAlgorithm and publicJwk, then compare their behavior with the two draft sections and RFC 7517 section 4.4 cited in the issue. First resolve which registry the alg value is meant to use; done means the library and draft wording agree, and the Ed25519 and RSA-PSS examples in the issue reflect that decision.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Revised 2026-11-13: draft-ietf-webbotauth-httpsig-protocol-01 (29 October 2026) settles this in the library's favour. Its section 5.5.1 now reads: "A JWK alg member, when present, follows Section 4.4 of [JWK]. The alg signature parameter, when present, follows the HTTP Signature Algorithms section of [HTTP-MESSAGE-SIGNATURES-IANA]." So EdDSA and PS512 are the right JWK values, and web-bot-auth 0.2.0 needs no change. I'll close this unless you'd like it kept open.

Section 5.5.1 of draft-ietf-webbotauth-httpsig-protocol-00 says of the key directory: "The alg parameter is restricted to algorithms registered in the HTTP Signature Algorithms section of [HTTP-MESSAGE-SIGNATURES-IANA]." draft-meunier-http-message-signatures-directory-05 section 3 says the same. Read that way, an Ed25519 key's alg is ed25519, and an RSA-PSS key's is rsa-pss-sha512.

web-bot-auth 0.2.0 reads JOSE names instead. jwkAlgorithm in packages/web-bot-auth/src/crypto.ts (lines 21–30 at c9e5a233) accepts an Ed25519 key only with alg absent or EdDSA, and an RSA key only with PS512. publicJwk writes alg: "EdDSA". So a directory whose keys follow the draft's wording can't be imported, and a verifier built on the library skips those keys:

import { verifierFromJWK } from "web-bot-auth/crypto";

const x = "JrQLj5P_89iXES9-vFgrIy29clF9CC_oPPsw3c5D0bs"; // the drafts' Ed25519 test key
for (const alg of [undefined, "EdDSA", "ed25519", "Ed25519"]) {
  const jwk = { kty: "OKP", crv: "Ed25519", x, ...(alg ? { alg } : {}) };
  try { await verifierFromJWK(jwk); console.log(alg, "imported"); }
  catch (e) { console.log(alg, "throws:", e.message); }
}
undefined imported
EdDSA imported
ed25519 throws: Ed25519 JWK alg must be EdDSA when present
Ed25519 throws: Ed25519 JWK alg must be EdDSA when present

Every example directory in both drafts omits alg, so the examples work either way. Which reading is intended?

  • If alg takes JOSE values, as RFC 7517 section 4.4 defines the member, the drafts' sentence could say the key's algorithm must be one registered in the HTTP Signature Algorithms registry, rather than restricting the alg value.
  • If alg takes HTTP Signature Algorithms names, the library would accept ed25519 and rsa-pss-sha512.

Until one of those changes, the AdCP Web Bot Auth profile (adcontextprotocol/adcp#7894) tells publishers to omit alg on Ed25519 keys, so every verifier reads the key the same way.

Lingua principale
Rust
Stelle
182
Fork
49
Merge medio
1g 20m
PR unite (30g)
19

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudflare/web-bot-auth

Tutte le issue di cloudflare/web-bot-auth

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.