From: Joe Mason Date: Fri, 3 Aug 2012 16:37:52 +0000 (-0400) Subject: Cleanup handshake after clean NTLM failure X-Git-Tag: curl-7_28_0~142 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50b87c4e;p=thirdparty%2Fcurl.git Cleanup handshake after clean NTLM failure --- diff --git a/lib/curl_ntlm.c b/lib/curl_ntlm.c index c7d67a0de4..9c78372549 100644 --- a/lib/curl_ntlm.c +++ b/lib/curl_ntlm.c @@ -95,7 +95,13 @@ CURLcode Curl_input_ntlm(struct connectdata *conn, ntlm->state = NTLMSTATE_TYPE2; /* We got a type-2 message */ } else { - if(ntlm->state >= NTLMSTATE_TYPE1) { + if(ntlm->state == NTLMSTATE_TYPE3) { + infof(conn->data, "NTLM handshake rejected\n"); + Curl_http_ntlm_cleanup(conn); + ntlm->state = NTLMSTATE_NONE; + return CURLE_REMOTE_ACCESS_DENIED; + } + else if(ntlm->state >= NTLMSTATE_TYPE1) { infof(conn->data, "NTLM handshake failure (internal error)\n"); return CURLE_REMOTE_ACCESS_DENIED; }