Skip to content

docs(signatures): make example signature values raw r||s as the spec requires#590

Open
vishkaty wants to merge 2 commits into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/raw-rs-example-signatures
Open

docs(signatures): make example signature values raw r||s as the spec requires#590
vishkaty wants to merge 2 commits into
Universal-Commerce-Protocol:mainfrom
vishkaty:fix/raw-rs-example-signatures

Conversation

@vishkaty

Copy link
Copy Markdown
Contributor

Fixes #569: signatures.md mandates fixed-width raw r||s encoding for ECDSA signature values, but the worked examples show values beginning MEUC…/MEQC… — the base64 of a DER SEQUENCE, the exact encoding the normative text forbids (§ Signature value encoding). An implementer copying the examples' shape produces signatures a conformant verifier rejects.

What changed

Replaces the seven example signature values across signatures.md (4), checkout-mcp.md (1), checkout-rest.md (1), and order-rest.md (1) with a genuine ES256 raw r||s value (a real P-256 signature: 64 bytes → 88 base64 chars, decodes to no ASN.1 structure), preserving each instance's truncation style ().

The eighth instance, in order.md, is deliberately not touched here — #568 edits the same example block (adding ucp-agent to its covered components), and overlapping diffs would conflict; it can pick up the value fix on whichever lands second.

Example values only; no normative text changes.

…requires

signatures.md mandates fixed-width raw r||s encoding for ECDSA signature
values ("MUST use fixed-width raw r||s encoding"), but the worked examples
showed values beginning ME[UQ]C... — the base64 of a DER SEQUENCE, the exact
encoding the normative text forbids. An implementer copying the examples'
shape produces signatures a conformant verifier rejects.

Replaces the seven example values in signatures.md, checkout-mcp.md,
checkout-rest.md, and order-rest.md with a genuine ES256 raw r||s value
(64 bytes, 88 base64 chars), preserving each instance's truncation style.
The instance in order.md is deliberately left to avoid overlapping Universal-Commerce-Protocol#568,
which edits the same example block.

Fixes Universal-Commerce-Protocol#569.
@damaz91 damaz91 added status:needs-triage Signal that the PR is ready for human triage documentation Improvements or additions to documentation status:under-review and removed status:needs-triage Signal that the PR is ready for human triage labels Jul 16, 2026
@damaz91

damaz91 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

@damaz91
damaz91 self-requested a review July 16, 2026 09:13
…alues

Extends the sweep per review: the response-signing examples used a second
DER shape (MFQCIH..., a 0x30-led SEQUENCE) that the first pass's pattern
missed — now swept by decoding every example signature value's leading byte
rather than pattern-matching. Fixes checkout-mcp.md, checkout-rest.md, and
signatures.md's response-signing example, and aligns the stale
keyid="merchant-2025" with the merchant-2026 used by every sibling example.
order.md's instance remains deferred to avoid overlapping Universal-Commerce-Protocol#568.
@vishkaty

Copy link
Copy Markdown
Contributor Author

Good catch — thank you! Both fixed, plus one more the first pass missed: those response-signing examples use a second DER shape (MFQCIH…), so I re-swept by decoding every example signature value's leading byte (DER always starts 0x30) instead of pattern-matching, and fixed signatures.md's response-signing example too. Also aligned the stale keyid="merchant-2025" in checkout-rest.md with the merchant-2026 its sibling examples use.

The only DER-shaped value now remaining anywhere in docs/ is order.md's — left deliberately since #568 edits that same example block; it can pick up the value fix on whichever lands second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation status:under-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

signatures.md: example Signature values are ASN.1/DER, but the spec requires raw r||s encoding

2 participants