mirror of
https://github.com/mirror/wget.git
synced 2025-03-25 01:00:13 +08:00
NTLM restart authentication (trivial change)
* src/http-ntlm.c (ntlm_input): Continue on NTLMSTATE_LAST, error on NTLMSTATE_TYPE3 The code comes from the cURL project. Thanks to Daniel Stenberg for donating the code. https://lists.gnu.org/archive/html/bug-wget/2018-12/msg00030.html
This commit is contained in:
parent
fc65b4521a
commit
5dceb6626b
@ -135,13 +135,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 */
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user