http_ntlm_wb: Move the type-2 message processing into a dedicated function

This brings the code inline with the other HTTP authentication mechanisms.

Closes #3890
This commit is contained in:
Steve Holme 2019-05-15 16:10:56 +01:00
parent ab4616f8cb
commit fe20826b58
No known key found for this signature in database
GPG key ID: 4059CB85CA7E8F19
3 changed files with 35 additions and 15 deletions

View file

@ -919,19 +919,10 @@ CURLcode Curl_http_input_auth(struct connectdata *conn, bool proxy,
*availp |= CURLAUTH_NTLM_WB;
authp->avail |= CURLAUTH_NTLM_WB;
/* Get the challenge-message which will be passed to
* ntlm_auth for generating the type 3 message later */
while(*auth && ISSPACE(*auth))
auth++;
if(checkprefix("NTLM", auth)) {
auth += strlen("NTLM");
while(*auth && ISSPACE(*auth))
auth++;
if(*auth) {
conn->challenge_header = strdup(auth);
if(!conn->challenge_header)
return CURLE_OUT_OF_MEMORY;
}
result = Curl_input_ntlm_wb(conn, proxy, auth);
if(result) {
infof(data, "Authentication problem. Ignoring this.\n");
data->state.authproblem = TRUE;
}
}
#endif