]> granicus.if.org Git - curl/commitdiff
http_ntlm_wb: Cleanup handshake after clean NTLM failure
authorSteve Holme <steve_holme@hotmail.com>
Sat, 18 May 2019 16:17:12 +0000 (17:17 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 18 May 2019 18:01:10 +0000 (19:01 +0100)
Missed in 50b87c4e.

lib/curl_ntlm_wb.c

index 2aa2289b26e6f5f1e20f1a89c2871acf4a6faf94..fa0ad95fb8d40f5d1dd3daf8bc90689621e32f6a 100644 (file)
@@ -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;
     }