mirror of
https://github.com/moparisthebest/curl
synced 2025-01-10 21:48:10 -05:00
http_ntlm_wb: Return the correct error on receiving an empty auth message
Missed infe20826b
as it wasn't implemented in http.c inb4d6db83
. Closes #3894
This commit is contained in:
parent
697b1f911b
commit
bd21fc9d2f
@ -339,7 +339,7 @@ CURLcode Curl_input_ntlm_wb(struct connectdata *conn,
|
|||||||
bool proxy,
|
bool proxy,
|
||||||
const char *header)
|
const char *header)
|
||||||
{
|
{
|
||||||
(void) proxy;
|
curlntlm *state = proxy ? &conn->proxy_ntlm_state : &conn->http_ntlm_state;
|
||||||
|
|
||||||
if(!checkprefix("NTLM", header))
|
if(!checkprefix("NTLM", header))
|
||||||
return CURLE_BAD_CONTENT_ENCODING;
|
return CURLE_BAD_CONTENT_ENCODING;
|
||||||
@ -352,9 +352,17 @@ CURLcode Curl_input_ntlm_wb(struct connectdata *conn,
|
|||||||
conn->challenge_header = strdup(header);
|
conn->challenge_header = strdup(header);
|
||||||
if(!conn->challenge_header)
|
if(!conn->challenge_header)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
|
*state = NTLMSTATE_TYPE2; /* We got a type-2 message */
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(*state >= NTLMSTATE_TYPE1) {
|
||||||
|
infof(conn->data, "NTLM handshake failure (internal error)\n");
|
||||||
|
return CURLE_REMOTE_ACCESS_DENIED;
|
||||||
|
}
|
||||||
|
|
||||||
|
*state = NTLMSTATE_TYPE1; /* We should send away a type-1 */
|
||||||
}
|
}
|
||||||
else
|
|
||||||
return CURLE_BAD_CONTENT_ENCODING;
|
|
||||||
|
|
||||||
return CURLE_OK;
|
return CURLE_OK;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user