diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index f47adf894..5fec16314 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -77,7 +77,7 @@ CURLntlm Curl_input_ntlm(struct connectdata *conn, header++; if(checkprefix("NTLM", header)) { - char buffer[256]; + unsigned char buffer[256]; header += strlen("NTLM"); while(*header && isspace((int)*header)) @@ -187,7 +187,7 @@ static void mkhash(char *password, unsigned char lmbuffer[21]; unsigned char ntbuffer[21]; - unsigned char lm_pw[14]; + unsigned char pw[256]; /* for maximum 128-letter passwords! */ int len = strlen(password); unsigned char magic[] = { 0x4B, 0x47, 0x53, 0x21, 0x40, 0x23, 0x24, 0x25 }; int i; @@ -196,47 +196,46 @@ static void mkhash(char *password, len = 14; for (i=0; ihttpcode) && data->set.httpntlm /* NTLM authentication is activated */) { - CURLntlm ntlm; - ntlm = Curl_input_ntlm(conn, - k->p+strlen("WWW-Authenticate:")); + CURLntlm ntlm = + Curl_input_ntlm(conn, k->p+strlen("WWW-Authenticate:")); - conn->newurl = strdup(data->change.url); /* clone string */ + if(CURLNTLM_BAD != ntlm) + conn->newurl = strdup(data->change.url); /* clone string */ + else + infof(data, "Authentication problem. Ignoring this.\n"); } #endif else if(checkprefix("WWW-Authenticate:", k->p) && @@ -758,7 +760,7 @@ CURLcode Curl_readwrite(struct connectdata *conn, CURLdigest dig = CURLDIGEST_BAD; if(data->state.digest.nonce) - infof(data, "Authentication problem. Ignoring this."); + infof(data, "Authentication problem. Ignoring this.\n"); else dig = Curl_input_digest(conn, k->p+strlen("WWW-Authenticate:"));