]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http_aws_sigv4: cannot be used for proxy
authorDaniel Stenberg <daniel@haxx.se>
Wed, 5 Mar 2025 09:55:56 +0000 (10:55 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 5 Mar 2025 10:50:06 +0000 (11:50 +0100)
Make sure it is never attempted.

Reported-by: Philippe Antoine
Closes #16569

lib/http.c
lib/http_aws_sigv4.c
lib/http_aws_sigv4.h

index 8a9fe6e887c4e76986308002cedd6fdff5c4eb92..466080cb797b6279b23a24d79454d0b2ca1251a1 100644 (file)
@@ -634,9 +634,10 @@ output_auth_headers(struct Curl_easy *data,
   (void)path;
 #endif
 #ifndef CURL_DISABLE_AWS
-  if(authstatus->picked == CURLAUTH_AWS_SIGV4) {
+  if((authstatus->picked == CURLAUTH_AWS_SIGV4) && !proxy) {
+    /* this method is never for proxy */
     auth = "AWS_SIGV4";
-    result = Curl_output_aws_sigv4(data, proxy);
+    result = Curl_output_aws_sigv4(data);
     if(result)
       return result;
   }
index 345ac0910ff8793b0c612ece336f8289844174b2..712a726af8f25953d8c2ac6dd9c7bde3c6fefe43 100644 (file)
@@ -569,7 +569,7 @@ static CURLcode canon_query(struct Curl_easy *data,
 }
 
 
-CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
+CURLcode Curl_output_aws_sigv4(struct Curl_easy *data)
 {
   CURLcode result = CURLE_OUT_OF_MEMORY;
   struct connectdata *conn = data->conn;
@@ -605,9 +605,6 @@ CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy)
   unsigned char sign1[CURL_SHA256_DIGEST_LENGTH] = {0};
   char *auth_headers = NULL;
 
-  DEBUGASSERT(!proxy);
-  (void)proxy;
-
   if(Curl_checkheaders(data, STRCONST("Authorization"))) {
     /* Authorization already present, Bailing out */
     return CURLE_OK;
index 57cc5706eba3d94336ecb2952193c94f0f17169e..8928f4f717c3c0b4b09dee0c343cc5d78007471c 100644 (file)
@@ -26,6 +26,6 @@
 #include "curl_setup.h"
 
 /* this is for creating aws_sigv4 header output */
-CURLcode Curl_output_aws_sigv4(struct Curl_easy *data, bool proxy);
+CURLcode Curl_output_aws_sigv4(struct Curl_easy *data);
 
 #endif /* HEADER_CURL_HTTP_AWS_SIGV4_H */