RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1330186 - digest doesn't properly work with squid 3.3 on CentOS 7
Summary: digest doesn't properly work with squid 3.3 on CentOS 7
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: squid
Version: 7.2
Hardware: All
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Luboš Uhliarik
QA Contact: Martin Frodl
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-25 14:47 UTC by Fabrice Prigent
Modified: 2016-11-03 21:17 UTC (History)
3 users (show)

Fixed In Version: squid-3.5.10-3.el7
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-11-03 21:17:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CentOS 10763 0 None None None 2016-04-25 14:47:30 UTC
Red Hat Product Errata RHSA-2016:2600 0 normal SHIPPED_LIVE Moderate: squid security, bug fix, and enhancement update 2016-11-03 12:12:25 UTC

Description Fabrice Prigent 2016-04-25 14:47:31 UTC
Description of problem:
digest doesn't properly work with squid 3.3 on CentOS 7.. All authentication are "forgotten" as soon as they have been done.. It's a known bug of 3.3. (corrected in 3.4).

Version-Release number of selected component (if applicable):
3.3.8

How reproducible:


Steps to Reproduce:
1. Configure digest authentication.
2.
3.

Actual results:
reauthentication for each component of a page

Expected results:
no reauthentication for at least 10 minutes (configurable by parameters).

Additional info:

Comment 1 Fabrice Prigent 2016-04-25 14:48:40 UTC
The bug can be corrected with these steps :

get this patch ftp://ftp.tuwien.ac.at/.vhost/www.squid-cache.org/Versions/v3/3.4/changesets/squid-3.4-13098.patch [^] in
/root/rpmbuild/SOURCES

modify it with

--- src/auth/digest/UserRequest.cc 2013-11-29 10:55:53 +0000
+++ src/auth/digest/UserRequest.cc 2014-03-05 02:48:25 +0000
@@ -153,7 +153,7 @@
         /* check for stale nonce */
         if (!authDigestNonceIsValid(digest_request->nonce, digest_request->nc)) {
             debugs(29, 3, HERE << "user '" << auth_user->username() << "' validated OK but nonce stale");
- auth_user->credentials(Auth::Failed);
+ auth_user->credentials(Auth::Handshake);
             digest_request->setDenyMessage("Stale nonce");
             return;
         }

AND

@ -214,8 +215,14 @@
 
     if ((static_cast<Auth::Digest::Config*>(Auth::Config::Find("digest"))->authenticateProgram) && authDigestNonceLastRequest(nonce)) {
         flags.authinfo_sent = 1;
- debugs(29, 9, HERE << "Sending type:" << type << " header: 'nextnonce=\"" << authenticateDigestNonceNonceb64(nonce) << "\"");
- httpHeaderPutStrf(&rep->header, type, "nextnonce=\"%s\"", authenticateDigestNonceNonceb64(nonce));
+ Auth::Digest::User *digest_user = dynamic_cast<Auth::Digest::User *>(user().getRaw());
+ digest_nonce_h *nextnonce = digest_user->currentNonce();
+ if (!nextnonce || authDigestNonceLastRequest(nonce)) {
+ nextnonce = authenticateDigestNonceNew();
+ authDigestUserLinkNonce(digest_user, nextnonce);
+ }
+ debugs(29, 9, "Sending type:" << type << " header: 'nextnonce=\"" << authenticateDigestNonceNonceb64(nextnonce) << "\"");
+ httpHeaderPutStrf(&rep->header, type, "nextnonce=\"%s\"", authenticateDigestNonceNonceb64(nextnonce));
     }
 }


THEN change the squid.spec in /root/rpmbuild/SPECS

7 Release: 28%{?dist}
...
55 Patch217: squid-3.4-13098.patch
...
134 %patch217 -p0


then it works....

Comment 6 Martin Frodl 2016-08-16 09:47:50 UTC
Fabrice, could you provide me with a more specific reproducer? I was unable to recreate the problem by just 'configuring digest authentication' in the affected Squid version.

This is what I tried:

# rpm -q squid
squid-3.3.8-26.el7.x86_64

# htdigest -c /etc/squid/passwd moria gandalf
Adding password for gandalf in realm moria.
New password: mellon
Re-type new password: mellon

# cat /etc/squid/squid.conf
auth_param digest program /usr/lib64/squid/digest_file_auth -c /etc/squid/passwd
auth_param digest children 5
auth_param digest realm moria
acl foo proxy_auth REQUIRED
http_access allow foo
http_access deny all
http_port 3128

# systemctl start squid

Now, when I configure Firefox to use this Squid instance as an HTTP proxy and navigate to, say, www.squid-cache.org, the whole page is loaded at once, without the necessity of re-entering the credentials for each downloaded file.

Similarly, when downloading a file with curl:

# curl -v --proxy-digest -U gandalf:mellon -x localhost:3128 www.squid-cache.org

the Proxy-Authorization header can be reused for future proxied requests without re-entering the credentials as well.

So I wonder, what am I missing?

Comment 7 Martin Frodl 2016-08-16 13:38:02 UTC
Never mind, I found the necessary configuration here:

https://bugzilla.mozilla.org/show_bug.cgi?id=378152#c0

Comment 10 errata-xmlrpc 2016-11-03 21:17:26 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2016-2600.html


Note You need to log in before you can comment on or make changes to this bug.