Skip to content

Verify per-chunk signatures for STREAMING-AWS4-HMAC-SHA256-PAYLOAD#1027

Merged
gaul merged 1 commit intomasterfrom
per-chunk-signatures
Apr 18, 2026
Merged

Verify per-chunk signatures for STREAMING-AWS4-HMAC-SHA256-PAYLOAD#1027
gaul merged 1 commit intomasterfrom
per-chunk-signatures

Conversation

@gaul
Copy link
Copy Markdown
Owner

@gaul gaul commented Apr 18, 2026

Implement the chunk-signature chain from the SigV4 streaming spec: each chunk's signature is HMAC(signingKey, "AWS4-HMAC-SHA256-PAYLOAD\n \n\n\n<SHA256("")>\n<SHA256(chunk)>"), with prevSig seeded from the Authorization header signature and chained across chunks. Mismatches throw SignatureDoesNotMatch.

Extract deriveSigningKeyV4 from createAuthorizationSignatureV4 so the handler can reuse it when constructing the verifying ChunkedInputStream after authentication. Un-ignore testAwsV4SignatureChunkedSigned.

Fixes #205.

Implement the chunk-signature chain from the SigV4 streaming spec:
each chunk's signature is HMAC(signingKey, "AWS4-HMAC-SHA256-PAYLOAD\n
<ts>\n<scope>\n<prevSig>\n<SHA256("")>\n<SHA256(chunk)>"), with
prevSig seeded from the Authorization header signature and chained
across chunks. Mismatches throw SignatureDoesNotMatch.

Extract deriveSigningKeyV4 from createAuthorizationSignatureV4 so the
handler can reuse it when constructing the verifying ChunkedInputStream
after authentication. Un-ignore testAwsV4SignatureChunkedSigned.

Fixes #205.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gaul gaul merged commit c3e9bd5 into master Apr 18, 2026
9 checks passed
@gaul gaul deleted the per-chunk-signatures branch April 18, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

V4 signature payload signing

1 participant