From 2c0b106d76bce93835963650977146508a2434ad Mon Sep 17 00:00:00 2001 From: Vishal Katyal Date: Tue, 13 Oct 2026 14:26:36 -0400 Subject: [PATCH] docs(signing): cite the RFC 9421 section that defines ECDSA P-256 The ucp_signing.py module docstring attributes the fixed-width raw r||s rule for ECDSA P-256 to RFC 9421 Section 3.3.1. That section is RSASSA-PSS Using SHA-512. ECDSA using curve P-256 and SHA-256 is Section 3.3.4, and it is the section that defines the encoding the module implements: r and s "encoded as big-endian unsigned integers, zero-padded to 32 octets each", concatenated into a 64-octet array. The substance of the line was already right and the code matches it: _EC_CURVES maps P-256 to ("ES256", 32) and the verifier rebuilds a DSS signature from the two 32-byte halves. Only the section number was wrong. For completeness, the sibling P-384 rule is Section 3.3.5 and EdDSA over edwards25519 is Section 3.3.6; the line cites RFC 8032 for Ed25519, which is correct and unchanged. The same wrong section number appears in the UCP specification at signatures.md Signature Encoding, which is where this docstring took it from. That is a separate fix in the spec repo. Swept the repo for the class: this was the only Section 3.3.x citation in any .py, .ts, .js or .md file. The Node twin in rest/nodejs/src/utils/ signature.ts cites Section 2.2.3 for authority normalisation, which is correct, and no 3.3.x section. Gates: uv sync rc 0; uv run --directory rest/python/server pytest 279 passed, 12 subtests passed, rc 0. --- rest/python/server/ucp_signing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest/python/server/ucp_signing.py b/rest/python/server/ucp_signing.py index 1bbaef3..68740fb 100644 --- a/rest/python/server/ucp_signing.py +++ b/rest/python/server/ucp_signing.py @@ -20,7 +20,7 @@ * RFC 9421 signature base construction and the UCP covered-component set. * RFC 9530 `Content-Digest` over the raw body bytes (`sha-256`). * ECDSA P-256 (`ES256`) verification with fixed-width raw `r||s` signatures - (RFC 9421 Section 3.3.1) -- never ASN.1/DER -- and Ed25519 (RFC 8032). + (RFC 9421 Section 3.3.4) -- never ASN.1/DER -- and Ed25519 (RFC 8032). * Signer public-key discovery from the `UCP-Agent` profile's `signing_keys[]`. Only the encoding and canonicalization are implemented here; every