From a74ba8209768103051e1b76ff0eba2711950f8c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Wolski?= Date: Tue, 16 Aug 2016 14:44:34 +0200 Subject: [PATCH] NTLM restart authentication --- src/http-ntlm.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/http-ntlm.c b/src/http-ntlm.c index 56c40ae..4d94dfc 100644 --- a/src/http-ntlm.c +++ b/src/http-ntlm.c @@ -136,13 +136,24 @@ ntlm_input (struct ntlmdata *ntlm, const char *header) } else { - if (ntlm->state >= NTLMSTATE_TYPE1) + if (ntlm->state == NTLMSTATE_LAST) + { + DEBUGP (("NTLM auth restarted.\n")); + /* no return, continue */ + } + else if (ntlm->state == NTLMSTATE_TYPE3) + { + DEBUGP (("NTLM handshake rejected.\n")); + ntlm->state = NTLMSTATE_NONE; + return false; + } + else if (ntlm->state >= NTLMSTATE_TYPE1) { DEBUGP (("Unexpected empty NTLM message.\n")); return false; /* this is an error */ } - DEBUGP (("Empty NTLM message, starting transaction.\n")); + DEBUGP (("Empty NTLM message, (re)starting transaction.\n")); ntlm->state = NTLMSTATE_TYPE1; /* we should sent away a type-1 */ } -- 2.9.3.windows.1