Squid-2.2.STABLE2: Authentication header parsing Squid was rather strict about the syntax of authentication headers sent to Squid. This patch extends it to be somewhat forgiving about the syntax used in accordance with HTTP/1.1 guidelines. Index: squid/src/acl.c diff -u squid/src/acl.c:1.1.1.32 squid/src/acl.c:1.1.1.32.2.2 --- squid/src/acl.c:1.1.1.32 Wed Apr 21 14:50:23 1999 +++ squid/src/acl.c Thu Apr 29 14:35:35 1999 @@ -996,15 +996,18 @@ if (proxy_auth == NULL) return 0; - if (strlen(proxy_auth) < SKIP_BASIC_SZ) + debug(28, 6) ("aclDecodeProxyAuth: header = '%s'\n", proxy_auth); + if (strncasecmp(proxy_auth,"Basic ",6) != 0) { + debug(28, 2) ("aclDecodeProxyAuth: Invalid sheme, '%s'\n", proxy_auth); return 0; - proxy_auth += SKIP_BASIC_SZ; + } + proxy_auth += 6; sent_auth = xstrdup(proxy_auth); /* username and password */ /* Trim trailing \n before decoding */ strtok(sent_auth, "\n"); /* Trim leading whitespace before decoding */ - while (xisspace(*proxy_auth)) - proxy_auth++; + while (xisspace(*sent_auth)) + sent_auth++; cleartext = uudecode(sent_auth); xfree(sent_auth); debug(28, 6) ("aclDecodeProxyAuth: cleartext = '%s'\n", cleartext); Index: squid/src/defines.h diff -u squid/src/defines.h:1.1.1.23 squid/src/defines.h:1.1.1.23.6.1 --- squid/src/defines.h:1.1.1.23 Mon Apr 12 23:11:00 1999 +++ squid/src/defines.h Thu Apr 29 14:35:36 1999 @@ -208,8 +208,6 @@ #define STORE_SWAP_BUF DISK_PAGE_SIZE #define VM_WINDOW_SZ DISK_PAGE_SIZE -#define SKIP_BASIC_SZ ((size_t) 6) - #define PINGER_PAYLOAD_SZ 8192 #define COUNT_INTERVAL 60