From: hno <> Date: Sat, 13 Jan 2007 23:08:19 +0000 (+0000) Subject: Bug #1828: squid.conf docutemtation error for proxy_auth digest X-Git-Tag: SQUID_3_0_PRE6~156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=63a24aeb368b759b99e1ae76de0d625fb42cd73c;p=thirdparty%2Fsquid.git Bug #1828: squid.conf docutemtation error for proxy_auth digest Change squid.conf.default notes to document that the digest hash needs to be in hex (not base64) and make Squid case insensitive on the hex format. --- diff --git a/lib/rfc2617.c b/lib/rfc2617.c index cf95ef9870..5c14e86a2b 100644 --- a/lib/rfc2617.c +++ b/lib/rfc2617.c @@ -13,7 +13,7 @@ /* - * $Id: rfc2617.c,v 1.9 2003/11/07 17:23:03 hno Exp $ + * $Id: rfc2617.c,v 1.10 2007/01/13 16:08:19 hno Exp $ * * DEBUG: * AUTHOR: RFC 2617 & Robert Collins @@ -83,14 +83,20 @@ CvtBin(const HASHHEX Hex, HASH Bin) j = Hex[i]; if (('0' <= j) && (j <= '9')) n = j - '0'; - else + else if (('a' <= j) && (j <= 'f')) n = j - 'a' + 10; + else if (('A' <= j) && (j <= 'F')) + n = j - 'A' + 10; + else + continue; if (i % 2 == 0) Bin[i / 2] = n << 4; else Bin[i / 2] |= n; } - Bin[HASHLEN] = '\0'; + for (; i <= HASHHEXLEN; i++) { + Bin[i] = '\0'; + } } diff --git a/src/cf.data.pre b/src/cf.data.pre index bf77705c45..03dd0c55e1 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1,6 +1,6 @@ # -# $Id: cf.data.pre,v 1.427 2006/11/04 15:44:58 hno Exp $ +# $Id: cf.data.pre,v 1.428 2007/01/13 16:08:19 hno Exp $ # # # SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -1813,7 +1813,7 @@ DOC_START "program" cmdline Specify the command for the external authenticator. Such a program reads a line containing "username":"realm" and - replies with the appropriate H(A1) value base64 encoded or + replies with the appropriate H(A1) value hex encoded or ERR if the user (or his H(A1) hash) does not exists. See rfc 2616 for the definition of H(A1). "ERR" responses may optionally be followed by a error description