]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
14 years agoBug fix: src ACL broken with sslproxy_cert_error
Christos Tsantilas [Mon, 23 Apr 2012 16:34:04 +0000 (19:34 +0300)] 
Bug fix: src ACL broken with sslproxy_cert_error

The following Squid configuration uses src ACL with sslproxy_cert_error:
   acl me src 172.16.101.51
   sslproxy_cert_error allow me
Cache log shows that the source IP address is missing when the 'me' ACL
is checked for sslproxy_cert_error:
   | ACL::checklistMatches: checking 'me'
   | aclIpAddrNetworkCompare: compare: *[::]/[ff...ff] ([::])*  vs ...
   | aclIpMatchIp: '[::]' NOT found

The problem is that the HttpRequest::client_addr is not set, for  the fake
HTTPS request created to initiate the  bump-server-first procedure.

14 years agoCert adaptation algorithms: skip ACL checks if they are not realy needed
Christos Tsantilas [Fri, 20 Apr 2012 17:23:04 +0000 (20:23 +0300)] 
Cert adaptation algorithms: skip ACL checks if they are not realy needed

Skip ACLs checks for algorithms that we know are going to be ignored because
they matched once already.

14 years agoDetail the error page error
Christos Tsantilas [Fri, 20 Apr 2012 17:14:56 +0000 (20:14 +0300)] 
Detail the error page error

This patch trying to handle at least the following three cases when we are
reporting error details to the user and logging error details:

1) Shallow error: The same code discovers the error and creates the
error page. The request details will be in sync with the error page
details because they are discovered at the same time, by the same code.

2) Honored deep error: Somewhere deep inside, say, ICAP or DNS code, an
error was detected and detailed. The error condition/answer slowly and
asynchronously propagated to the place where the error page is being
created. We want to preserve that original deep detail if any or provide
the current high-level detail if no deep detail is available.

3) Bypassed deep error1 followed by error2: Somewhere deep inside, say,
ICAP or DNS code, error1 was detected and detailed. The error1 condition
started propagating up but the ICAP or DNS transaction was eventually
successfully retried. Later, a deep or shallow error2 was discovered.
The error1 detail becomes irrelevant when we started to retry the failed
transaction.

This patch:
  - Reset the error details when ICAP transactions retried, adaptation services
    retried or replaced by the fail-over service and when the forwarding code
    retry the connection to the destication servers.

  - On SSLBump errors the error details, logged in both master CONNECT request
    plus the first tunnelled GET request. To achieve this the error details
    of the bump-server-first fake request saved to the CONNECT HttpRequest
    object, and the logging of CONNECT request delayed until we have the
    bump-server-first answer (freeAllContexts called after SSL-Server answered).

 - Fix the cases where we set custom error codes (internal squid error codes)
   to ErrorState::xerrno member. This member is only for system errors.

 - We should not set ErrorState::xerrno to system err number unless we know
   that the current system error triggered the error page generation.
   This patch sets this member only to the system errorno passed by squid
   API (eg AsyncCalls API).
   This is also fix a possible bug in gopher.cc subsystem.

 - We are setting the HttpRequest:detailError inside ErrorState::BuildHttpReply
   method, where we have all the information required to corrently build
   HttpRequest error details.

14 years agoPolished sslproxy_cert_sign and sslproxy_cert_adapt documentation.
Alex Rousskov [Fri, 20 Apr 2012 17:18:17 +0000 (11:18 -0600)] 
Polished sslproxy_cert_sign and sslproxy_cert_adapt documentation.

Most importantly, we now explicitly document that sslproxy_cert_adapt stops
searching for other ACL matches within the same adaptation algorithm group
once the first matching sslproxy_cert_adapt is found within an adaptation
algorithm group.

14 years agoMark verified intercept traffic correctly after DNS lookup
Alexander Komyagin [Wed, 18 Apr 2012 22:28:06 +0000 (10:28 +1200)] 
Mark verified intercept traffic correctly after DNS lookup

14 years agoSsl certificate domain mismatch errors on IP-based URLs
Christos Tsantilas [Tue, 17 Apr 2012 16:08:41 +0000 (19:08 +0300)] 
Ssl certificate domain mismatch errors on IP-based URLs

The ssl::certDomainMismatch acl can not be used with ip-based urls. For example
let's assume that a user enters https://74.125.65.99/, using a Google IP addressin the URL instead of www.google.com. If the sslBump used with
"sslproxy_cert_error allow all" and "sslproxy_cert_adapt setCommonName ssl::certDomainMismatch"
the browser displays a browser "Server's certificate does not match the URL"
error.

This is because for all cases we have the ip address instead of the hostname
we are detecting the cert domain mismatch errors when the first GET request
comes. At the time the sslproxy_cert_adatp access list processed the error is
not detected yet.
For intercepted connections this is the desired behaviour.

This patch fix the ssl-bump-first to check for domain-mismatch errors while
retrieving the SSL certificate from the server, hoping that CONNECT is using
a user-entered address (a host name or a user-entered IP).

14 years agobug fix: assertion failed: client_side.cc:3720: "alg && param"
Christos Tsantilas [Tue, 17 Apr 2012 15:21:39 +0000 (18:21 +0300)] 
bug fix: assertion failed: client_side.cc:3720: "alg && param"

Someone can hit this assertion when have two "sslproxy_cert_adapt setCommonName"
configuration lines the first with parameter but the second without parameter:
  sslproxy_cert_adapt setCommonName{toThisOne} AN_IP
  sslproxy_cert_adapt setCommonName AN_IP

Inside ConnStateData::buildSslCertGenerationParams method inside the loop
  for (sslproxy_cert_adapt *ca = Config.ssl_client.cert_adapt; ....) {...}
the second time the loop entered the param is NULL and never set because
certProperties.setCommonName is already set, so we hit the assertion.

The problem solved with removing the assertion.

14 years agoBug 3484: Docs: sslproxy_cert_error example flawed
Alex Rousskov [Thu, 12 Apr 2012 19:57:57 +0000 (13:57 -0600)] 
Bug 3484: Docs: sslproxy_cert_error example flawed

Synced ACL name after ACL type change in r12117.

This is still far from perfect because dstdomain is not really a FAST ACL
either: Its documentation says that it becomes slow on IP addresses.

14 years agoPrep for 3.2.0.17
Amos Jeffries [Thu, 12 Apr 2012 13:27:15 +0000 (07:27 -0600)] 
Prep for 3.2.0.17

14 years agoBug 3484: Docs: sslproxy_cert_error example flawed
Guy Helmer [Thu, 12 Apr 2012 03:12:59 +0000 (15:12 +1200)] 
Bug 3484: Docs: sslproxy_cert_error example flawed

14 years agoAdditional 308 status handling
Amos Jeffries [Wed, 11 Apr 2012 09:10:15 +0000 (03:10 -0600)] 
Additional 308 status handling

* relay "Permanent Redirect" message on status line
* MAY cache these responses with heuristics
* accept this status as a redirect status from URL redirectors

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 11 Apr 2012 00:15:57 +0000 (18:15 -0600)] 
SourceFormat Enforcement

14 years agosslproxy_cert_sign/sslproxy_cert_adapt: Document the SQUID_X509_V_ERR_DOMAIN_MISMATCH bug
Christos Tsantilas [Tue, 10 Apr 2012 16:02:41 +0000 (19:02 +0300)] 
sslproxy_cert_sign/sslproxy_cert_adapt: Document the SQUID_X509_V_ERR_DOMAIN_MISMATCH bug

Replace the documentation for the SQUID_X509_V_ERR_DOMAIN_MISMATCH related bug
with a "WARNING" which describes the problem.

14 years agoC++ type checking does not permit sockaddr static_cast
Amos Jeffries [Tue, 10 Apr 2012 12:02:15 +0000 (06:02 -0600)] 
C++ type checking does not permit sockaddr static_cast

14 years agoBug 3441: Part 3: Replace corrupted v1 swap.state with new v2 format.
Alex Rousskov [Tue, 10 Apr 2012 04:26:14 +0000 (22:26 -0600)] 
Bug 3441: Part 3: Replace corrupted v1 swap.state with new v2 format.

A fix for bug 3408 changed the offset at which we start writing dirty
swap.state entries from StoreSwapLogHeader::record_size to StoreSwapLogHeader
size.  However, the log-reading code still read the entries starting from the
old offset (which is required to remain compatible with how a clean swap.state
is written).

Wrong starting offset essentially means that the vast majority of read
swap.state entries were bogus. They could only match some real entry when 64*n
is divisible by 12 and perhaps when their random data just happened to match a
real entry. Part 2 of this bug fix (trunk r11995) started to pad the [dirty]
swap.state header to start entry writing at StoreSwapLogHeader::record_size
boundary.

Changes specific to Part 3:

Unfortunately, since old v1 logs could contain completely bogus entries as the
result of being read (at some point) from the wrong offset, we should not load
v1 logs any more (neither dirty nor clean because what looks clean now could
be based on a previously dirty and, hence, corrupted log). This forced us to
raise the swap.state format version from 1 to 2.

After this change, if a v1 swap log is detected, Squid ignores it and does a
from-directory rebuild as if no swap.state files were found.

Since we had to change swap.state format version, we also made log entry size
and composition the same across virtually all platforms; added checksums so
that a similar bug would not go unnoticed for so long (and would not result in
log corruption); and increased the size of time-related entries to avoid the
"year 2038" problem.

The swap log entries are still written to disk in host byte order.

We now also zero the [dirty] swap.state header padding to prevent random and
potentially sensitive garbage in logs.

Cache index rebuild kinds are now reported using the following three labels:

* Rebuild using a swap log created by Squid during clean shutdown: "clean log"
* Rebuild using a swap log accumulated by a running Squid: "dirty log"
* Rebuild using directory scan: "no log"

The first kind used to be reported as CLEAN and the other two as DIRTY rebuild.

14 years agoLanguage: fr updates
Bernard [Fri, 6 Apr 2012 18:05:45 +0000 (06:05 +1200)] 
Language: fr updates

14 years agoDomain mismatch when CONNECT has domain
Christos Tsantilas [Thu, 5 Apr 2012 17:10:41 +0000 (20:10 +0300)] 
Domain mismatch when CONNECT has domain

Customers want Squid to detect domain mismatch as early as possible so
that Squid uses a minimal valid fake certificate and serves a
[customized] Squid error. Currently, the browser always displays the
built-in error even if CONNECT has a domain name.

This patch tells Squid to use CONNECT host name if not peeking or if it is not
an IP while peeking. It also sends SNI information if host name is not an IP.

Also on error pages use the server certificate CN as hostname only if the
CONNECT host name is not an IP address.

14 years agoAdd checks to assure that a cached certificate is valid for current request
Christos Tsantilas [Thu, 5 Apr 2012 16:38:31 +0000 (19:38 +0300)] 
Add checks to assure that a cached certificate is valid for current request

Add checks in Ssl::certificateMatchesProperties to assure:
 - The CN name of the cached certificate matches the requested CN
 - "Not After" and "Not Before" fields of the cached certificate are valid

Ssl::CommonHostName and getOrganization  functions moved to gadgets.cc to allow
use by ssl_crtd daemon

14 years agoTypo in cachemgr CGI manual
Amos Jeffries [Thu, 5 Apr 2012 01:15:20 +0000 (13:15 +1200)] 
Typo in cachemgr CGI manual

14 years agoBug 3527: EUI compile errors on Mac OS X 10.5.8 PPC
Amos Jeffries [Wed, 4 Apr 2012 22:16:12 +0000 (10:16 +1200)] 
Bug 3527: EUI compile errors on Mac OS X 10.5.8 PPC

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 4 Apr 2012 00:21:57 +0000 (18:21 -0600)] 
SourceFormat Enforcement

14 years agoBug 3505: crash in CbcPointer<Comm::ConnOpener> constructor
Alex Rousskov [Tue, 3 Apr 2012 11:06:14 +0000 (23:06 +1200)] 
Bug 3505: crash in CbcPointer<Comm::ConnOpener> constructor

14 years agoNULL defined by our compat/types.h
Amos Jeffries [Tue, 3 Apr 2012 05:29:24 +0000 (23:29 -0600)] 
NULL defined by our compat/types.h

14 years agoAdd missing include in snmp_core.cc
Amos Jeffries [Tue, 3 Apr 2012 05:00:59 +0000 (17:00 +1200)] 
Add missing include in snmp_core.cc

14 years agoLanguage: fr updates
Bernard [Mon, 2 Apr 2012 18:05:47 +0000 (06:05 +1200)] 
Language: fr updates

14 years agoBootstrapped
Automatic source maintenance [Mon, 2 Apr 2012 04:59:33 +0000 (22:59 -0600)] 
Bootstrapped

14 years agoTypo in UdpOpenDialer
Amos Jeffries [Mon, 2 Apr 2012 02:25:40 +0000 (14:25 +1200)] 
Typo in UdpOpenDialer

14 years agoLanguage: fr updates
Bernard [Mon, 2 Apr 2012 00:05:59 +0000 (12:05 +1200)] 
Language: fr updates

14 years agoLanguage: pt_BR updates
Aecio F. [Sat, 31 Mar 2012 00:05:44 +0000 (12:05 +1200)] 
Language: pt_BR updates

14 years agoPolish: de-duplicate UDP port dialers
Amos Jeffries [Thu, 29 Mar 2012 09:22:41 +0000 (21:22 +1200)] 
Polish: de-duplicate UDP port dialers

This create a Comm::UdpOpenDialer class which replaces the ICP, HTCP and
SNMP start-listening dialer classes. Their code was very close to
identical anyway.

ICP and HTCP can now also use the dialer Comm::Connection parameter
instead of assuming that the callback relates to the global incoming
port variable.

14 years agoLanguage: pt_BR updates
Aecio F. [Wed, 28 Mar 2012 18:05:42 +0000 (06:05 +1200)] 
Language: pt_BR updates

14 years agoMerged from trunk (r12098, v3.2.0.16+).
Christos Tsantilas [Tue, 27 Mar 2012 16:52:31 +0000 (19:52 +0300)] 
Merged from trunk (r12098,  v3.2.0.16+).

14 years agoRegister status 308 permanent redirect
Amos Jeffries [Mon, 26 Mar 2012 21:33:42 +0000 (09:33 +1200)] 
Register status 308 permanent redirect

14 years agoFake certificate version
Christos Tsantilas [Fri, 23 Mar 2012 14:27:31 +0000 (16:27 +0200)] 
Fake certificate version

According the RFC 5280: "When extensions are used, as expected in this profile,
version MUST be 3 (value is 2)". This patch sets the generated certificates
version to 3 when the subjectAltName extension copied from mimicking certificate.

14 years agoBug 3193: NTLM decoder truncating strings
Amos Jeffries [Fri, 23 Mar 2012 07:14:21 +0000 (01:14 -0600)] 
Bug 3193: NTLM decoder truncating strings

* Also ntlm_unpack_auth using reversed arguments for memcpy()
* Also improved packet structure debug display

14 years agocertificateMatchesProperties segfault
Christos Tsantilas [Wed, 21 Mar 2012 17:06:32 +0000 (19:06 +0200)] 
certificateMatchesProperties segfault

It is reported at least one case where squid crashed with segfault because the
signing certificate was NULL.

This patch:
  - Add assertion checks inside  buildSslCertGenerationParams and
    Ssl::certificateMatchesProperties functions (a)to avoid segfaults
  - In the case the signing certificate is not given in http_port configuration
    or the given certificate filename was not valid, squid does not start.
  - Creates the http_port_list::configureSslServerContext method and move
    here the cache_cf.cc code which was responsible to initialize ssl contexts
    and sslBump feature.

14 years agoTypo in sourcemaintenance.sh
Amos Jeffries [Mon, 19 Mar 2012 04:39:36 +0000 (22:39 -0600)] 
Typo in sourcemaintenance.sh

14 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 19 Mar 2012 00:19:24 +0000 (18:19 -0600)] 
SourceFormat Enforcement

14 years agoMaintenance: ensure stub_* files are always bundled
Amos Jeffries [Sun, 18 Mar 2012 01:41:17 +0000 (13:41 +1200)] 
Maintenance: ensure stub_* files are always bundled

Relying on dependency chains does not always work for stubs.
Builds automake list of files to bundle and add to EXTRA_DIST for
bundling.

14 years agoLanguage: pt_BR updates
Aecio F. [Fri, 16 Mar 2012 17:05:48 +0000 (06:05 +1300)] 
Language: pt_BR updates

14 years agoLanguage: pt_BR updates
Aecio F. [Fri, 16 Mar 2012 11:06:22 +0000 (00:06 +1300)] 
Language: pt_BR updates

14 years agoSolaris: definitions of AF_LOCAL and strsep()
Jose-Marcio Martins da Cruz [Fri, 16 Mar 2012 00:40:32 +0000 (18:40 -0600)] 
Solaris: definitions of AF_LOCAL and strsep()

14 years agoDist the Solaris krb5 patch
Amos Jeffries [Thu, 15 Mar 2012 13:46:10 +0000 (07:46 -0600)] 
Dist the Solaris krb5 patch

14 years agoPortability: define SUN_LEN() for Solaris
Alexander Lukyanov [Thu, 15 Mar 2012 12:36:35 +0000 (06:36 -0600)] 
Portability: define SUN_LEN() for Solaris

14 years agoHonor the "deny" part of "foobar deny ACL" options - Temporary patch BumpSslServerFirst.take07
Christos Tsantilas [Mon, 12 Mar 2012 18:15:44 +0000 (20:15 +0200)] 
Honor the "deny" part of "foobar deny ACL" options - Temporary patch

When AuthenticateAcl() and aclMatchExternal() were converted to use extended
authentication ACL states (r11644 and r11645 dated 2011-08-14), the result of
those function calls was set as the current checklist answer.  This was
incorrect because those functions do not make allow/deny decisions. They only
tell us whether the ACL part of the allow/deny rule matches. If there is a
match, the ACCESS_ALLOWED/ACCESS_DENIED answer depends on whether it is an
allow or deny rule.

For example, "http_access deny BadGuys" should deny access when the BadGuys
ACL matches, but it was allowing access instead.

14 years agoIntelligent handling of CONNECT denials
Christos Tsantilas [Mon, 12 Mar 2012 17:08:41 +0000 (19:08 +0200)] 
Intelligent handling of CONNECT denials

Without authentication, bump-server-first CONNECT requests allow uncontrolled
SSL handhsakes with origin servers, which is not desirable if the proxy operatordoes not want to allow users to access external resources anonymously.
Authenticating CONNECT requests is troublesome because when CONNECT
authentication fails, the proxy has difficulties communicating details of the
error to the browser, due to security vulnerabilities discussed at
  https://bugzilla.mozilla.org/show_bug.cgi?id=479880

This patch implements the following logic to allow for seamless authentication
of CONNECT requests in a bump-server-first setup:

    - Process http_access. Authenticate CONNECT request if needed, which may
      require several HTTP CONNECT exchanges. This should be already supported.

    - If access is allowed, use Connect-To-Server-First (for bumped connections)      or normal TCP tunneling (for regular connections). This should be already       supported.

    - If access is denied, check ssl_bump and delay the error (for bumped
      connections) or serve the error immediately (for regular connections).
      This needs work.

"Delaying the error" in this context means remembering the error, responding
with 200 Established, establishing a bumped secure connection with the client,
not connecting to the origin server at all, and serving the error to the client
when the first encapsulated request comes.

14 years agoLanguage: pt_BR updates
Fred [Fri, 9 Mar 2012 05:06:45 +0000 (18:06 +1300)] 
Language: pt_BR updates

14 years agoWindows: use Comm::Connection ICP sockets
Amos Jeffries [Fri, 9 Mar 2012 02:09:33 +0000 (19:09 -0700)] 
Windows: use Comm::Connection ICP sockets

14 years agoWindows: Use FD_ISSET() wrapper instead of __WSAFDIsSet()
Amos Jeffries [Fri, 9 Mar 2012 01:45:05 +0000 (18:45 -0700)] 
Windows: Use FD_ISSET() wrapper instead of __WSAFDIsSet()

This moves the Win32-specific select() module a lot closer to the
non-Windows select() module.

14 years agossl_crtd: undefined references to squid_curtime
Alex Rousskov [Thu, 8 Mar 2012 13:03:19 +0000 (06:03 -0700)] 
ssl_crtd: undefined references to squid_curtime

14 years agoBug 3439: correct external_acl_type documented default for ipv4/ipv6 option
Amos Jeffries [Thu, 8 Mar 2012 04:23:06 +0000 (21:23 -0700)] 
Bug 3439: correct external_acl_type documented default for ipv4/ipv6 option

14 years agoRemoved kludge added to test writeCertAndPrivateKeyToMemory() failure bypass. BumpSslServerFirst.take06
Alex Rousskov [Thu, 8 Mar 2012 04:02:40 +0000 (21:02 -0700)] 
Removed kludge added to test writeCertAndPrivateKeyToMemory() failure bypass.

14 years agoDo not assert if we fail to compose ssl_crtd request. Do blocking generation.
Alex Rousskov [Thu, 8 Mar 2012 01:50:04 +0000 (18:50 -0700)] 
Do not assert if we fail to compose ssl_crtd request. Do blocking generation.

Users report assertions when OpenSSL fails to write a true server certificate
to to memory. Since that certificate is received from a 3rd party, we should
not assert that it is writeable. Besides, OpenSSL may have limitations/bugs
even if dealing with valid certificates.

If we fail to componse a request, we now try the good old blocking in-process
certificate generation.

Currently, it is not known what exactly causes OpenSSL to fail as we are
unable to trigger the assertion in a controlled test.

14 years agoSourceFormat Enforcement
Automatic source maintenance [Thu, 8 Mar 2012 01:41:08 +0000 (18:41 -0700)] 
SourceFormat Enforcement

14 years agoMerged from trunk (r12082, v3.2.0.16+).
Alex Rousskov [Wed, 7 Mar 2012 23:33:53 +0000 (16:33 -0700)] 
Merged from trunk (r12082, v3.2.0.16+).

14 years agoBug 3397: do not mark connection as opened until after SYN-ACK
Amos Jeffries [Wed, 7 Mar 2012 22:54:00 +0000 (15:54 -0700)] 
Bug 3397: do not mark connection as opened until after SYN-ACK

assertion failed: comm.cc:1117: "isOpen(fd)" on FwdState destruct with
half-connected server. When the SYN was sent but ACK not yet received.

14 years agoBug 3509: kQueue compile error
Warren Baker [Wed, 7 Mar 2012 12:37:54 +0000 (05:37 -0700)] 
Bug 3509: kQueue compile error

14 years agoLanguage: pt_BR updates
Fred [Wed, 7 Mar 2012 05:07:40 +0000 (18:07 +1300)] 
Language: pt_BR updates

14 years agoBug 3458: Icon Serving (squid-internal-static) Broken
Alex Rousskov [Wed, 7 Mar 2012 02:32:24 +0000 (19:32 -0700)] 
Bug 3458: Icon Serving (squid-internal-static) Broken

14 years agoPrep for 3.2.0.16
Amos Jeffries [Wed, 7 Mar 2012 02:03:16 +0000 (19:03 -0700)] 
Prep for 3.2.0.16

14 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 7 Mar 2012 01:32:25 +0000 (18:32 -0700)] 
SourceFormat Enforcement

14 years agoBug 3420: Request body consumption races and theConsumer
Alex Rousskov [Wed, 7 Mar 2012 00:26:34 +0000 (17:26 -0700)] 
Bug 3420: Request body consumption races and theConsumer

14 years agoBug fix: ssl_crtd crashes when accessing HTTPS sites with a domain name exceeding...
Christos Tsantilas [Tue, 6 Mar 2012 20:38:31 +0000 (22:38 +0200)] 
Bug fix: ssl_crtd crashes when accessing HTTPS sites with a domain name exceeding 64 characters - Part 2

In the case of long domain and there is no CN to mimic set the CN to a wildcard
based on the long domain in the request if possible.

14 years agoCorrect DNS timeout handling.
Henrik Nordstrom [Mon, 5 Mar 2012 11:59:54 +0000 (12:59 +0100)] 
Correct DNS timeout handling.

The change to concurrent A & AAAA lookups did not handle timeouts
properly, resulting in segmentation faults.

The timeouts as such were also mismanaged, resulting in much longer
DNS timeouts than intended.

This also cleans up the API somewhat to use const for the result.

14 years agoDocument master/slave DNS query relation and search path processing
Henrik Nordstrom [Mon, 5 Mar 2012 11:36:38 +0000 (12:36 +0100)] 
Document master/slave DNS query relation and search path processing

14 years agoLanguage: fr updates
Bernard [Sun, 4 Mar 2012 23:12:44 +0000 (12:12 +1300)] 
Language: fr updates

14 years agoCorrect DNS timeout handling.
Henrik Nordstrom [Sun, 4 Mar 2012 22:24:58 +0000 (23:24 +0100)] 
Correct DNS timeout handling.

The change to concurrent A & AAAA lookups did not handle timeouts
properly, resulting in segmentation faults.

The timeouts as such were also mismanaged, resulting in much longer
DNS timeouts than intended.

This also cleans up the API somewhat to use const for the result.

14 years agoBreak out assignment from if clause to make code more readable (and gcc happier)
Henrik Nordstrom [Sun, 4 Mar 2012 18:50:13 +0000 (19:50 +0100)] 
Break out assignment from if clause to make code more readable (and gcc happier)

14 years agoLanguage: fr updates
Bernard [Sun, 4 Mar 2012 17:06:08 +0000 (06:06 +1300)] 
Language: fr updates

14 years agoBug 3457: Display TLS error details in ERR_SECURE_CONNECT_FAIL
Amos Jeffries [Sun, 4 Mar 2012 06:56:44 +0000 (23:56 -0700)] 
Bug 3457: Display TLS error details in ERR_SECURE_CONNECT_FAIL

14 years agopolish a little the latest "ssl_crtd crashes on long domain names" patch
Christos Tsantilas [Sat, 3 Mar 2012 06:30:56 +0000 (08:30 +0200)] 
polish a little the latest "ssl_crtd crashes on long domain names" patch

14 years agoBug fix: ssl_crtd crashes when accessing HTTPS sites with a domain name exceeding...
Christos Tsantilas [Sat, 3 Mar 2012 06:25:33 +0000 (08:25 +0200)] 
Bug fix: ssl_crtd crashes when accessing HTTPS sites with a domain name exceeding 64 characters

Squid tries to generate a certificate for long domain names, which is not
possible.
According to RFC 5280 (Section A.1), the common name length in a certificate
can be at most 64 characters. Therefore it is not possible to generate a valid
certificate with the above domain name as common name.
This patch does not allow use of common names longer than 64 bytes in
setCommonName adaptation algorithm. Also In the case the openssl fails to
read subject name from mimicking certificate does not set any subject to
generated certification. (currently ssl_crtd crashes).

14 years agoSimplify Ssl::ServerPeeker and renamed it to Ssl::ServerBump
Christos Tsantilas [Sat, 3 Mar 2012 06:19:04 +0000 (08:19 +0200)] 
Simplify Ssl::ServerPeeker and renamed it to Ssl::ServerBump

Currently, Ssl::ServerPeeker is a job that does virtually nothing and leaks on
SSL connection establishment errors. This patch convert this class convert this
class into a non-job class which ConnStateData use to maintain SSL
certificate peeking state.
The Ssl::ServerPeeker class renamed  to Ssl::ServerBump.
ConnStateData::bumpErrorEntry and ConnStateData::bumpSslErrorNoList and
ConnStateData::bumpServerCert now are members to the this class.

14 years agoBug 3503: DNS PTR queries timeout due to wrong QIDs.
Alex Rousskov [Fri, 2 Mar 2012 17:33:04 +0000 (10:33 -0700)] 
Bug 3503: DNS PTR queries timeout due to wrong QIDs.

Supply query ID (rather than zero) to rfc3596BuildPTRQuery*() calls.

This code was broken since trunk r11015 "Fixed DNS query leaks and increased
defense against DNS cache poisoning" dated 2010-11-03.

14 years agoPolish parse_address bracketing
Amos Jeffries [Fri, 2 Mar 2012 03:20:08 +0000 (20:20 -0700)] 
Polish parse_address bracketing

14 years agoRegression: snmp/udp address directives not resolving hostname
Amos Jeffries [Fri, 2 Mar 2012 02:02:45 +0000 (19:02 -0700)] 
Regression: snmp/udp address directives not resolving hostname

14 years agoBug fix: The '%I' formating code in error page shows '[unknown]' in the case of SQUID...
Christos Tsantilas [Wed, 29 Feb 2012 21:16:06 +0000 (23:16 +0200)] 
Bug fix: The '%I' formating code in error page shows '[unknown]' in the case of SQUID_X509_V_ERR_DOMAIN_MISMATCH error

Update the server ip address and server hostname in HttpRequest::hier object
in the case of SQUID_X509_V_ERR_DOMAIN_MISMATCH error to be used for %I field
of the generated error page

14 years agoBug fix: Current serial number generation code does not produce a stable serial numbe...
Christos Tsantilas [Wed, 29 Feb 2012 21:12:18 +0000 (23:12 +0200)] 
Bug fix: Current serial number generation code does not produce a stable serial number for self-signed certificates

Squid always send the signing certificate to the ssl_crtd daemon even for
self-signed certificates because the signing certificate may used for cert
adaptation algorithms. The ssl_crtd currently ignore the signing certificate
in the case of self-signed certificates. This is has as result to
use a random number as serial number of generated certificate.

This patch also use 0 as serial number of the temporary intermediate certificate
used to generate the final serial number of the certificate, in the case of
signing certificate is not given.

14 years agoBetter helper-to-Squid buffer size management.
Alex Rousskov [Wed, 29 Feb 2012 06:32:14 +0000 (23:32 -0700)] 
Better helper-to-Squid buffer size management.

The minimum buffer size is reduced from 8KB to 4KB after a squid-dev
discussion to prevent wasting of "several hundred KB of unused permanent
memory on some installations".

We now increase the buffer if we cannot parse the helper response message.

The maximum buffer size is now 32KB. This should be enough for all known
helper responses.

We now warn if the read buffer reaches its capacity and kill the offending
helper explicitly. An increase in maximum buffer capacity to 32KB should make
such events rare.

Motivation: ssl_crtd helper may produce responses exceeding 9907 bytes in size
(and possibly much larger if multiple chained certificates need to be returned
to Squid). The old helper.cc code would fill the read buffer completely,
schedule a read for zero bytes, receive zero bytes, declare an EOF condition,
and close the stream (which kills ssl_crtd).  Due to insufficient information
logged, the observable symptoms were pretty much the same as if ssl_crtd
closed the stream first, indicating a ssl_crtd bug.

14 years agoBug 3458: Icon Serving (squid-internal-static) Broken. BumpSslServerFirst.take05
Alex Rousskov [Wed, 29 Feb 2012 00:42:21 +0000 (17:42 -0700)] 
Bug 3458: Icon Serving (squid-internal-static) Broken.

The "trimMemory for unswappable objects" fix (trunk r11969,r11970) exposed
ENTRY_SPECIAL objects such as icons to memory trimming which they cannot
handle because Squid does not reload the missing parts of special objects.

Further testing showed that a special object may be cached in shared RAM
and/or might even be purged from all caches completely. This may explain why
icons eventually "disappear" in some environments.

We now treat special objects as not belonging to memory or disk Stores and do
not ask those Stores to manage them. This separation needs more work, but it
passes basic tests, and it is the right step towards creating a proper storage
dedicated to those objects.

14 years agoBetter helper-to-Squid buffer size management.
Alex Rousskov [Tue, 28 Feb 2012 23:45:23 +0000 (16:45 -0700)] 
Better helper-to-Squid buffer size management.

The minimum buffer size is reduced from 8KB to 4KB after a squid-dev
discussion to prevent wasting of "several hundred KB of unused permanent
memory on some installations".

We now increase the buffer if we cannot parse the helper response message.

The maximum buffer size is now 32KB. This should be enough for all known
helper responses.

We now warn if the read buffer reaches its capacity and kill the offending
helper explicitly. An increase in maximum buffer capacity to 32KB should make
such events rare.

Motivation: ssl_crtd helper may produce responses exceeding 9907 bytes in size
(and possibly much larger if multiple chained certificates need to be returned
to Squid). The old helper.cc code would fill the read buffer completely,
schedule a read for zero bytes, receive zero bytes, declare an EOF condition,
and close the stream (which kills ssl_crtd).  Due to insufficient information
logged, the observable symptoms were pretty much the same as if ssl_crtd
closed the stream first, indicating a ssl_crtd bug.

14 years agoLanguage: hu updates
Gergely [Tue, 28 Feb 2012 23:12:47 +0000 (12:12 +1300)] 
Language: hu updates

14 years agoMerged from trunk (r12065, v3.2.0.15+).
Alex Rousskov [Tue, 28 Feb 2012 22:05:25 +0000 (15:05 -0700)] 
Merged from trunk (r12065, v3.2.0.15+).

14 years agoRemoved changes causing ssl_bump to deny requests instead of denying bumping.
Alex Rousskov [Tue, 28 Feb 2012 21:50:57 +0000 (14:50 -0700)] 
Removed changes causing ssl_bump to deny requests instead of denying bumping.

See Squid bug 3444 discussion.

14 years agoBug 3502: client timeout uses server-side read_timeout, not request_timeout
HONDA Hirofumi [Tue, 28 Feb 2012 17:52:21 +0000 (10:52 -0700)] 
Bug 3502: client timeout uses server-side read_timeout, not request_timeout

I have also adjusted request_timeout description in squid.conf to clarify that
request_timeout applies to receiving complete HTTP request headers and not
just the first header byte. We reset the connection timeout to
clientLifetimeTimeout after parsing request headers.

https_port was correctly using Config.Timeout.request already.

14 years agoLanguage: hu updates
Gergely [Tue, 28 Feb 2012 11:06:07 +0000 (00:06 +1300)] 
Language: hu updates

14 years agoMade idnsSendSlaveAAAAQuery() debug label differ from that of idnsALookup().
Alex Rousskov [Tue, 28 Feb 2012 01:34:35 +0000 (18:34 -0700)] 
Made idnsSendSlaveAAAAQuery() debug label differ from that of idnsALookup().

14 years agoBug 3497: Bad ssl_crtd db size file causes infinite loop.
Alex Rousskov [Tue, 28 Feb 2012 00:30:47 +0000 (17:30 -0700)] 
Bug 3497: Bad ssl_crtd db size file causes infinite loop.

The db size file may become empty when Squid runs out of disk space. Ignoring
db size reading errors led to bogus db sizes used as looping condition. This
fix honors reading errors and also terminates the loop when no more
certificates can be removed. Both errors and removal failure are fatal to
ssl_crtd.

A positive side-effect of this fix is one less call to the relatively
expensive file-reading size()/readSize() methods under normal conditions.

I also removed "minimum db size" check because it did not seem to be in sync
with other ssl_crtd parameters such as fs block size and because its overall
purpose was unclear. The check was also removed by the original bug reporter.

TODO: Remaining problems include: ssl_crtd should not exit just because it
cannot write something to disk. A proper reporting/debugging API is missing.

Same as trunk r12062.

14 years agoBug 3497: Bad ssl_crtd db size file causes infinite loop.
Guy Helmer [Tue, 28 Feb 2012 00:22:38 +0000 (17:22 -0700)] 
Bug 3497: Bad ssl_crtd db size file causes infinite loop.

The db size file may become empty when Squid runs out of disk space. Ignoring
db size reading errors led to bogus db sizes used as looping condition. This
fix honors reading errors and also terminates the loop when no more
certificates can be removed. Both errors and removal failure are fatal to
ssl_crtd.

A positive side-effect of this fix is one less call to the relatively
expensive file-reading size()/readSize() methods under normal conditions.

I also removed "minimum db size" check because it did not seem to be in sync
with other ssl_crtd parameters such as fs block size and because its overall
purpose was unclear. The check was also removed by the original bug reporter.

TODO: Remaining problems include: ssl_crtd should not exit just because it
cannot write something to disk. A proper reporting/debugging API is missing.

14 years agoWhen there is an error and we know the intended server name from CONNECT
Christos Tsantilas [Mon, 27 Feb 2012 17:17:09 +0000 (19:17 +0200)] 
When there is an error and we know the intended server name from CONNECT
request, we should use that name for the CN in the fake certificate instead
of mimicking the received true server certificate CN.

14 years agoLog '-' on requests with no Referer or User-Agent headers
Amos Jeffries [Mon, 27 Feb 2012 10:03:03 +0000 (03:03 -0700)] 
Log '-' on requests with no Referer or User-Agent headers

This data is actually meaningful for the analysis of client behaviour.

squid-dev have agreed that it is worth removing the old log behaviour of
omitting these entries.

14 years agoBug 3490: Crash writing Apache Common logs
Amos Jeffries [Mon, 27 Feb 2012 09:57:02 +0000 (02:57 -0700)] 
Bug 3490: Crash writing Apache Common logs

14 years agoLanguage: hu updates
Gergely [Sun, 26 Feb 2012 11:05:56 +0000 (00:05 +1300)] 
Language: hu updates

14 years agoLanguage: hu updates
Gergely [Sun, 26 Feb 2012 05:05:39 +0000 (18:05 +1300)] 
Language: hu updates

14 years agoLanguage: hu updates
Gergely [Sat, 25 Feb 2012 23:06:00 +0000 (12:06 +1300)] 
Language: hu updates

14 years agoFixed comment: We mimic alias even when using a configured CN.
Alex Rousskov [Sat, 25 Feb 2012 19:29:46 +0000 (12:29 -0700)] 
Fixed comment: We mimic alias even when using a configured CN.

14 years agoLanguage: hu updates
Gergely [Sat, 25 Feb 2012 17:05:50 +0000 (06:05 +1300)] 
Language: hu updates

14 years agoMark requests on re-pinned connections to avoid them being pconnPush()ed
Alex Rousskov [Sat, 25 Feb 2012 16:44:36 +0000 (09:44 -0700)] 
Mark requests on re-pinned connections to avoid them being pconnPush()ed
causing "fd_table[conn->fd].halfClosedReader != NULL" comm assertions later.

Forward.cc comments imply that request->flags.pinned is set by ConnStateData
but that is a lie. The flag is set by forward.cc itself. It was set for PINNED
peers having a valid pinned connection only. When we retry a pinned pconn
race, we still have a PINNED peer but the failed connection prevents us from
setting the flag. If we successfuly re-pin later, we must set the flag.

request->flags.pinned essentially means "the connection is or should be
pinned".

14 years agoSsl::ServerPeeker must become a store_client to prevent [error] entry trimming
Alex Rousskov [Fri, 24 Feb 2012 22:29:40 +0000 (15:29 -0700)] 
Ssl::ServerPeeker must become a store_client to prevent [error] entry trimming

We do not need a store client during the certificate peeking stage because we
do not send the error to the client and only accumulate what is being written
to the store. However, if there is no store client then Store will trim the
entry and we will hit a

  store_client.cc:198: "entry->swap_filen > -1 || entry->swappingOut()"

assertion when we finally try to use it to serve the error response.

14 years agoclientReplyContext::setReplyToStoreEntry() must lock the entry
Alex Rousskov [Fri, 24 Feb 2012 22:28:33 +0000 (15:28 -0700)] 
clientReplyContext::setReplyToStoreEntry() must lock the entry

because clientReplyContext destructors always unlocks it via
removeClientStoreReference().