/*
- * $Id: rfc2617.c,v 1.8 2003/07/12 00:34:01 hno Exp $
+ * $Id: rfc2617.c,v 1.9 2003/11/07 17:23:03 hno Exp $
*
* DEBUG:
* AUTHOR: RFC 2617 & Robert Collins
unsigned char j;
for (i = 0; i < HASHHEXLEN; i++) {
+ unsigned char n;
j = Hex[i];
if (('0' <= j) && (j <= '9'))
- Bin[i / 2] |= ((j - '0') << ((i % 2 == 0) ? 4 : 0));
+ n = j - '0';
else
- Bin[i / 2] |= ((j - 'a' + 10) << ((i % 2 == 0) ? 4 : 0));
+ n = j - 'a' + 10;
+ if (i % 2 == 0)
+ Bin[i / 2] = n << 4;
+ else
+ Bin[i / 2] |= n;
}
Bin[HASHLEN] = '\0';
}
/*
- * $Id: auth_digest.cc,v 1.31 2003/08/10 11:00:48 robertc Exp $
+ * $Id: auth_digest.cc,v 1.32 2003/11/07 17:23:04 hno Exp $
*
* DEBUG: section 29 Authenticator
* AUTHOR: Robert Collins
debug(29, 9) ("\nResponse = '%s'\n"
"squid is = '%s'\n", digest_request->response, Response);
- if (strcasecmp(digest_request->response, Response)) {
+ if (strcasecmp(digest_request->response, Response) != 0) {
+ if (!digest_request->flags.helper_queried) {
+ /* Query the helper in case the password has changed */
+ digest_request->flags.helper_queried = 1;
+ digest_request->credentials_ok = Pending;
+ return;
+ }
+
if (digestConfig->PostWorkaround && request->method != METHOD_GET) {
/* Ugly workaround for certain very broken browsers using the
* wrong method to calculate the request-digest on POST request.
* username cache */
/* store user in hash's */
authenticateUserNameCacheAdd(auth_user);
+
/*
* Add the digest to the user so we can tell if a hacking
* or spoofing attack is taking place. We do this by assuming