diff options
author | Brad King <brad.king@kitware.com> | 2017-02-07 16:38:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2017-02-07 16:38:00 (GMT) |
commit | 1df9d5f91944e0b5ba00815d55bb7dc545053b4c (patch) | |
tree | 7f3ac8bf78c485cd3254a16754657bd5d43bd561 /Utilities/cmcurl/lib/curl_sasl.c | |
parent | f4a3290ae7ae096f8b92f7adfba7088e6918bc0b (diff) | |
parent | 4cc2908fdaaf1ab8afe5c2ae5dbb3401859a9aab (diff) | |
download | CMake-1df9d5f91944e0b5ba00815d55bb7dc545053b4c.zip CMake-1df9d5f91944e0b5ba00815d55bb7dc545053b4c.tar.gz CMake-1df9d5f91944e0b5ba00815d55bb7dc545053b4c.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2016-12-22 (44b9b4d4)
Diffstat (limited to 'Utilities/cmcurl/lib/curl_sasl.c')
-rw-r--r-- | Utilities/cmcurl/lib/curl_sasl.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/Utilities/cmcurl/lib/curl_sasl.c b/Utilities/cmcurl/lib/curl_sasl.c index 6b86962..807f5de 100644 --- a/Utilities/cmcurl/lib/curl_sasl.c +++ b/Utilities/cmcurl/lib/curl_sasl.c @@ -262,10 +262,13 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, size_t len = 0; saslstate state1 = SASL_STOP; saslstate state2 = SASL_FINAL; + const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name : + conn->host.name; + const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port; #if defined(USE_KERBEROS5) - const char* service = data->set.str[STRING_SERVICE_NAME] ? - data->set.str[STRING_SERVICE_NAME] : - sasl->params->service; + const char *service = data->set.str[STRING_SERVICE_NAME] ? + data->set.str[STRING_SERVICE_NAME] : + sasl->params->service; #endif sasl->force_ir = force_ir; /* Latch for future use */ @@ -341,8 +344,8 @@ CURLcode Curl_sasl_start(struct SASL *sasl, struct connectdata *conn, if(force_ir || data->set.sasl_ir) result = Curl_auth_create_oauth_bearer_message(data, conn->user, - conn->host.name, - conn->port, + hostname, + port, conn->oauth_bearer, &resp, &len); } @@ -408,6 +411,9 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, struct Curl_easy *data = conn->data; saslstate newstate = SASL_FINAL; char *resp = NULL; + const char * const hostname = SSL_IS_PROXY() ? conn->http_proxy.host.name : + conn->host.name; + const long int port = SSL_IS_PROXY() ? conn->port : conn->remote_port; #if !defined(CURL_DISABLE_CRYPTO_AUTH) char *serverdata; char *chlg = NULL; @@ -542,8 +548,8 @@ CURLcode Curl_sasl_continue(struct SASL *sasl, struct connectdata *conn, /* Create the authorisation message */ if(sasl->authused == SASL_MECH_OAUTHBEARER) { result = Curl_auth_create_oauth_bearer_message(data, conn->user, - conn->host.name, - conn->port, + hostname, + port, conn->oauth_bearer, &resp, &len); |