]> git.ipfire.org Git - thirdparty/curl.git/commit
aws_sigv4: consult x-%s-content-sha256 for payload hash
authorCasey Bodley <cbodley@redhat.com>
Tue, 25 Oct 2022 22:46:58 +0000 (18:46 -0400)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 25 Nov 2022 08:24:07 +0000 (09:24 +0100)
commit7f8e6da6dc0befc94a2adc3be3aac7d3a308c060
treef89599a9c4261453a3ad5ba5db19ef559f9be4e3
parent4c61a8e8f4f3d4c755a953c0d0c564c82905168f
aws_sigv4: consult x-%s-content-sha256 for payload hash

`Curl_output_aws_sigv4()` doesn't always have the whole payload in
memory to generate a real payload hash. this commit allows the user to
pass in a header like `x-amz-content-sha256` to provide their desired
payload hash

some services like s3 require this header, and may support other values
like s3's `UNSIGNED-PAYLOAD` and `STREAMING-AWS4-HMAC-SHA256-PAYLOAD`
with special semantics. servers use this header's value as the payload
hash during signature validation, so it must match what the client uses
to generate the signature

CURLOPT_AWS_SIGV4.3 now describes the content-sha256 interaction

Signed-off-by: Casey Bodley <cbodley@redhat.com>
Closes #9804
docs/libcurl/opts/CURLOPT_AWS_SIGV4.3
lib/http_aws_sigv4.c