From 2697d633630477de3b0d9ead2dea599f3b79af75 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Sat, 18 May 2019 17:17:12 +0100 Subject: http_ntlm_wb: Cleanup handshake after clean NTLM failure Missed in 50b87c4e. --- lib/curl_ntlm_wb.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- cgit v1.2.1