summaryrefslogtreecommitdiffstats
path: root/Utilities/cmcurl/lib/curl_sasl.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-02-10 18:36:11 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2017-02-10 18:36:11 (GMT)
commitbb72fff2f09ef307b74de35ab00dfc08e6da83ee (patch)
treeb919209648ec35acaf9ce10c23471bc9cbd7d549 /Utilities/cmcurl/lib/curl_sasl.c
parentf236c9cff9dcb4d4534e5532a9792e648d48d921 (diff)
parentd4da4755cdab41679ae7c2fa6ef2984a2d6837ec (diff)
downloadCMake-bb72fff2f09ef307b74de35ab00dfc08e6da83ee.zip
CMake-bb72fff2f09ef307b74de35ab00dfc08e6da83ee.tar.gz
CMake-bb72fff2f09ef307b74de35ab00dfc08e6da83ee.tar.bz2
Merge topic 'update-curl'
d4da4755 Help: Add notes for topic 'update-curl' 14c77153 Tests: Fix `file://` URLs given to curl 73ae6700 curl: Fix passing _WINSOCKAPI_ macro to compiler 1df9d5f9 Merge branch 'upstream-curl' into update-curl 4cc2908f curl 2016-12-22 (44b9b4d4) f4a3290a curl: Update script to get curl 7.52.1
Diffstat (limited to 'Utilities/cmcurl/lib/curl_sasl.c')
-rw-r--r--Utilities/cmcurl/lib/curl_sasl.c20
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);