X-Git-Url: http://sjero.net/git/?p=wget;a=blobdiff_plain;f=src%2Fhttp-ntlm.c;h=39e738ca0f046f44e51492167ce41dc00007774e;hp=91ca02801b0db622d570aab84df21c34ca8fe910;hb=add6c24a19f7abb3e516c77e3b5279016408a406;hpb=e09eb765f4387097cc734392e9bc765bec296fe8 diff --git a/src/http-ntlm.c b/src/http-ntlm.c index 91ca0280..39e738ca 100644 --- a/src/http-ntlm.c +++ b/src/http-ntlm.c @@ -147,6 +147,8 @@ int ntlm_input (struct ntlmdata *ntlm, const char *header) int size; char *buffer = (char *) alloca (strlen (header)); + DEBUGP (("Received a type-2 NTLM message.\n")); + size = base64_decode (header, buffer); if (size < 0) return 0; /* malformed base64 from server */ @@ -162,8 +164,12 @@ int ntlm_input (struct ntlmdata *ntlm, const char *header) else { if (ntlm->state >= NTLMSTATE_TYPE1) - return 0; /* this is an error */ + { + DEBUGP (("Unexpected empty NTLM message.\n")); + return 0; /* this is an error */ + } + DEBUGP (("Empty NTLM message, starting transaction.\n")); ntlm->state = NTLMSTATE_TYPE1; /* we should sent away a type-1 */ } @@ -326,6 +332,8 @@ char *ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd, default: /* for the weird cases we (re)start here */ hostoff = 32; domoff = hostoff + hostlen; + + DEBUGP (("Creating a type-1 NTLM message.\n")); /* Create and send a type-1 message: @@ -412,6 +420,8 @@ char *ntlm_output (struct ntlmdata *ntlm, const char *user, const char *passwd, const char *usr; int userlen; + DEBUGP (("Creating a type-3 NTLM message.\n")); + usr = strchr(user, '\\'); if(!usr) usr = strchr(user, '/');