aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/http_aws_sigv4.c
diff options
context:
space:
mode:
authorshadchin <shadchin@yandex-team.ru>2022-04-13 20:13:40 +0300
committershadchin <shadchin@yandex-team.ru>2022-04-13 20:13:40 +0300
commitad92d4ea3ed939dee26114e765dc7e60eb99349e (patch)
treec9f920ed0d65fca79b89e5e1504808d7b265d49b /contrib/libs/curl/lib/http_aws_sigv4.c
parentf9c8ebd5329f4efcc759fde08d0540f55d9f7acc (diff)
downloadydb-ad92d4ea3ed939dee26114e765dc7e60eb99349e.tar.gz
CONTRIB-2513 Update contrib/libs/curl to 7.80.0
ref:9f073731f38021df100328c1b343280bf6632e23
Diffstat (limited to 'contrib/libs/curl/lib/http_aws_sigv4.c')
-rw-r--r--contrib/libs/curl/lib/http_aws_sigv4.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/libs/curl/lib/http_aws_sigv4.c b/contrib/libs/curl/lib/http_aws_sigv4.c
index 02663abd63..cbbecb7129 100644
--- a/contrib/libs/curl/lib/http_aws_sigv4.c
+++ b/contrib/libs/curl/lib/http_aws_sigv4.c
@@ -92,6 +92,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
char *signed_headers = NULL;
Curl_HttpReq httpreq;
const char *method;
+ size_t post_data_len;
const char *post_data = data->set.postfields ? data->set.postfields : "";
unsigned char sha_hash[32];
char sha_hex[65];
@@ -281,8 +282,12 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
goto fail;
}
+ if(data->set.postfieldsize < 0)
+ post_data_len = strlen(post_data);
+ else
+ post_data_len = (size_t)data->set.postfieldsize;
Curl_sha256it(sha_hash,
- (const unsigned char *) post_data, strlen(post_data));
+ (const unsigned char *) post_data, post_data_len);
sha256_to_hex(sha_hex, sha_hash, sizeof(sha_hex));
Curl_http_method(data, conn, &method, &httpreq);
@@ -321,7 +326,7 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
/*
* Google allow to use rsa key instead of HMAC, so this code might change
- * In the furure, but for now we support only HMAC version
+ * In the future, but for now we support only HMAC version
*/
str_to_sign = curl_maprintf("%s4-HMAC-SHA256\n" /* Algorithm */
"%s\n" /* RequestDateTime */