]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix incorrect authentication headers on cache digest requests
authorAymeric Vincent <aymericvincent@free.fr>
Tue, 27 Oct 2015 22:48:24 +0000 (15:48 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Tue, 27 Oct 2015 22:48:24 +0000 (15:48 -0700)
  login=NEGOTIATE can have an additional parameter specified,
   like login=NEGOTIATE:xxx

One test added in rev.12714 does not take this case into account and it
will send a garbage "login:password" (== "NEGOTIATE:xxx") to its peer
when requesting a digest.

This is a workaround patch to remove the broken Authentication headers
entirely. Support for Negotiate to the peer on these digest requests is
still needed.

src/peer_digest.cc

index 2f4aec9bac23024cb08be8a7dab12480308b28e6..ec6ed449cd1a4cc5827cfabc8c59b262e4d794ef 100644 (file)
@@ -312,7 +312,7 @@ peerDigestRequest(PeerDigest * pd)
             p->login[0] != '*' &&
             strcmp(p->login, "PASS") != 0 &&
             strcmp(p->login, "PASSTHRU") != 0 &&
-            strcmp(p->login, "NEGOTIATE") != 0 &&
+            strncmp(p->login, "NEGOTIATE",9) != 0 &&
             strcmp(p->login, "PROXYPASS") != 0) {
         xstrncpy(req->login, p->login, MAX_LOGIN_SZ);
     }