]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
13 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.

13 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().

13 years agoConnStateData::bumpSslErrorNoList define only when SSL is enabled
Christos Tsantilas [Fri, 24 Feb 2012 19:41:15 +0000 (21:41 +0200)] 
ConnStateData::bumpSslErrorNoList define only when SSL is enabled

13 years agoRemoved IFDEF macro debugging.
Alex Rousskov [Fri, 24 Feb 2012 18:47:57 +0000 (11:47 -0700)] 
Removed IFDEF macro debugging.

13 years agoMerge from trunk
Christos Tsantilas [Fri, 24 Feb 2012 13:17:24 +0000 (15:17 +0200)] 
Merge from trunk

13 years agoAssert that the serial number for generated certificates
Christos Tsantilas [Fri, 24 Feb 2012 09:20:19 +0000 (11:20 +0200)] 
Assert that the serial number for generated certificates
does not exceed 20 bytes

13 years agoLanguage: fr updates
Bernard [Thu, 23 Feb 2012 23:06:10 +0000 (12:06 +1300)] 
Language: fr updates

13 years agoBug fix: setCommonName and alternative names
Christos Tsantilas [Thu, 23 Feb 2012 19:51:38 +0000 (21:51 +0200)] 
Bug fix: setCommonName and alternative names

setCommonName sets CN, but that is not enough when the fake certificate containsalternative names (which Squid mimics): The browser does not accept the
resulting fake certificate because it does not contains at least one alternativename that matches the domain name.

This patch stop mimicking of "Certificate Subject Alt Name" extensions when the
setCommonName adaptation algorithm used

13 years agoCertificate for error messages
Christos Tsantilas [Thu, 23 Feb 2012 19:48:07 +0000 (21:48 +0200)] 
Certificate for error messages

If a certificate verification error is honored by Squid (i.e., a Squid error
page is returned to the user), the user gets a browser warning and then, after
ignoring the warning, the squid error message (about the same kind of problem). This happens because the fake certificate mimics details of the true server
certificate, which is "broken".

When Squid serves its own error page it is no longer trying to hide its presencefrom the user. Thus, it is probably better to serve all Squid-generated SSL
handshake and validation error responses with a trusted certificate containing
minimal details, like we already do for the DNS_FAIL errors.

This patch fixing the above problem.

NOTE: The fix will not work for domain mismatch errors. We are checking
for domain mismatch after we have establish the SSL connection with the web
client , and after we got the http request, because we need the HTTP request
Host header to check for SSL domain mismatch errors.

13 years agostable certificates part3
Christos Tsantilas [Wed, 22 Feb 2012 14:03:43 +0000 (16:03 +0200)] 
stable certificates part3

 - Handle the case the signing certificate changed. The ssl_crtd daemon
   must drop cached certificates which has signed with older signing
   certificates and generate new one using the current signing certificate

 - We need to generate certificates with different serial numbers, if the
   signing certificate has changes in any way, even if the certificates has
   exactly the same fields.
   To achieve this we are firstly generating a temporary fake certificate with
   serial number the hash digest of signing certificates public key. The digest
   of the temporary fake certificate used as serial key to the final certificate

 - Bug fix: A cached certificate which has adaptated with one or more algorithms
   (setNotAfter, setNotBefore, setCommonName etc) did not used and always a new
   certificate generated. This patch fixes this bug.

Notes:
  - Ssl::ssl_match_certificates replaced with Ssl::certificateMatchesProperties
    function which checks if a given certificate matches given properties:
    Checks if the certificate signed with current signing certificate, and
    check if mimicked certificate matches the given certificate.
  - The Ssl::CertificateDb::purgeCert method added to delete a certificate from
    database.

13 years agostable certificates part2
Christos Tsantilas [Tue, 21 Feb 2012 17:25:53 +0000 (19:25 +0200)] 
stable certificates part2

Two different certificates of the same fake Issuer must have the same serial
number. Otherwise, Firefox and possibly others will display a
sec_error_reused_issuer_and_serial error. Similarly, the same two certificates
should have the same serial number, even if generated on different
non-communicating (but identically configured) Squid boxes.

To produce unique serial numbers a temporary fake certificate with serial number
zero created, and its fingerprint used as the serial number of the final fake
certificate.

The old Ssl::CertificateDb code which was responsible to produce a serial number
for generated certificates removed.

13 years agoBug fix: sslpassword_program for ssl-bump http ports
Christos Tsantilas [Tue, 21 Feb 2012 16:49:23 +0000 (18:49 +0200)] 
Bug fix: sslpassword_program for ssl-bump http ports

Currently the sslpassword_program configuration parameter does not work
for encrypted certificate keys on ssl-bump enabled http ports, and user
always asked to give the SSL key password.

This patch fixes this problem.

This is a Measurement Factory project.

13 years agoFix IPv6 site-local IP detection
Amos Jeffries [Tue, 21 Feb 2012 09:59:51 +0000 (22:59 +1300)] 
Fix IPv6 site-local IP detection

RFC 4193 the site-local allocated range is fc00::/7.

Squid has been using IN6_IS_ADDR_SITELOCAL() but it turns out Linux and
OpenBSD at least still define that to test for the long obsolete fec0::/10.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 21 Feb 2012 02:00:15 +0000 (19:00 -0700)] 
SourceFormat Enforcement

13 years agoFixed Ssl::CrtdMessage::parseRequest(properties, error) profile
Alex Rousskov [Mon, 20 Feb 2012 21:40:59 +0000 (14:40 -0700)] 
Fixed Ssl::CrtdMessage::parseRequest(properties, error) profile
to allow this method to return error texts using its second argument.

Polished error formatting.

13 years agoUse broken instead of a peer certificate info for error detail formatting.
Alex Rousskov [Mon, 20 Feb 2012 21:05:28 +0000 (14:05 -0700)] 
Use broken instead of a peer certificate info for error detail formatting.

This change has no visible effect when the peer certificate is a broken one.

Eventually, we may have to add more formatting codes to give admin access to
both peer and broken certificate details, but it may be difficult to use such
two sets of formatting codes on one static error page that does not "know"
whether the peer certificate is broken.

13 years agoRetry requests that failed due to a persistent connection race
Alex Rousskov [Mon, 20 Feb 2012 19:32:58 +0000 (12:32 -0700)] 
Retry requests that failed due to a persistent connection race
instead of replying with ERR_ZERO_SIZE_OBJECT "Bad Gateway".

Trunk r12050 code contains a portion of these changes. The rest is code
to re-pin a bump-server-first connection if a bumped pinned pconn fails
due to a race. We use a new canRePin flag to mark connections that can
be repinned and assume that pinned connections unrelated to SslBump
cannot be repinned.

13 years agoRetry requests that failed due to a persistent connection race
Alex Rousskov [Mon, 20 Feb 2012 19:10:54 +0000 (12:10 -0700)] 
Retry requests that failed due to a persistent connection race
instead of replying with ERR_ZERO_SIZE_OBJECT "Bad Gateway".

The ERR_ZERO_SIZE_OBJECT errors were visible to the client when the
destination had only one address because serverDestinations.shift()
made the list of destination empty and startConnectionOrFail() failed.

When FwdState starts to use a pinned connection, the connection is treated as
an idle persistent connection as far as race detection is concerned.
Currently, pinned connections cannot be reopened, repinned, and retried after
a pconn race. This will change when server-side bumped connections become
pinned.

It felt wrong that a failed serverConn may remain set while we are opening a
new connection so I set it to NULL after a squid-dev discussion indicating
that doing so should be safe.

We also now reset the local port number to zero in case it was set to the
actual source port by ConnOpener or other code working with the previous
connection to the same serverDestinations[0] address, although simple tests
worked (and showed changing source port) without this reset.

13 years agoBug fix: sslpassword_program for ssl-bump http ports
Christos Tsantilas [Mon, 20 Feb 2012 18:07:29 +0000 (20:07 +0200)] 
Bug fix: sslpassword_program for ssl-bump http ports

Currently the sslpassword_program configuration parameter does not work
for encrypted certificate keys on ssl-bump enabled http ports, and user
always asked to give the SSL key password.

This patch fixes this problem.

This is a Measurement Factory project.

13 years agoBug 3490: Crash writing Referer/Username logs
Amos Jeffries [Mon, 20 Feb 2012 08:56:41 +0000 (01:56 -0700)] 
Bug 3490: Crash writing Referer/Username logs

13 years agoRFC 2518 obsoleted by RFC 4918
Amos Jeffries [Sat, 18 Feb 2012 02:03:38 +0000 (19:03 -0700)] 
RFC 2518 obsoleted by RFC 4918

13 years agoSupport CoAP-over-HTTP
Amos Jeffries [Fri, 17 Feb 2012 09:01:51 +0000 (02:01 -0700)] 
Support CoAP-over-HTTP

Make Squid happy with HTTP requests using coap:// and coaps:// URI.

No gateway or other interaction with CoAP is enabled by this patch.

13 years agostable certificates part1
Christos Tsantilas [Thu, 16 Feb 2012 20:00:16 +0000 (22:00 +0200)] 
stable certificates part1

Changes to make fake certificates "stable" and "unique".

This patch modify bump-server-first branch to:

- use configured trusted CA private key for generating all fake certificates,
 including trusted, untrusted, and self-signed fake certificates.

- use untrusted CA certificate which be deterministically derived from
 the trusted CA certificate to both reduce configuration effort (compared to
 a configuration option) and to generate identical untrusted CA certificates
 given identical Squid configurations.

13 years agoBug 3324: loadFromFile: parse error while reading template file
Alex Rousskov [Thu, 16 Feb 2012 04:23:15 +0000 (21:23 -0700)] 
Bug 3324: loadFromFile: parse error while reading template file

Do not store and later use a pointer to a temporary String buffer.
HttpHeader::getByName() returns a temporary String.

13 years agoTranslation: add basic_getpwnam_auth manual
Amos Jeffries [Tue, 14 Feb 2012 05:26:50 +0000 (18:26 +1300)] 
Translation: add basic_getpwnam_auth manual

13 years agoDrop redundant fde.h include
Amos Jeffries [Tue, 14 Feb 2012 05:20:16 +0000 (18:20 +1300)] 
Drop redundant fde.h include

13 years agoFix CommIO missing includes
Amos Jeffries [Sun, 12 Feb 2012 13:15:51 +0000 (06:15 -0700)] 
Fix CommIO missing includes

13 years agoDrop old keep-alive hack for Netscape
Amos Jeffries [Fri, 10 Feb 2012 03:30:02 +0000 (20:30 -0700)] 
Drop old keep-alive hack for Netscape

13 years agoDo not cache partially loaded entries in shared mem cache (and then serve them)
Alex Rousskov [Fri, 10 Feb 2012 00:32:44 +0000 (17:32 -0700)] 
Do not cache partially loaded entries in shared mem cache (and then serve them)

When handling a conditional request, Squid may load the beginning of a cached
object from disk, realize that the client has the same fresh copy, and respond
with 304 Not Modified. After that, Squid was checking whether the partially
loaded object should be kept in shared memory cache (if enabled). There were
no checks preventing memory caching of the partially loaded object.

Later, partially cached objects were served to clients, resulting in truncated
responses. I believe this happens because shared memory cache does not keep
all the StoreEntry data (just like a disk cache does not do that) so the fact
that only a part of the object was available was lost.

13 years agoDo not swap out swapped out objects.
Alex Rousskov [Fri, 10 Feb 2012 00:01:17 +0000 (17:01 -0700)] 
Do not swap out swapped out objects.

I noticed that sometimes Squid would start swapping out an entry that was
recently loaded from disk and was still on disk. That wastes disk
resources (at best).

The old StoreEntry::mayStartSwapOut() code assumed that when swap_status is
not SWAPOUT_NONE it is SWAPOUT_WRITING, but SWAPOUT_WRITING is impossible
after recent StoreEntry::swapOut() modifications because mayStartSwapOut() is
only called when we are not swappingOut() already. SWAPOUT_DONE is possible.

13 years agoDrop dead code in reply parsing
Amos Jeffries [Thu, 9 Feb 2012 13:27:51 +0000 (06:27 -0700)] 
Drop dead code in reply parsing

This code has not been used/needed in some time. It can die.

It is also no clear why it existed in the first place. The RFC is not
mentioned by number and RFC 2068/2616 only talk about tolerance for
whitespace before request lines, not replies.

13 years agoBug 3490: part 1: SegFault opening FTP active data connections
Amos Jeffries [Wed, 8 Feb 2012 22:55:23 +0000 (11:55 +1300)] 
Bug 3490: part 1: SegFault opening FTP active data connections

13 years agoLanguage: zh_TW updates
Anonymous Pootle User [Mon, 6 Feb 2012 17:13:38 +0000 (06:13 +1300)] 
Language: zh_TW updates

13 years agoLanguage: zh_CN updates
Anonymous Pootle User [Mon, 6 Feb 2012 17:12:01 +0000 (06:12 +1300)] 
Language: zh_CN updates

13 years agoLanguage: uk updates
Anonymous Pootle User [Mon, 6 Feb 2012 17:10:31 +0000 (06:10 +1300)] 
Language: uk updates

13 years agoLanguage: tr updates
Anonymous Pootle User [Mon, 6 Feb 2012 17:08:53 +0000 (06:08 +1300)] 
Language: tr updates

13 years agoLanguage: sv updates
Anonymous Pootle User [Mon, 6 Feb 2012 17:07:14 +0000 (06:07 +1300)] 
Language: sv updates

13 years agoLanguage: sr_LT updates
Bratislav [Mon, 6 Feb 2012 17:05:52 +0000 (06:05 +1300)] 
Language: sr_LT updates

13 years agoLanguage: sl updates
Aleksa [Mon, 6 Feb 2012 11:57:57 +0000 (00:57 +1300)] 
Language: sl updates

13 years agoLanguage: sk updates
helix84 [Mon, 6 Feb 2012 11:56:50 +0000 (00:56 +1300)] 
Language: sk updates

13 years agoLanguage: ru updates
Amos [Mon, 6 Feb 2012 11:55:20 +0000 (00:55 +1300)] 
Language: ru updates

13 years agoLanguage: ro updates
Arthur [Mon, 6 Feb 2012 11:53:56 +0000 (00:53 +1300)] 
Language: ro updates

13 years agoLanguage: pt updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:52:36 +0000 (00:52 +1300)] 
Language: pt updates

13 years agoLanguage: pt_BR updates
Amos [Mon, 6 Feb 2012 11:51:11 +0000 (00:51 +1300)] 
Language: pt_BR updates

13 years agoLanguage: pl updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:49:50 +0000 (00:49 +1300)] 
Language: pl updates

13 years agoLanguage: nl updates
Amos [Mon, 6 Feb 2012 11:48:35 +0000 (00:48 +1300)] 
Language: nl updates

13 years agoLanguage: lt updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:47:21 +0000 (00:47 +1300)] 
Language: lt updates

13 years agoLanguage: ko updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:45:24 +0000 (00:45 +1300)] 
Language: ko updates

13 years agoLanguage: ja updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:43:59 +0000 (00:43 +1300)] 
Language: ja updates

13 years agoLanguage: it updates
Francesco [Mon, 6 Feb 2012 11:42:23 +0000 (00:42 +1300)] 
Language: it updates

13 years agoLanguage: hy updates
Arthur [Mon, 6 Feb 2012 11:40:54 +0000 (00:40 +1300)] 
Language: hy updates

13 years agoLanguage: hu updates
Amos [Mon, 6 Feb 2012 11:39:28 +0000 (00:39 +1300)] 
Language: hu updates

13 years agoLanguage: he updates
Administrator [Mon, 6 Feb 2012 11:37:42 +0000 (00:37 +1300)] 
Language: he updates

13 years agoLanguage: fr updates
Bernard [Mon, 6 Feb 2012 11:36:07 +0000 (00:36 +1300)] 
Language: fr updates

13 years agoLanguage: fi updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:34:45 +0000 (00:34 +1300)] 
Language: fi updates

13 years agoLanguage: et updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:33:22 +0000 (00:33 +1300)] 
Language: et updates

13 years agoLanguage: es updates
Amos [Mon, 6 Feb 2012 11:32:00 +0000 (00:32 +1300)] 
Language: es updates

13 years agoLanguage: en updates
Amos [Mon, 6 Feb 2012 11:29:58 +0000 (00:29 +1300)] 
Language: en updates

13 years agoLanguage: el updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:27:07 +0000 (00:27 +1300)] 
Language: el updates

13 years agoLanguage: de updates
Robert [Mon, 6 Feb 2012 11:25:39 +0000 (00:25 +1300)] 
Language: de updates

13 years agoLanguage: da updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:23:50 +0000 (00:23 +1300)] 
Language: da updates

13 years agoLanguage: cs updates
Amos [Mon, 6 Feb 2012 11:22:19 +0000 (00:22 +1300)] 
Language: cs updates

13 years agoLanguage: ca updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:21:00 +0000 (00:21 +1300)] 
Language: ca updates

13 years agoLanguage: bg updates
Evgeni [Mon, 6 Feb 2012 11:19:46 +0000 (00:19 +1300)] 
Language: bg updates

13 years agoLanguage: az updates
Anonymous Pootle User [Mon, 6 Feb 2012 11:18:42 +0000 (00:18 +1300)] 
Language: az updates

13 years agoLanguage: en updates
Amos [Mon, 6 Feb 2012 11:17:18 +0000 (00:17 +1300)] 
Language: en updates

13 years agoLanguage: en updates
Amos [Mon, 6 Feb 2012 11:15:52 +0000 (00:15 +1300)] 
Language: en updates

13 years agoTranslation POT update
Amos Jeffries [Mon, 6 Feb 2012 05:46:00 +0000 (18:46 +1300)] 
Translation POT update

13 years agoAdd debugs for NTLM domain decode errors
Amos Jeffries [Mon, 6 Feb 2012 05:36:30 +0000 (18:36 +1300)] 
Add debugs for NTLM domain decode errors

13 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 6 Feb 2012 01:21:18 +0000 (18:21 -0700)] 
SourceFormat Enforcement

13 years agoSourceLayout: shuffle CommIO into DiskThreads library
Amos Jeffries [Mon, 6 Feb 2012 01:01:23 +0000 (18:01 -0700)] 
SourceLayout: shuffle CommIO into DiskThreads library

While investigating the Windows port problems it became clear that the
CommIO object is not actually related to the rest of comm systems. It is
instead a dedicated higher level disk I/O pipe manager for DiskThreads.

Given that it causes build errors in comm.cc on Windows and does not
even need to be there this patch shuffles it into the DiskThreads
library. The build issues on Windows still exist but are now limited to
just that threads library and can be avoided temporarily with simple
./configure options.

13 years agoForward bumped server connection-close signal to the bumped client.
Alex Rousskov [Sun, 5 Feb 2012 22:27:05 +0000 (15:27 -0700)] 
Forward bumped server connection-close signal to the bumped client.

Technically, the two connections can be maintained independently, but since we
are pretending to be a dumb tunnel to the origin server, it is useful to have
the client close when the server does because it reduces both the number of
persistent connection races (zero replies on the server side that force us to
re-connect and re-forward the failed request) and the possibility that we will
reconnect to the wrong HTTPS server without client knowing.

13 years agoUse peer certificate to set the requested host name on failures.
Alex Rousskov [Sun, 5 Feb 2012 21:55:51 +0000 (14:55 -0700)] 
Use peer certificate to set the requested host name on failures.

Even if an intermediate certificate fails, the "which URL failed" information
on the error report should be based on the server certificate CN. Intermediate
certificate CN may not even be a host name.

13 years agoPrep for 3.1.19 and 3.2.0.15
Amos Jeffries [Sun, 5 Feb 2012 11:27:18 +0000 (04:27 -0700)] 
Prep for 3.1.19 and 3.2.0.15

13 years agoSilence messages about MGR_INDEX when not installed
Amos Jeffries [Sun, 5 Feb 2012 11:24:07 +0000 (04:24 -0700)] 
Silence messages about MGR_INDEX when not installed

13 years agoBug 3441: part 2: Prevent further cache size corruption of swap.state
Alex Rousskov [Sun, 5 Feb 2012 07:29:09 +0000 (00:29 -0700)] 
Bug 3441: part 2: Prevent further cache size corruption of swap.state

13 years agoFixed Ssl::CertificateProperties::dbKey() to always reset the accumulation buf.
Alex Rousskov [Fri, 3 Feb 2012 23:48:48 +0000 (16:48 -0700)] 
Fixed Ssl::CertificateProperties::dbKey() to always reset the accumulation buf.

Also use append instead of assignment, just in case the assignment operator
frees previously reserve()d memory.

13 years agoFixed debugging line: "<<" has higher precedence than "?:".
Alex Rousskov [Fri, 3 Feb 2012 23:45:11 +0000 (16:45 -0700)] 
Fixed debugging line: "<<" has higher precedence than "?:".

13 years agoFixed debugging line: "<<" has higher precedence than "?:".
Alex Rousskov [Fri, 3 Feb 2012 23:34:03 +0000 (16:34 -0700)] 
Fixed debugging line: "<<" has higher precedence than "?:".

13 years agoFixed GCC v4.1.2 "converting to non-pointer type bool from NULL" warning.
Alex Rousskov [Fri, 3 Feb 2012 22:47:56 +0000 (15:47 -0700)] 
Fixed GCC v4.1.2 "converting to non-pointer type bool from NULL" warning.

13 years agoPolice ssl_crtd generating/parsing request code
Christos Tsantilas [Fri, 3 Feb 2012 18:44:57 +0000 (20:44 +0200)] 
Police ssl_crtd generating/parsing request code

This patch:

Add the following methods:
- Ssl::CrtdMessage::parseRequest: Parse a ssl_crtd "new certificate" request and
  store the requested certificate properties to a CertificateProperties object

- Ssl::CrtdMessage::composeRequest: Generate a "new certificate" ssl_crtd
  request using the certificate properties given by a CertificateProperties
  object

- Ssl::CertificateProperties::dbKey:  Return a valid key for the generated
  certificate to be used with a (memory or disk) database, based on its
  properties

Others:
- The ssl_crtd.cc code simplified using the above methods
- The ConnStateData::buildSslCertGenerationParams and ConnStateData::getSslContextStart
  simplified using the above methods

13 years agoDisable persistent connections after client-side-detected errors.
Alex Rousskov [Fri, 3 Feb 2012 18:01:27 +0000 (11:01 -0700)] 
Disable persistent connections after client-side-detected errors.

HTTP does not require to close the connection after most errors, but some
client-side-detected errors (those detected by clientProcessRequest) are about
HTTP message framing and should result in connection closure. For other
client-side-detected errors (those detected in serveDelayedError), the
client-side code is just not ready to handle persistency well:

* If we leave flags.readMore as true, then a new request on the same
  connection may find bumpErrorEntry set and think there is a delayed error
  that needs to be served, but that StoreEntry object has been already used.
  And we should not simply clear bumpErrorEntry because it is not locked by
  the error writing code using it. There may be other problems as well (and it
  is likely the connection is not usable anyway because the fake certificate
  was rejected by the client).

* If we set flags.readMore to false then we will not resume reading after
  serving the error, causing "abandoning such and such connection" errors
  and stuck ConnStateData jobs.

Thus, in summary, we should set flags.readMore to false and, if we do that, we
should also set proxy_keepalive to zero so that we close the connection after
serving the error to the client.

13 years agoBug 3478: pt1: Host verify catching dynamic CDN hosted sites
Amos Jeffries [Fri, 3 Feb 2012 04:07:36 +0000 (21:07 -0700)] 
Bug 3478: pt1: Host verify catching dynamic CDN hosted sites

This add a bit more leniency to the Host: header validation without
re-opening Squid to the cache poisoning risks involved.Resolving most
issues with websites using geo-based DNS results and/or short DNS TTL for
load balancing.

It alters host_verify_strict directive to allow requests which fail Host:
validation to continue through processing. The default remains OFF.

* blocks caching on the response to protect all other network clients
  against one compromised client spreading infections.

* forces the original (untrusted) destination IP to be used instead of
  any alternative Squid might find. Preventing Squid or peer DNS lookup
  being the point of vulnerability for the same-origin bypass. For any
  client to be vulnerable it must be vulnerable inside the browser agent
  where the original TCP connection is established.

Also add a new error template ERR_CONFLICT_HOST to replace the confusing
"invalid request" message with a clear explanation of the problem and
some client workarounds.

FUTURE WORK:
* adapt processing to allow these requests to safely be passed to peers.
* adapt caching to permit safe sharing between clients making identical
  requests to same sources.

13 years agoServer certificate testing ACLs Part2
Christos Tsantilas [Thu, 2 Feb 2012 19:14:55 +0000 (21:14 +0200)] 
Server certificate testing ACLs Part2

Replace the hard coded implementation for default signing algorithm applied
to generated certificates which does not match the configured sslproxy_cert_sign
access list, with default acl lines.

The new tag POSTSCRIPTUM added to the cf.data.pre file which can be used to
append to the user configuration some default config lines.

13 years agoLanguage: fr updates
Bernard [Thu, 2 Feb 2012 17:06:03 +0000 (06:06 +1300)] 
Language: fr updates

13 years agoServer certificate testing ACLs
Christos Tsantilas [Thu, 2 Feb 2012 10:53:08 +0000 (12:53 +0200)] 
Server certificate testing ACLs

This patch add the following ACLs to test the condition of the origin server
certificate: ssl::certHasExpired, ssl::certNotYetValid, ssl::certDomainMismatch,
ssl::certUntrusted and ssl::certSelfSigned.

The above in this patch are predifined acl lists or/and can be used as error
name shortcuts with ssl_error ACL lists

Implementation details:
1) The ssl::certHasExpired,  ssl::certNotYetValid, ssl::certDomainMismatch
ssl::certUntrusted and ssl::certSelfSign acl lists are predifined in cf.data.pre

2) The above names can also used as error names. The ssl-error parser
(Ssl::ParseErrorString function) replace them with the appropriate SSL error
list.

3) The Ssl::ParseErrorString function modified to return a list of errors, not
just an error code.

4) I implement the IFDEF /ENDIF block support for cf.data.pre file.

13 years agoBug fix: broken intermediate certificate is mimicked instead of the origin server...
Christos Tsantilas [Thu, 2 Feb 2012 09:28:02 +0000 (11:28 +0200)] 
Bug fix: broken intermediate certificate is mimicked instead of the origin server certificate

 In the case of SSL error we are trying to get the server ssl certificate from
the Ssl::ErrorDetail object using the Ssl::ErrorDetail::peerCert method.
But with the current implementation this method does not return the peer
certificate but instead the broken certificate which may be different than the
peer certificate.

This patch:
1) Stores both server and broken certificate in Ssl::ErrorDetail objects
2) Fix the Ssl::ErrorDetail::peerCert method to return always server certificate
3) Add a new method the Ssl::ErrorDetail::brokenCert which return the broken
   certificate

13 years agoLanguage: bg updates
Evgeni [Thu, 2 Feb 2012 02:31:25 +0000 (15:31 +1300)] 
Language: bg updates

13 years agoLanguage: fr updates
Bernard [Thu, 2 Feb 2012 01:59:00 +0000 (14:59 +1300)] 
Language: fr updates

13 years agoSet logged status code (%<Hs) to 200 when establishing a bumped tunnel.
Alex Rousskov [Wed, 1 Feb 2012 19:12:41 +0000 (12:12 -0700)] 
Set logged status code (%<Hs) to 200 when establishing a bumped tunnel.

Bumped CONNECT requests are logged separately and we always use 200 status
code when bumping them. Eventually, tunnel and bumping code should use
real HttpReply objects instead of writing hard-coded reply strings that
logging code has no access to.

13 years agoProtect sslErrorList from being used outside USE_SSL. BumpSslServerFirst.take04
Alex Rousskov [Wed, 1 Feb 2012 06:36:28 +0000 (23:36 -0700)] 
Protect sslErrorList from being used outside USE_SSL.

13 years agoAdd FwdState close handler to pinned connections.
Alex Rousskov [Wed, 1 Feb 2012 06:05:08 +0000 (23:05 -0700)] 
Add FwdState close handler to pinned connections.

Without a close handler, we will not notice when Server forcefully closed the
connection (e.g., when receiving a zero-size response due to a pconn race)
and, hence, will not retry the connection (or server an error), resulting in a
stuck client (e.g., again, when the server received a zero-size response).

13 years agoReplaced PROTO_SSL_PEEK with request_flags::sslPeek and disabled server SNI
Alex Rousskov [Wed, 1 Feb 2012 05:13:24 +0000 (22:13 -0700)] 
Replaced PROTO_SSL_PEEK with request_flags::sslPeek and disabled server SNI
for bump-server-first connections.

While PROTO_SSL_PEEK was a safer design option because requests with the
"wrong" protocol scheme would be less likely to leave Squid, it required
all error-generation code to replace the protocol with PROTO_HTTPS so
that error make more sense to end users. We no longer have to do that.

The server-side SNI for bump-server-first connections has to be disabled
because bump-server-first code does not yet know the true intended server name
(even for those CONNECT requests that have server name, it would be a little
risky to use CONNECT info for SNI). That name could be eventually obtained
from the client before we peek at the server certificate but that work
is outside this project scope.

13 years agoHttpRequest::SetHost() must invalidate HttpRequest::canonical "cache"
Alex Rousskov [Wed, 1 Feb 2012 05:11:10 +0000 (22:11 -0700)] 
HttpRequest::SetHost() must invalidate HttpRequest::canonical "cache"
because the call alters canonical URI.

This change makes the callers simpler and safer.

13 years agoDo not set request->flags.no_direct for bumped CONNECT requests
Alex Rousskov [Wed, 1 Feb 2012 05:06:08 +0000 (22:06 -0700)] 
Do not set request->flags.no_direct for bumped CONNECT requests
because it precludes them from reaching their [direct] destination
unless allow-direct is set on http_port.

13 years agoPolished debugging.
Alex Rousskov [Tue, 31 Jan 2012 22:10:05 +0000 (15:10 -0700)] 
Polished debugging.

13 years agoBug fix: The SQUID_X509_V_ERR_DOMAIN_MISMATCH error name when used with sslproxy_cert...
Christos Tsantilas [Tue, 31 Jan 2012 20:57:35 +0000 (22:57 +0200)] 
Bug fix: The SQUID_X509_V_ERR_DOMAIN_MISMATCH error name when used with sslproxy_cert_error never matches

13 years agoApplied temporary workaround for bug 3405 to avoid ssl_crtd crashes when
Alex Rousskov [Tue, 31 Jan 2012 20:08:08 +0000 (13:08 -0700)] 
Applied temporary workaround for bug 3405 to avoid ssl_crtd crashes when
dealing with bad certificates.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 31 Jan 2012 01:57:05 +0000 (18:57 -0700)] 
SourceFormat Enforcement

13 years agoUse -2 instead of -1 as the minimum sane time in swap.state entries
Alex Rousskov [Mon, 30 Jan 2012 17:57:54 +0000 (10:57 -0700)] 
Use -2 instead of -1 as the minimum sane time in swap.state entries
because StoreSwapLogData::expires documentation says it sometimes uses -2.