Fix negotiate auth to proxies to track correct state

This commit is contained in:
David Woodhouse 2014-07-11 12:11:14 +01:00 committed by Daniel Stenberg
parent 6bc76194e8
commit 3de576efda

View File

@ -737,6 +737,10 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
*/ */
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
#ifdef USE_HTTP_NEGOTIATE
struct negotiatedata *negdata = proxy?
&data->state.proxyneg:&data->state.negotiate;
#endif
unsigned long *availp; unsigned long *availp;
struct auth *authp; struct auth *authp;
@ -775,8 +779,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
authp->avail |= CURLAUTH_GSSNEGOTIATE; authp->avail |= CURLAUTH_GSSNEGOTIATE;
if(authp->picked == CURLAUTH_GSSNEGOTIATE) { if(authp->picked == CURLAUTH_GSSNEGOTIATE) {
if(data->state.negotiate.state == GSS_AUTHSENT || if(negdata->state == GSS_AUTHSENT || negdata->state == GSS_AUTHNONE) {
data->state.negotiate.state == GSS_AUTHNONE) {
neg = Curl_input_negotiate(conn, proxy, auth); neg = Curl_input_negotiate(conn, proxy, auth);
if(neg == 0) { if(neg == 0) {
DEBUGASSERT(!data->req.newurl); DEBUGASSERT(!data->req.newurl);
@ -785,7 +788,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
return CURLE_OUT_OF_MEMORY; return CURLE_OUT_OF_MEMORY;
data->state.authproblem = FALSE; data->state.authproblem = FALSE;
/* we received GSS auth info and we dealt with it fine */ /* we received GSS auth info and we dealt with it fine */
data->state.negotiate.state = GSS_AUTHRECV; negdata->state = GSS_AUTHRECV;
} }
else else
data->state.authproblem = TRUE; data->state.authproblem = TRUE;