From: Steve Holme Date: Sat, 18 May 2019 16:17:12 +0000 (+0100) Subject: http_ntlm_wb: Cleanup handshake after clean NTLM failure X-Git-Tag: curl-7_65_0~19 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2697d633630477de3b0d9ead2dea599f3b79af75;p=curl http_ntlm_wb: Cleanup handshake after clean NTLM failure Missed in 50b87c4e. --- diff --git a/lib/curl_ntlm_wb.c b/lib/curl_ntlm_wb.c index 2aa2289b2..fa0ad95fb 100644 --- a/lib/curl_ntlm_wb.c +++ b/lib/curl_ntlm_wb.c @@ -356,7 +356,13 @@ CURLcode Curl_input_ntlm_wb(struct connectdata *conn, *state = NTLMSTATE_TYPE2; /* We got a type-2 message */ } else { - if(*state >= NTLMSTATE_TYPE1) { + if(*state == NTLMSTATE_TYPE3) { + infof(conn->data, "NTLM handshake rejected\n"); + Curl_http_auth_cleanup_ntlm_wb(conn); + *state = NTLMSTATE_NONE; + return CURLE_REMOTE_ACCESS_DENIED; + } + else if(*state >= NTLMSTATE_TYPE1) { infof(conn->data, "NTLM handshake failure (internal error)\n"); return CURLE_REMOTE_ACCESS_DENIED; }