From: serassio <> Date: Tue, 29 Aug 2006 21:46:36 +0000 (+0000) Subject: Bug #1744: squid-2.6.STABLE3 - fakeauth_auth.core X-Git-Tag: SQUID_3_0_PRE5~164 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b62c607aa7e64122b8168fd461a101686c99c368;p=thirdparty%2Fsquid.git Bug #1744: squid-2.6.STABLE3 - fakeauth_auth.core The base64 decode of the NTLM blob is done only when -d option is specified: the error introduced in the recent core restructure of fake_aut. Now fixed. Also ran indent. --- diff --git a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c index 0a9da329c6..d0d9818275 100644 --- a/helpers/ntlm_auth/fakeauth/fakeauth_auth.c +++ b/helpers/ntlm_auth/fakeauth/fakeauth_auth.c @@ -16,7 +16,7 @@ * - Added negotiation of UNICODE char support * - More detailed debugging info * -*/ + */ #include "config.h" #include "ntlmauth.h" @@ -88,7 +88,7 @@ hex_dump(void *data, int size) if (n % 16 == 1) { /* store address for this line */ snprintf(addrstr, sizeof(addrstr), "%.4x", - (int)(p - (unsigned char *) data)); + (int) (p - (unsigned char *) data)); } c = *p; if (isalnum(c) == 0) { @@ -278,7 +278,7 @@ ntlmDecodeAuth(struct ntlm_authenticate *auth, char *buf, size_t size) fprintf(stderr, "ntlmDecodeAuth: header check fails\n"); return -1; } - debug("ntlmDecodeAuth: size of %d\n", (int)size); + debug("ntlmDecodeAuth: size of %d\n", (int) size); debug("ntlmDecodeAuth: flg %08x\n", auth->flags); debug("ntlmDecodeAuth: usr o(%d) l(%d)\n", auth->user.offset, auth->user.len); @@ -389,8 +389,9 @@ main(int argc, char *argv[]) if ((p = strchr(buf, '\n')) != NULL) *p = '\0'; /* strip \n */ - if ((strlen(buf) > 3) && NTLM_packet_debug_enabled) { + if (strlen(buf) > 3) decoded = base64_decode(buf + 3); + if ((strlen(buf) > 3) && NTLM_packet_debug_enabled) { strncpy(helper_command, buf, 2); helper_command[2] = '\0'; debug("Got '%s' from Squid with data:\n", helper_command);