summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/http_negotiate.c
diff options
context:
space:
mode:
Diffstat (limited to 'libs/libcurl/src/http_negotiate.c')
-rw-r--r--libs/libcurl/src/http_negotiate.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/libs/libcurl/src/http_negotiate.c b/libs/libcurl/src/http_negotiate.c
index 1207ffb14b..545e703f71 100644
--- a/libs/libcurl/src/http_negotiate.c
+++ b/libs/libcurl/src/http_negotiate.c
@@ -120,16 +120,29 @@ CURLcode Curl_input_negotiate(struct Curl_easy *data, struct connectdata *conn,
CURLcode Curl_output_negotiate(struct Curl_easy *data,
struct connectdata *conn, bool proxy)
{
- struct negotiatedata *neg_ctx = proxy ? &conn->proxyneg :
- &conn->negotiate;
- struct auth *authp = proxy ? &data->state.authproxy : &data->state.authhost;
- curlnegotiate *state = proxy ? &conn->proxy_negotiate_state :
- &conn->http_negotiate_state;
+ struct negotiatedata *neg_ctx;
+ struct auth *authp;
+ curlnegotiate *state;
char *base64 = NULL;
size_t len = 0;
char *userp;
CURLcode result;
+ if(proxy) {
+#ifndef CURL_DISABLE_PROXY
+ neg_ctx = &conn->proxyneg;
+ authp = &data->state.authproxy;
+ state = &conn->proxy_negotiate_state;
+#else
+ return CURLE_NOT_BUILT_IN;
+#endif
+ }
+ else {
+ neg_ctx = &conn->negotiate;
+ authp = &data->state.authhost;
+ state = &conn->http_negotiate_state;
+ }
+
authp->done = FALSE;
if(*state == GSS_AUTHRECV) {
@@ -171,8 +184,10 @@ CURLcode Curl_output_negotiate(struct Curl_easy *data,
base64);
if(proxy) {
+#ifndef CURL_DISABLE_PROXY
Curl_safefree(data->state.aptr.proxyuserpwd);
data->state.aptr.proxyuserpwd = userp;
+#endif
}
else {
Curl_safefree(data->state.aptr.userpwd);