mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:43:31 +03:00
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>
This commit is contained in:
parent
08e8455ddd
commit
eb69797766
3 changed files with 27 additions and 1 deletions
|
|
@ -334,6 +334,7 @@ CURLWARNING(_curl_easy_getinfo_err_curl_off_t,
|
||||||
(option) == CURLOPT_URL || \
|
(option) == CURLOPT_URL || \
|
||||||
(option) == CURLOPT_USERAGENT || \
|
(option) == CURLOPT_USERAGENT || \
|
||||||
(option) == CURLOPT_USERNAME || \
|
(option) == CURLOPT_USERNAME || \
|
||||||
|
(option) == CURLOPT_AWS_SIGV4 || \
|
||||||
(option) == CURLOPT_USERPWD || \
|
(option) == CURLOPT_USERPWD || \
|
||||||
(option) == CURLOPT_XOAUTH2_BEARER || \
|
(option) == CURLOPT_XOAUTH2_BEARER || \
|
||||||
(option) == CURLOPT_SSL_EC_CURVES || \
|
(option) == CURLOPT_SSL_EC_CURVES || \
|
||||||
|
|
|
||||||
13
lib/http.c
13
lib/http.c
|
|
@ -64,6 +64,7 @@
|
||||||
#include "http_ntlm.h"
|
#include "http_ntlm.h"
|
||||||
#include "curl_ntlm_wb.h"
|
#include "curl_ntlm_wb.h"
|
||||||
#include "http_negotiate.h"
|
#include "http_negotiate.h"
|
||||||
|
#include "http_aws_sigv4.h"
|
||||||
#include "url.h"
|
#include "url.h"
|
||||||
#include "share.h"
|
#include "share.h"
|
||||||
#include "hostip.h"
|
#include "hostip.h"
|
||||||
|
|
@ -398,6 +399,8 @@ static bool pickoneauth(struct auth *pick, unsigned long mask)
|
||||||
pick->picked = CURLAUTH_NTLM_WB;
|
pick->picked = CURLAUTH_NTLM_WB;
|
||||||
else if(avail & CURLAUTH_BASIC)
|
else if(avail & CURLAUTH_BASIC)
|
||||||
pick->picked = CURLAUTH_BASIC;
|
pick->picked = CURLAUTH_BASIC;
|
||||||
|
else if(avail & CURLAUTH_AWS_SIGV4)
|
||||||
|
pick->picked = CURLAUTH_AWS_SIGV4;
|
||||||
else {
|
else {
|
||||||
pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */
|
pick->picked = CURLAUTH_PICKNONE; /* we select to use nothing */
|
||||||
picked = FALSE;
|
picked = FALSE;
|
||||||
|
|
@ -664,7 +667,15 @@ output_auth_headers(struct connectdata *conn,
|
||||||
(void)request;
|
(void)request;
|
||||||
(void)path;
|
(void)path;
|
||||||
#endif
|
#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
|
#ifdef USE_SPNEGO
|
||||||
if(authstatus->picked == CURLAUTH_NEGOTIATE) {
|
if(authstatus->picked == CURLAUTH_NEGOTIATE) {
|
||||||
auth = "Negotiate";
|
auth = "Negotiate";
|
||||||
|
|
|
||||||
14
lib/setopt.c
14
lib/setopt.c
|
|
@ -638,6 +638,20 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
|
||||||
data->set.method = HTTPREQ_POST_FORM;
|
data->set.method = HTTPREQ_POST_FORM;
|
||||||
data->set.opt_no_body = FALSE; /* this is implied */
|
data->set.opt_no_body = FALSE; /* this is implied */
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CURLOPT_AWS_SIGV4:
|
||||||
|
/*
|
||||||
|
* String that holds file type of the SSL certificate to use
|
||||||
|
*/
|
||||||
|
result = Curl_setstropt(&data->set.str[STRING_AWS_SIGV4],
|
||||||
|
va_arg(param, char *));
|
||||||
|
/*
|
||||||
|
* Basic been set by default it need to be unset here
|
||||||
|
*/
|
||||||
|
if(data->set.str[STRING_AWS_SIGV4])
|
||||||
|
data->set.httpauth = CURLAUTH_AWS_SIGV4;
|
||||||
|
break;
|
||||||
|
|
||||||
#endif /* CURL_DISABLE_HTTP */
|
#endif /* CURL_DISABLE_HTTP */
|
||||||
|
|
||||||
case CURLOPT_MIMEPOST:
|
case CURLOPT_MIMEPOST:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue