Repository navigation
test(verification-workers): replay draft Ed25519 Signature-Agent vectors - #206
Conversation
Every existing /v0/api/verify test signs with this repo's own sign(), so a signature base that sign() and verify() build the same wrong way still passes. The deployed demo shows this today: it builds the base line for "signature-agent";key="sig1" from the whole field value instead of the member value, and rejects draft -01 clients (cloudflare#199). Replay the fixed E.2.1 (dictionary) and E.2.2 (legacy) vectors from draft-ietf-webbotauth-httpsig-protocol-01 through the worker. Both pass on main. Reintroducing whole-field extraction in http-message-sig makes the E.2.1 case fail while all 33 existing tests still pass. Also point the landing page at the IETF draft and say which Signature-Agent forms it accepts. Refs cloudflare#199
|
This pull request was not reviewed automatically because its author does not have write access to this repository. A maintainer with write access can start a review by commenting |
|
@thibmeu could you take a look when you have a moment, or start a One data point since I opened it: Cloudflare's production verifier at |
|
thanks for the change @frostyhand . there are a few PRs and publication to handle before the demo redeployment. that should arrive in the near future though |
Refs #199
I looked into why the demo rejects the dictionary form.
mainis fine: the library and the worker both verify the draft -01 E.2.1 and E.2.2 vectors. The deployed demo is older thanmain. Its landing page still citesdraft-meunier-web-bot-auth-architectureand it has no/signature-agent-cardroute, so it looks like a build from around 26 May (04979c4).I confirmed the cause against
/v0/api/verify. For"signature-agent";key="sig1"the deployed verifier builds the base line from the whole field value (sig1="https://..."), not the member value ("https://...") that RFC 9421 section 2.1.2 requires. A request signed over the whole field value comes backvalid, and the draft-shaped request comes backinvalid: invalid signature.So the fix for #199 is a redeploy, which I can't do. This PR adds the test that would have caught it:
/v0/api/verifycases that replay the fixed E.2.1 (dictionary) and E.2.2 (legacy) Ed25519 vectors from the draft. Every existing case signs with this repo's ownsign(), so ifsign()andverify()build the same wrong base, those cases still pass. I checked this: with whole-field extraction put back intohttp-message-sig, all 33 existing worker tests still pass and the new E.2.1 case fails.npm run lintandnpm testpass locally.