]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
10 years agoBug 3775: Disable HTTP/1.1 pipeline feature for pinned connections
Christos Tsantilas [Fri, 1 May 2015 06:43:48 +0000 (23:43 -0700)] 
Bug 3775: Disable HTTP/1.1 pipeline feature for pinned connections

10 years agoCleanup: Display correct error code in debugging output for IoCallback::finish
Alex Dowad [Fri, 1 May 2015 06:42:54 +0000 (23:42 -0700)] 
Cleanup: Display correct error code in debugging output for IoCallback::finish

It seems clear that the debugging log message in IoCallback::finish
was intended to display the arguments passed to the method.

10 years agoCleanup: Fix spelling error in debug message in parseHttpRequest()
Alex Dowad [Fri, 1 May 2015 06:41:16 +0000 (23:41 -0700)] 
Cleanup: Fix spelling error in debug message in parseHttpRequest()

10 years agoCleanup: Add whitespace to make debug message in writeComplete() more readable
Alex Dowad [Fri, 1 May 2015 06:40:28 +0000 (23:40 -0700)] 
Cleanup: Add whitespace to make debug message in writeComplete() more readable

10 years agoAdd Kerberos support for MAC OS X 10.x
Markus Moeller [Sun, 26 Apr 2015 16:55:18 +0000 (09:55 -0700)] 
Add Kerberos support for MAC OS X 10.x

10 years agoBug 4234: comm_connect_addr uses errno incorrectly
Alex Dowad [Sun, 26 Apr 2015 16:48:02 +0000 (09:48 -0700)] 
Bug 4234: comm_connect_addr uses errno incorrectly

comm_connect_addr() uses errno to determine whether library calls like connect()
are successful. Its callers also use errno for extra information on the cause
of any problem. However, after calling library functions like connect(),
comm_connect_addr() calls other library functions which can overwrite errno.

As the errno manpage explains, "a function that succeeds is allowed to change
errno". So even when nothing is wrong, comm_connect_addr() may return an error
flag if libc sets errno. And when something *is* wrong, incorrect error information
may be returned to the caller because errno was overwritten with a different code.

Correct this by using our own error code variable which is set only when a library
call fails. To avoid breaking callers, set errno before returning.

10 years agoFix 'access_log none' to prevent following logs being used
Amos Jeffries [Sun, 26 Apr 2015 16:45:36 +0000 (09:45 -0700)] 
Fix 'access_log none' to prevent following logs being used

The documented behaviour of "access_log none" for preventing logging
using log lines following the directive has not been working in
Squid-3 for some time.

Since the 'none' type does not have a log module associated the entire
switch logic where its abort is checked for was being skipped.

10 years agoUnexpected SQUID_X509_V_ERR_DOMAIN_MISMATCH errors while accessing sites with valid...
Christos Tsantilas [Sun, 26 Apr 2015 16:44:23 +0000 (09:44 -0700)] 
Unexpected SQUID_X509_V_ERR_DOMAIN_MISMATCH errors while accessing sites with valid certificates

A "const char *" pointer retrieved using the SBuf::c_str() method may attached
to an SSL object using the SSL_set_ex_data method as server name used to
validate server certificates. This pointer may become invalid, causing
the SQUID_X509_V_ERR_DOMAIN_MISMATCH errors.

This patch changes the type of the ssl_ex_index_server index used with the
SSL_set_ex_data function to be an SBuf object.

This is a Measurement Factory project

10 years agoDocs: Update CONTRIBUTORS
Source Maintenance [Thu, 23 Apr 2015 14:35:55 +0000 (14:35 +0000)] 
Docs: Update CONTRIBUTORS

10 years agoEnsure class Lock counter remains within bounds
Amos Jeffries [Thu, 23 Apr 2015 12:04:52 +0000 (05:04 -0700)] 
Ensure class Lock counter remains within bounds

10 years agoPortability: Add hacks to define C++11 explicit N-bit type limits
Amos Jeffries [Thu, 23 Apr 2015 12:03:38 +0000 (05:03 -0700)] 
Portability: Add hacks to define C++11 explicit N-bit type limits

Add cstdint and stdint.h to libcompat headers and ensure that type limits
used by Squid are always available. Mostly this involves shuffling
existing hacks into the compat headers but the UINT32_* limits are new.

10 years agoFix SSL_get_peer_certificate memory leak
Christos Tsantilas [Thu, 23 Apr 2015 11:55:57 +0000 (04:55 -0700)] 
Fix SSL_get_peer_certificate memory leak

The SSL_get_peer_certificate openSSL function increases the lock for X509
object it returns so X509 object retrieved using this function must be
released with X509_free after use.
This patch uses the Ssl::X509_Pointer TidyPointer to release X509 object
retrieved with the SSL_get_peer_certificate function inside the
Ssl::PeerConnector::handleNegotiateError method

This is a Measurement Factory project

10 years agoBug 4231 pt2: comm_open_uds does not provide description for newly opened FD
Amos Jeffries [Thu, 23 Apr 2015 11:44:47 +0000 (04:44 -0700)] 
Bug 4231 pt2: comm_open_uds does not provide description for newly opened FD

Thanks to Alex Dowad for identifying the problem.

10 years agoBug 4231 pt1: fd_open() not correctly handling empty descriptions
Alex Dowad [Thu, 23 Apr 2015 11:43:22 +0000 (04:43 -0700)] 
Bug 4231 pt1: fd_open() not correctly handling empty descriptions

10 years agoNegotiate Kerberos authentication request size exceeds output buffer size.
Christos Tsantilas [Mon, 20 Apr 2015 02:46:43 +0000 (19:46 -0700)] 
Negotiate Kerberos authentication request size exceeds output buffer size.

Despite the "must match" comment, MAX_AUTHTOKEN_LEN in
auth/UserRequest.h got out of sync with similar constants in Negotiate helpers.
A 32KB buffer cannot fit some helper requests (e.g., those carrying Privilege
Account Certificate information in the client's Kerberos ticket). Each truncated
request blocks the negotiate helper channel, eventually causing helper queue
overflow and possibly killing Squid.

This patch increases MAX_AUTHTOKEN_LEN in UserRequest.h to 65535 which
is also the maximum used by the negotiate helpers. The patch also adds checks
to avoid sending truncated requests, treating them as helper errors instead.

This is a Measurement Factory project.

10 years agoDo not increment an iterator invalidated by std::map::erase().
Alex Rousskov [Mon, 20 Apr 2015 02:41:44 +0000 (19:41 -0700)] 
Do not increment an iterator invalidated by std::map::erase().

10 years agoFix require-proxy-header preventing HTTPS proxying and ssl-bump
Yuhua Wu [Mon, 20 Apr 2015 02:38:20 +0000 (19:38 -0700)] 
Fix require-proxy-header preventing HTTPS proxying and ssl-bump

When require-proxy-header was used, the request->flags.interceptTproxy is
wrongly set to 1.

Since request->flags.interceptTproxy is 1, the 200 status code for CONNECT
call is not sent which breaks both HTTPS proxying and SSL-bump.

10 years agoFix atomics check broken by C++11 #include added in v3.5 branch r13783
Alex Rousskov [Fri, 17 Apr 2015 05:59:34 +0000 (23:59 -0600)] 
Fix atomics check broken by C++11 #include added in v3.5 branch r13783
(which was a fix for atomics check broken by v3.5 branch r13778).

10 years agoSupport for resuming TLS sessions
Christos Tsantilas [Wed, 15 Apr 2015 11:35:52 +0000 (04:35 -0700)] 
Support for resuming TLS sessions

This patch adds code in squid to control SslBump behavior when dealing with
"resuming SSL/TLS sessions". Without these changes, SslBump usually terminates
all resuming sessions with an error because such sessions do not include
server certificates, preventing Squid from successfully validating the server
identity.

After these changes, Squid splices resuming sessions. Splicing is the right
because Squid most likely has spliced the original connections that the client
and server are trying to resume now.
Without SslBump, session resumption would just work, and SslBump behaviour
should approach that ideal.

Future projects may add ACL checks for allowing resuming sessions and may
add more complex algorithms, including maintaining an SMP-shared
cache of sessions that may be resumed in the future and evaluating
client/server attempts to resume a session using that cache.

This patch also makes SSL client Hello message parsing more robust and
adds an SSL server Hello message parser.

Also add support for NPN (next protocol negotiation) and ALPN
(Application-Layer Protocol Negotiation) tls extensions, required to
correctly bump web clients support these extensions

Technical details
-----------------

In Peek mode, the old Squid code would forward the client Hello message to the
server. If the server tries to resume the previous (spliced) SSL session with
the client, then Squid SSL code gets an ssl/PeerConnector.cc "ccs received
early" error (or similar) because the Squid SSL object expects a server
certificate and does not know anything about the session being resumed.

With this patch, Squid detects session resumption attempts and splices

Session resumption detection
----------------------------

There are two mechanism in SSL/TLS for resuming sessions. The traditional
shared session IDs and the TLS ticket extensions:

* If Squid detects a shared ID in both client and server Hello messages, then
Squid decides whether the session is being resumed by comparing those client
and server shared IDs. If (and only if) the IDs are the same, then Squid
assumes that it is dealing with a resuming session (using session IDs).

* If Squid detects a TLS ticket in the client Hello message and TLS ticket
support in the server Hello message as well as a Change Cipher Spec or a New
TLS Ticket message (following the server Hello message), then (and only then)
Squid assumes that it is dealing with a resuming session (using TLS tickets).

The TLS tickets check is not performed if Squid detects a shared session ID
in both client and server Hello messages.

NPN and ALPN tls extensions
---------------------------

Even if squid has some SSL hello messages parsing code, we are relying to
OpenSSL for full parsing. The openSSL used in peek and splice mode to  parse
server hello message, check for errors and verify server certificates.
If the openSSL, while parses the server hello message, find an extension enabled
in the server hello message, which is not enabled in its side, fails with an
error ("...parse tlsext...").

OpenSSL supports NPN tls extension and from 1.0.2 release supports also the
ALPN tls extensions. In peek mode we are forwading the client SSL hello message
as is, and if this message include support for NPN or ALPN tls extension is
possible that the SSL server support them and include related extensions
in its response. The openSSL will fail if support for these extensions is
not enabled in its side.

This patch handles the NPN (TLSEXT_TYPE_next_proto_neg) as follows:
Try to select the http/1.1 protocol from the server protocols list. If the
http/1.1 is not supported then the SSL bumping will fail. This is valid
because only http protocol we are supporting in squid.
Splicing is not affected.

Also add support for the ALPN TLS extension. This extension is a replacement
for the NPN extension. The client sends a list of supported protocols. In the
case of stare mode squid now sends only http as supported protocol. In the
case of server-first or client-first bumbing modes, squid does enable this
extension.

The NPN supported by chromium browser the ALPN supported by firefox.
Support for ALPN is added to openSSL 1.0.2 release.
These extensions are used to support SPDY and similar protocols.

This is a Measurement Factory project.

10 years agoBug 4212: ssl_crtd crashes with corrupt database
Amos Jeffries [Tue, 14 Apr 2015 07:26:12 +0000 (00:26 -0700)] 
Bug 4212: ssl_crtd crashes with corrupt database

The fix for Bug 3664 "ssl_crtd fails to build on OpenSolaris/OpenIndiana/Solaris 11"
introduced a regression on BSD and Linux where lockf() implementations appear not to
lock the entire file correctly or as reliably as flock().

Reverting the flock/lockf change for non-Solaris OS.

10 years agoFix rev.13795 ServerName class
Amos Jeffries [Tue, 14 Apr 2015 07:20:32 +0000 (00:20 -0700)] 
Fix rev.13795 ServerName class

MEMPROXY_CLASS operates differently in v3.5 from v4

10 years agoAdd server_name ACL matching server name(s) obtained from various sources
Christos Tsantilas [Mon, 13 Apr 2015 05:59:05 +0000 (22:59 -0700)] 
Add server_name ACL matching server name(s) obtained from various sources

... such as CONNECT request URI, client SNI, and SSL server certificate CN.

During each SslBump step, Squid improves its understanding of a "true server
name", with a bias towards server-provided (and Squid-validated) information.

The server-provided server names are retrieved from the server certificate CN
and Subject Alternate Names. The new server_name ACL matches any of alternate
names and CN. If the CN or an alternate name is a wildcard, then the new ACL
matches any domain that matches the domain with the wildcard.

Other than supporting many sources of server name information (including
sources that may supply Squid with multiple server name variants and
wildcards), the new ACL is similar to dstdomain.

Also added a server_name_regex ACL.

This is a Measurement Factory project.

10 years agoBug 4226: digest_edirectory_auth: found but cannot be built
Amos Jeffries [Sat, 11 Apr 2015 01:52:02 +0000 (18:52 -0700)] 
Bug 4226: digest_edirectory_auth: found but cannot be built

10 years agoInvalid request->clientConnectionManager object used by Ssl::PeerConnector::handleNeg...
Christos Tsantilas [Thu, 9 Apr 2015 02:15:19 +0000 (19:15 -0700)] 
Invalid request->clientConnectionManager object used by Ssl::PeerConnector::handleNegotiateError

This patch adds the Ssl::ServerBio::bumpMode() method to retrieve the configured
mode from a ServerBio object, and uses this method for checking the bumping
mode inside Ssl::PeerConnector::handleNegotiateError method

This is a Measurement Factory project

10 years agoBug 4198: assertion failed: client_side.h:364: "sslServerBump == srvBump"
Christos Tsantilas [Thu, 9 Apr 2015 02:10:55 +0000 (19:10 -0700)] 
Bug 4198: assertion failed: client_side.h:364: "sslServerBump == srvBump"

After a failed http_access acl check of an HTTP request, tunneled through a
SSL bumped connection, ssl bumping code try to re-setup the connection for a
client-first bumping mode to serve the error crashing squid.

This is a Measurement Factory project

10 years agoFix cross-compile issues with SSL_get_certificate()
Amos Jeffries [Thu, 9 Apr 2015 02:08:31 +0000 (19:08 -0700)] 
Fix cross-compile issues with SSL_get_certificate()

Explicitly assume 'no' to these hacks when cross-compiling and create
the autoconf.h #define.

Thanks to Cambier Gaëtan for identifying the problem.

10 years agoDocs: RFC 7238 obsoleted by RFC 7538
Amos Jeffries [Thu, 9 Apr 2015 02:07:17 +0000 (19:07 -0700)] 
Docs: RFC 7238 obsoleted by RFC 7538

10 years agoBoilerplate: reference Translator copyrights in CREDITS
Amos Jeffries [Thu, 9 Apr 2015 02:03:40 +0000 (19:03 -0700)] 
Boilerplate: reference Translator copyrights in CREDITS

10 years agoCleanup: Place explicit size on ref-count lock counter
Amos Jeffries [Thu, 9 Apr 2015 02:01:55 +0000 (19:01 -0700)] 
Cleanup: Place explicit size on ref-count lock counter

This allows us to make explicit calculation of child object sizes in a
portable way despite differences in system 'unsigned' size.

10 years agoCleanup: extend SBuf debugging information
Amos Jeffries [Thu, 9 Apr 2015 02:00:54 +0000 (19:00 -0700)] 
Cleanup: extend SBuf debugging information

It can be hard determining what simple operations (ie cow(), grow()) are
being done no what SBuf object. Add the SBuf::id to debugs() output on
many more operations.

10 years agodigest_edirectory_auth: Fix -lnettle dependency error
Eray Aslan [Tue, 31 Mar 2015 10:34:51 +0000 (03:34 -0700)] 
digest_edirectory_auth: Fix -lnettle dependency error

10 years ago3.5.3 SQUID_3_5_3
Amos Jeffries [Sat, 28 Mar 2015 10:56:22 +0000 (03:56 -0700)] 
3.5.3

10 years agoFix Squid crash while an error page generated
Christos Tsantilas [Fri, 27 Mar 2015 11:12:42 +0000 (04:12 -0700)] 
Fix Squid crash while an error page generated

When squid generated an error page which contains the "%m" formating code
but the authentication information is not available squid dies with
segfault.

This is a Measurement Factory project

10 years agoFix rev.13778 GNU atomics detection, and enable caching for them
Francesco Chemolli [Fri, 27 Mar 2015 10:48:37 +0000 (03:48 -0700)] 
Fix rev.13778 GNU atomics detection, and enable caching for them

10 years agoRework SBufStatsAction registration to use explicit code path
Henrik Nordstrom [Sat, 21 Mar 2015 08:16:46 +0000 (01:16 -0700)] 
Rework SBufStatsAction registration to use explicit code path

GCC was not happy about the global level registration "variable" not
being used

10 years agoBug 4206: Regression in expect:100-continue
Mike Mitchell [Sat, 21 Mar 2015 07:53:13 +0000 (00:53 -0700)] 
Bug 4206: Regression in expect:100-continue

10 years agoBug 4204: ./configure does not abort when required helpers cannot be built
Amos Jeffries [Sat, 21 Mar 2015 07:50:49 +0000 (00:50 -0700)] 
Bug 4204: ./configure does not abort when required helpers cannot be built

10 years agoBug 4213: negotiate_kerberos_auth: freeing non-dynamic memory
Amos Jeffries [Sat, 21 Mar 2015 07:48:43 +0000 (00:48 -0700)] 
Bug 4213: negotiate_kerberos_auth: freeing non-dynamic memory

10 years agoPortability: check 64-bit GNU atomic operators are useable
Amos Jeffries [Sat, 21 Mar 2015 07:38:14 +0000 (00:38 -0700)] 
Portability: check 64-bit GNU atomic operators are useable

Sometimes (namely 32-bit OpenBSD libstdc++) do not fully implement the
GNU atomic operators for both 32-bit and 64-bit. But Squid makes use of
both types if the compiler deems them required.

We need to check them all before declaring the atomics usable, or not.

 Thanks to Stuart Henderson for identifying the issue.

10 years agoext_kerberos_ldap_group_acl: Heimdal support improvements
Markus Moeller [Sat, 21 Mar 2015 06:32:34 +0000 (23:32 -0700)] 
ext_kerberos_ldap_group_acl: Heimdal support improvements

* fix build errors on FreeBSD with Heimdal library

* remove PAC support from being built when not needed

* update man(8) page documentation po4a syntax

10 years agoRevert to rev.13773
Source Maintenance [Thu, 19 Mar 2015 15:40:41 +0000 (15:40 +0000)] 
Revert to rev.13773

10 years agoBootstrapped
Source Maintenance [Tue, 17 Mar 2015 03:25:17 +0000 (03:25 +0000)] 
Bootstrapped

10 years agoSourceFormat Enforcement
Source Maintenance [Fri, 13 Mar 2015 20:17:40 +0000 (20:17 +0000)] 
SourceFormat Enforcement

10 years agoSourceFormat Enforcement
Source Maintenance [Fri, 13 Mar 2015 16:15:12 +0000 (16:15 +0000)] 
SourceFormat Enforcement

10 years agoFix uninitialized member of ps_state
Amos Jeffries [Fri, 13 Mar 2015 11:35:58 +0000 (04:35 -0700)] 
Fix uninitialized member of ps_state

 Detected by Coverity Scan. Issue 740575

10 years agoRemove useless checks in rev.13767
Amos Jeffries [Fri, 13 Mar 2015 11:24:18 +0000 (04:24 -0700)] 
Remove useless checks in rev.13767

Being overly paranoid it seems.

 Detected by Coverity Scan. Issue 1273436

10 years agoSourceFormat Enforcement
Source Maintenance [Tue, 3 Mar 2015 18:14:15 +0000 (18:14 +0000)] 
SourceFormat Enforcement

10 years agoPortability: fix OpenBSD 5.4 unit test compile error
Amos Jeffries [Tue, 3 Mar 2015 16:17:32 +0000 (08:17 -0800)] 
Portability: fix OpenBSD 5.4 unit test compile error

10 years agoPortability: only use SSL compression when available
Stuart Henderson [Tue, 3 Mar 2015 14:57:33 +0000 (06:57 -0800)] 
Portability: only use SSL compression when available

Compression in SSL/TLS is deprecated. LibreSSL, BoringSSL, and some
OpenSSL builds do not contain support for it at all.

10 years agoBug 2907: high CPU usage on CONNECT when using delay pools
Amos Jeffries [Tue, 3 Mar 2015 14:48:01 +0000 (06:48 -0800)] 
Bug 2907: high CPU usage on CONNECT when using delay pools

When delay pools are active on a CONNECT tunnel and the pool is drained
the I/O loop cycles very often transferring 1 byte until the pool is
topped-up at the end of the second.

Instead of looping constantly trying to read 1 byte at a time, add an
asynchronous event to wait for a few I/O cycles or until more bytes can
be read.

To protect against infinite loops of waiting when many tunnels are
competing for the pool allowance we only delay for a limited number of
loops before allowing at least 1 byte through. Also, the amount of time
waited is an odd fraction of 1 second so re-tries naturally spread
across any given second fairly, with connections rotating closer or
further from the time when pool topup happens. That behaviour still
allows some variance in service times, but overall the CPU consumption
and (as a result) total proxy speed appears to be much improved.

NP: Initial production testing shows a 36% RPS speed increase,
    with a 50% reduction in total CPU usage.

10 years agoFake CONNECT exceeds concurrent requests limit.
Christos Tsantilas [Tue, 3 Mar 2015 14:45:57 +0000 (06:45 -0800)] 
Fake CONNECT exceeds concurrent requests limit.

Squid closes the SSL client connection with "Failed to start fake CONNECT
request for ssl spliced connection". This happens especially often when
the pipeline_prefetch configuration parameter is set to "0" (i.e., default).

When a transparent SSL connection is peeked and then spliced in step2, we are
generating a fake CONNECT request. The fake CONNECT request is counted as a
new pipelined request and may exceed the configured limit. This patch solves
this problem by raising the limit for that request.

Needs more work to better identify the requests that need a different limit.

This is a Measurement Factory project.

10 years agoBug 3805: support shared memory on MacOS X in Mem::IPC::Segment
Joshua Root [Tue, 3 Mar 2015 14:41:07 +0000 (06:41 -0800)] 
Bug 3805: support shared memory on MacOS X in Mem::IPC::Segment

MacOS X doesn't support the O_TRUNC flag to shm_open; it is redundant anyway
because the shared memory segment is truncated immediately after opening
as per best practices. With this support Squid can now be built and run
under MacOS X.

10 years agoFix testHeaders
Amos Jeffries [Tue, 3 Mar 2015 14:39:45 +0000 (06:39 -0800)] 
Fix testHeaders

10 years agoext_wbinfo_group_acl: Perl 5.20 syntax errors
drserge [Tue, 3 Mar 2015 14:38:33 +0000 (06:38 -0800)] 
ext_wbinfo_group_acl: Perl 5.20 syntax errors

With Perl 5.20 the helper exits with many errors similar to:

  Global symbol "$groupSID" requires explicit package name at
    /usr/libexec/squid/ext_wbinfo_group_acl

10 years agobasic_nis_auth: fail authentication on crypt() failures
Amos Jeffries [Tue, 3 Mar 2015 14:37:28 +0000 (06:37 -0800)] 
basic_nis_auth: fail authentication on crypt() failures

... instead of crashing the helper.

"
Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL (w/
NULL return) if the salt violates specifications. Additionally, on
FIPS-140 enabled Linux systems, DES or MD5 encrypted passwords passed to
crypt() fail with EPERM (w/ NULL return).
"

10 years agobasic_getpwnam_auth: fail authentication on crypt() failures
Amos Jeffries [Tue, 3 Mar 2015 14:36:20 +0000 (06:36 -0800)] 
basic_getpwnam_auth: fail authentication on crypt() failures

... instead of crashing the helper.

"
Starting with glibc 2.17 (eglibc 2.17), crypt() fails with EINVAL (w/
NULL return) if the salt violates specifications. Additionally, on
FIPS-140 enabled Linux systems, DES or MD5 encrypted passwords passed to
crypt() fail with EPERM (w/ NULL return).
"

10 years agoSourceFormat Enforcement
Source Maintenance [Mon, 2 Mar 2015 18:14:14 +0000 (18:14 +0000)] 
SourceFormat Enforcement

10 years agoPortability: SSLv2 is not always available
Stuart Henderson [Mon, 2 Mar 2015 14:42:10 +0000 (06:42 -0800)] 
Portability: SSLv2 is not always available

SSLv2 client handshake is deprecated and not all SSL libraries support
it any longer. Allow buildign Squid anyway.

10 years ago3.5.2 SQUID_3_5_2
Amos Jeffries [Wed, 18 Feb 2015 12:16:21 +0000 (04:16 -0800)] 
3.5.2

10 years agoPrep for 3.5.2 and 3.4.12
Amos Jeffries [Wed, 18 Feb 2015 10:30:07 +0000 (02:30 -0800)] 
Prep for 3.5.2 and 3.4.12

10 years agoFix sslproxy_options in peek-and-splice mode
Christos Tsantilas [Wed, 18 Feb 2015 08:50:00 +0000 (00:50 -0800)] 
Fix sslproxy_options in peek-and-splice mode

Problem description:
- Squid sslproxy_options deny the use of TLSv1.2 SSL protocol:
   sslproxy_options NO_TLSv1_2
- Squid uses peek mode for bumped connections.
- Web client sends a TLSv1.2 hello message and squid in peek mode,
  forwards the client hello message to server
- Web server responds with a TLSv1.2 hello message
- Squid while parsing server hello message aborts with an error because
  sslproxy_options denies the use of TLSv1.2 protocol.

This patch fixes squid to ignore sslproxy_options when peek or stare
bumping mode is selected on bumpStep2 bumping step.

The sslproxy_options are applied if bump (server-first or client-first)
mode is selected on bumpStep1 or bumpStep2 bumping step. Also for
proxied https:// scheme requests.

This is a Measurement Factory project

10 years agoFix memory leaks in cachemgr.cgi URL parser
Amos Jeffries [Wed, 18 Feb 2015 04:15:40 +0000 (20:15 -0800)] 
Fix memory leaks in cachemgr.cgi URL parser

  Detected by Coverity Scan. Issue 1256164

10 years agonegotiate_kerberos_auth: fix krb5.conf backward compatibility
Markus Moeller [Wed, 18 Feb 2015 04:10:42 +0000 (20:10 -0800)] 
negotiate_kerberos_auth: fix krb5.conf backward compatibility

Older versions of the helper would use krb5.conf settings via the
library support. This was lot recently, now restored.

Also add some variable checks in the helper.

Also, remove PAC support from being built when not needed

10 years agoRevert C++11-ism from 3.5 branch
Amos Jeffries [Sat, 14 Feb 2015 22:37:06 +0000 (14:37 -0800)] 
Revert C++11-ism from 3.5 branch

10 years agoSNI information is not set on transparent bumping mode
Christos Tsantilas [Tue, 10 Feb 2015 04:54:21 +0000 (20:54 -0800)] 
SNI information is not set on transparent bumping mode

Forward SNI (obtained from an intercepted client connection) to servers
when SslBump peeks or stares at the server certificate.

SslBump was not forwarding SNI to servers when Squid obtained SNI from an
intercepted client while peeking (or staring) at client Hello.

This is a Measurement Factory project

10 years agoBug 4176: Digest auth too many helper lookups
Amos Jeffries [Tue, 10 Feb 2015 04:52:44 +0000 (20:52 -0800)] 
Bug 4176: Digest auth too many helper lookups

10 years agoFix potential NULL dereference
Amos Jeffries [Tue, 10 Feb 2015 04:49:43 +0000 (20:49 -0800)] 
Fix potential NULL dereference

Logging can potentially happen when there is no client request underway.

  Detected by Coverity Scan. Issue 434122

10 years agoQuieten CBDATA 'leak' messages
Amos Jeffries [Tue, 10 Feb 2015 04:45:52 +0000 (20:45 -0800)] 
Quieten CBDATA 'leak' messages

The majority being reported were false-positive as
cbdataReferenceValidDone() clearing the valid flag before the lock.

10 years agoBug 4073: Cygwin compile errors
Eldar Akchurin [Tue, 10 Feb 2015 04:42:35 +0000 (20:42 -0800)] 
Bug 4073: Cygwin compile errors

Remove the definition of _SQUID_WINDOWS_ for Cygwin builds. The blend
of win32 and Linux environments is sufficiently different to have major
build issues. We have a precedent in kFreeBSD blend of BSD and Linux to
consider Cygwin a blend and first-class OS.

Also, temporarily disable the Win32-specific libraries and objects until
they can be properly tested.

Fix some small remaining compile errors after the above.

 Cygwin Windows build is sponsored by Diladele B.V.

10 years agoCygwin: Disable C++11 detection and default use
Amos Jeffries [Tue, 10 Feb 2015 03:15:56 +0000 (19:15 -0800)] 
Cygwin: Disable C++11 detection and default use

The flags to enable can still be presented explicitly by the user but
there are known clashes with POSIX / ANSI definitions that sound
remarkably sinmilar to the Clang issues with -std=c++0x

10 years agoFix some cbdataFree related memory leaks
Amos Jeffries [Fri, 6 Feb 2015 15:59:58 +0000 (07:59 -0800)] 
Fix some cbdataFree related memory leaks

The delete operator should have been called for these objects after
previous code changes converted them to CBDATA_CLASS. As a result any
member objects relying on their destructor to cleanup were being leaked.

Also, make generic_cbdata::data a private member. The unwrap() method is
easily used now.

10 years agoBug 4180: Fix not-fully-initialized data member in ACLUserData
Francesco Chemolli [Fri, 6 Feb 2015 15:26:24 +0000 (07:26 -0800)] 
Bug 4180: Fix not-fully-initialized data member in ACLUserData

10 years agoBug 4172: Solaris broken krb5-config
Amos Jeffries [Sun, 1 Feb 2015 09:15:44 +0000 (01:15 -0800)] 
Bug 4172: Solaris broken krb5-config

10 years agoStop emitting (Proxy-)Authentication-Info for Negotiate
Amos Jeffries [Sun, 1 Feb 2015 09:14:12 +0000 (01:14 -0800)] 
Stop emitting (Proxy-)Authentication-Info for Negotiate

This header is not defined for use by RFC 4559, and there seem to
be no clients actually using it.

The syntax Squid was using to emit the details was also clashing
with the syntax defined for use in Digest which is becoming the
standardized ABNF syntax for the header in general.

10 years agoRemove dst ACL dependency on HTTP request message existence
Amos Jeffries [Sun, 1 Feb 2015 09:12:31 +0000 (01:12 -0800)] 
Remove dst ACL dependency on HTTP request message existence

The ACL checklist dst_addr member can be used in cases where the HTTP
message is not provided. Such as ssl_bump, ICAP outgoing IP, or peer
selection probes.

10 years agoDocs: drop obsolete chunked_request_body_max_size references
Amos Jeffries [Sat, 24 Jan 2015 05:00:00 +0000 (21:00 -0800)] 
Docs: drop obsolete chunked_request_body_max_size references

This option has done nothing since Squid-3.2.

10 years agoFix ::Parser::Tokenizer::prefix() limited token results
Amos Jeffries [Sat, 24 Jan 2015 04:55:12 +0000 (20:55 -0800)] 
Fix ::Parser::Tokenizer::prefix() limited token results

When he prefix() method is passed a set limit for characters to scan and
the matched characters do reach that limit the entire Tokenizer buffer
content is consumed and returned.

Correct operation is to only consume and return the matched characters.

10 years agoAdd missing root CAs when validating chains that passed internal checks.
Christos Tsantilas [Sat, 24 Jan 2015 04:53:39 +0000 (20:53 -0800)] 
Add missing root CAs when validating chains that passed internal checks.

When internal checks found no certificate errors, Squid does not include root
CA certificate in certificates chain sent to the certificate validator. Squid
just sent the certificates chain sent by the SSL server.

This patch stores the full certificates list built by OpenSSL while validating
the SSL server certificates chain, even if no certificate error found and sends
this list to certificate validator.

This is a Measurement Factory project

10 years agoSet cap_net_admin capability when Squid sets TOS/Diffserv packet values.
Christos Tsantilas [Thu, 22 Jan 2015 14:01:41 +0000 (06:01 -0800)] 
Set cap_net_admin capability when Squid sets TOS/Diffserv packet values.

In capabilities-capable environments (e.g., Linux with libcap), CAP_NET_ADMIN
capability is required to honor clientside_tos and tcp_outgoing_tos
directives. The code was setting that capability when Netfilter marks or
tproxy was enabled, but missed the clientside_tos and tcp_outgoing_tos cases.

This is a Measurement Factory project

10 years agoAdd TLS/SSL option NO_TICKET to http[s]_port
Christos Tsantilas [Thu, 22 Jan 2015 14:00:04 +0000 (06:00 -0800)] 
Add TLS/SSL option NO_TICKET to http[s]_port

If this option is set the TLS ticket extension disabled.

When TLS ticket extension is disabled squid is still able to use SSL shared
sessions if this feature is not disabled.

This is a Measurement Factory project

10 years agoSourceFormat Enforcement
Source Maintenance [Tue, 20 Jan 2015 12:14:20 +0000 (12:14 +0000)] 
SourceFormat Enforcement

10 years agoBug 4066: Digest auth nonce indefinite rollover
Frederic Bourgeois [Tue, 20 Jan 2015 10:36:06 +0000 (02:36 -0800)] 
Bug 4066: Digest auth nonce indefinite rollover

10 years agoHTCP: fix memory initialization errors
Amos Jeffries [Tue, 20 Jan 2015 10:03:07 +0000 (02:03 -0800)] 
HTCP: fix memory initialization errors

memset() used to initialize HTCP objects made sense when they were
structs. But now they are classes proper constructors need to be used
to avoid memset() erasing vtable and other important areas. It also
helps to reduce code and improve performance during init a tiny bit.

memset() errors found by Clang 3.5

10 years agoPortability: Remove more C++11-isms in ACLs
Amos Jeffries [Tue, 20 Jan 2015 09:48:40 +0000 (01:48 -0800)] 
Portability: Remove more C++11-isms in ACLs

10 years agoPortability: Remove C++11-isms in ACLs
Amos Jeffries [Mon, 19 Jan 2015 17:28:43 +0000 (09:28 -0800)] 
Portability: Remove C++11-isms in ACLs

FreeBSD 10 clang complains about these.

10 years agoReplace Splay with std::set in several ACL types
Francesco Chemolli [Mon, 19 Jan 2015 13:54:09 +0000 (05:54 -0800)] 
Replace Splay with std::set in several ACL types

10 years agoSourceFormat Enforcement
Source Maintenance [Mon, 19 Jan 2015 12:14:46 +0000 (12:14 +0000)] 
SourceFormat Enforcement

10 years agoCleanup: remove several never-true / never-false comparisons
Amos Jeffries [Mon, 19 Jan 2015 11:50:22 +0000 (03:50 -0800)] 
Cleanup: remove several never-true / never-false comparisons

... which are invalid in C++.

Clang 3.5 refuses to build code containing these invalid comparisons.

Also, fixes several abuses of SplayNode<> objects. Code using splay
trees must use the Splay<> tree template, not the internal SplayNode.

10 years agoFix several crashes when debugging enabled
Amos Jeffries [Sun, 18 Jan 2015 04:26:07 +0000 (20:26 -0800)] 
Fix several crashes when debugging enabled

psstate->entry may be null, it is not safe to directly access the entry
url() method. Use the safe alternative offered by psstate instead.

10 years agoBug 3997: Excessive NTLM or Negotiate auth helper annotations
Amos Jeffries [Sun, 18 Jan 2015 04:24:51 +0000 (20:24 -0800)] 
Bug 3997: Excessive NTLM or Negotiate auth helper annotations

With the transaction annotations feature added in Squid-3.4 auth
helper response values get recorded as annotatiions. In the case
of NTLM and Negotiate authentication the helper response contains
a large credentials token which changes frequently.

Also, user credentials state is cached. In the case of NTLM and
Negotiate the active credentials are cached in the TCP connection
state data, but also for the cache mgr helper reports make use of
caching in a global username cache.

When these two features are combined, the global username cache
for mgr reporting accumulates all TCP connection specific
token= values presented by the client on all its connections, and
any changes to the token over its lifetime.

The result is that for users performing either many transactions,
or staying connected for long periods the memory consumption from
unnecesarily stored tokens is excessive. When clients do both the
machine memory can be consumed, and the CPU can reach 100%
consumption just walking the annotations lists during regular
operations.

To fix this we drop the security credentials tokens from cached
annotations list in NTLM and Negotiate. Digest is also included
though its HA1 token value is static it has similar privacy issues
related to storage.

Also, use the new 3.5 API for username cache key creation to build
the global username cache key for NTLM/Negotiate using the TCP
connection specific token so that credentials and associated
tokens do not get accidentally shared between connections and the
manager can accurately report users.

10 years agoFix silent SSL/TLS failure on split-stack operating systems
Amos Jeffries [Sun, 18 Jan 2015 04:20:58 +0000 (20:20 -0800)] 
Fix silent SSL/TLS failure on split-stack operating systems

Up to now we have not cloned any of the SSL/TLS related config state if
the port needed cloning into separate IPv6 and IPv4 sockets.

It is safe enough to clone the text strings received directly from
squid.conf and rely on later port setup to generate separate sslContext
objects.

10 years ago3.5.1 SQUID_3_5_1
Amos Jeffries [Tue, 13 Jan 2015 12:51:27 +0000 (04:51 -0800)] 
3.5.1

10 years agoPrep for 3.4.11 and 3.5.1
Amos Jeffries [Tue, 13 Jan 2015 11:41:41 +0000 (03:41 -0800)] 
Prep for 3.4.11 and 3.5.1

10 years agoSourceFormat Enforcement
Source Maintenance [Tue, 13 Jan 2015 09:13:49 +0000 (09:13 +0000)] 
SourceFormat Enforcement

10 years agoMaintain copyright blurb claims across end of year
Source Maintenance [Tue, 13 Jan 2015 09:03:18 +0000 (09:03 +0000)] 
Maintain copyright blurb claims across end of year

10 years agoMinGW: various fixes in libcompat addrinfo API
Dennis Felippa [Tue, 13 Jan 2015 09:00:35 +0000 (01:00 -0800)] 
MinGW: various fixes in libcompat addrinfo API

10 years agoFix acl formatting in config CacheMgr action
Francesco Chemolli [Tue, 13 Jan 2015 08:56:12 +0000 (00:56 -0800)] 
Fix acl formatting in config CacheMgr action

10 years agosquidclient: Fix -A and -P options
Amos Jeffries [Tue, 13 Jan 2015 08:44:51 +0000 (00:44 -0800)] 
squidclient: Fix -A and -P options

With --https addition the A and P values are re-used for --cert and
--params within HTTPS options. This works for long options, but they
cannot be listed as short options by the Transport:: module because
they are required at the top level by old-style HTTP parameters.

10 years agocachemgr.cgi: memory leak in request parser
Amos Jeffries [Fri, 9 Jan 2015 06:07:34 +0000 (22:07 -0800)] 
cachemgr.cgi: memory leak in request parser

Leaks a block of memory for each header parsed the size of the header.

The CGI is rarely operating for long periods, it is run as-needed by
servers so the memory leak does not accumulate long term.

  Detectd by Coverity Scan. Issue 1256164

10 years agoImproved automake 1.13+ support in unit-tests
Amos Jeffries [Fri, 9 Jan 2015 06:02:47 +0000 (22:02 -0800)] 
Improved automake 1.13+ support in unit-tests

Automake 1.13+ are warning about subdir-objects being enabled in
future versions but Squid currently relies on several environment
constructs that prevent that feature from working.

* All cppunit tests share a main() implementation in testMain.cc
  which is not able to easily be built as a .o from locations
  such as compat/.

  Fix this by making the code to include/unitTestMain.h and
  including it as an inline main() definition for all cppunit
  tests core .cc files.

* lib/testAll unit test

  Fix by splitting out into multiple unit-test binaries as is done
  by the rest of Squid. And removing duplicate testMain.cc.

* lib/ and src/ objects link to objects in child directories

  Enable subdir-objects when possible. Some remain due to
  depending on stubs files in the not yet created src/tests/ build
  directory. That will be fixed in a future commit.