summaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorMatthias Gatto <matthias.gatto@outscale.com>2020-01-21 17:33:51 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-21 16:28:03 +0100
commiteb69797766a36e56c07c2fc4cfe064b60cdeebc0 (patch)
tree2eb7d245b02c8846685be37f93caaf718ad90899 /lib/http.c
parent08e8455dddc5e48e58a12ade3815c01ae3da3b64 (diff)
downloadcurl-eb69797766a36e56c07c2fc4cfe064b60cdeebc0.tar.gz
http: Make the call to v4 signature
This patch allow to call the v4 signature introduce in previous commit Signed-off-by: Matthias Gatto <matthias.gatto@outscale.com>
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index 23618b9d7..3f7f4ba21 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -64,6 +64,7 @@
#include "http_ntlm.h"
#include "curl_ntlm_wb.h"
#include "http_negotiate.h"
+#include "http_aws_sigv4.h"
#include "url.h"
#include "share.h"
#include "hostip.h"
@@ -398,6 +399,8 @@ static bool pickoneauth(struct auth *pick, unsigned long mask)
pick->picked = CURLAUTH_NTLM_WB;
else if(avail & CURLAUTH_BASIC)
pick->picked = CURLAUTH_BASIC;
+ else if(avail & CURLAUTH_AWS_SIGV4)
+ pick->picked = CURLAUTH_AWS_SIGV4;
else {
pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */
picked = FALSE;
@@ -664,7 +667,15 @@ output_auth_headers(struct connectdata *conn,
(void)request;
(void)path;
#endif
-
+#ifndef CURL_DISABLE_CRYPTO_AUTH
+ if(authstatus->picked == CURLAUTH_AWS_SIGV4) {
+ auth = "AWS_SIGV4";
+ result = Curl_output_aws_sigv4(conn, proxy);
+ if(result)
+ return result;
+ }
+ else
+#endif
#ifdef USE_SPNEGO
if(authstatus->picked == CURLAUTH_NEGOTIATE) {
auth = "Negotiate";