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

13 years agoBug 3441: Part 1: Minimize cache size corruption by malformed swap.state.
Alex Rousskov [Mon, 30 Jan 2012 17:13:52 +0000 (10:13 -0700)] 
Bug 3441: Part 1: Minimize cache size corruption by malformed swap.state.

If swap.state gets corrupted, a single entry with bogus size value will screw
up Squid idea of the current cache size. A newly added StoreSwapLogData sane()
method attempts to minimize the chance of corruption by ignoring log entries
with obviously bogus values.

However, without expensive size checks (-S or "Does the log entry matches the
actual cache file size?"), it is not possible to reliably detect all bogus log
entries.

If Squid gets a wrong idea of the current cache size, it may either cache too
much (and possibly run out of space) OR delete everything.

13 years agosslproxy_cert_sign squid.conf option
Christos Tsantilas [Fri, 27 Jan 2012 15:53:38 +0000 (17:53 +0200)] 
sslproxy_cert_sign squid.conf option

This option control how generated fake SSL certificates are signed.

Syntax:
  sslproxy_cert_sign <signing algorithm> acl ...

where <signing algorithm> can be one of the signTrusted, signUntrusted or
signSelf

Default signing algorithm if the sslproxy_cert_sign is not configured is
signSelf, if the server certificate is self signed, signUntrusted if the server
certificate is untrusted (ERR_INVALID_CA, ERR_SELF_SIGNED_CERT_IN_CHAIN,
ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, ERR_UNABLE_TO_GET_ISSUER_CERT,
ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY and ERR_CERT_UNTRUSTED errors) and
signTrusted if the server certificate is trusted.

Notes:
  - The signing algorithm passed as parameter to the ssl_crtd daemon

  - A self signed certificate generated on squid startup to be used as
    signing certificate for untrusted certificates, with CN =
    "Squid CA for Untrusted Certificates"

  - The configured certificates with http(s)_port squid.conf option chained to
    the client SSL connection only when signTrusted signing algorithm selected.
    When the signing algorithm is signSelf or signUntrusted no other certificate
    send to the client browser.

  - A small bug fixed which did not allow the sslproxy_cert_adapt option
    to be enabled in squid if the icap client is not enabled

13 years agoBug 3268: remove wrong 'Ready to serve requests.' message
Amos Jeffries [Fri, 27 Jan 2012 13:41:01 +0000 (06:41 -0700)] 
Bug 3268: remove wrong 'Ready to serve requests.' message

13 years agoDNs changes obsoleted dns_v4_fallback
Amos Jeffries [Fri, 27 Jan 2012 12:45:06 +0000 (05:45 -0700)] 
DNs changes obsoleted dns_v4_fallback

13 years agoRestor mgr: default menu display
Amos Jeffries [Fri, 27 Jan 2012 12:28:26 +0000 (05:28 -0700)] 
Restor mgr: default menu display

13 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 27 Jan 2012 01:19:11 +0000 (18:19 -0700)] 
SourceFormat Enforcement

13 years agoNo need to require s->key to be set: s->cert is used instead when needed.
Alex Rousskov [Thu, 26 Jan 2012 21:32:25 +0000 (14:32 -0700)] 
No need to require s->key to be set: s->cert is used instead when needed.

13 years agoBug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)
Alex Rousskov [Thu, 26 Jan 2012 14:52:35 +0000 (07:52 -0700)] 
Bug 3449: shm_open failed (part 4: fixing memory_cache_shared defaults)

Properly initialize memory_cache_shared when not explicitly configured and
do not allocate shared memory segments if memory_cache_shared is off.

Prior to this change, shared memory was requested (during rrClaimMemoryNeeds)
before memory_cache_shared was initialized (during rrAfterConfig, unless
explicitly set in squid.conf). Moreover, MemStore::EntryLimit() calculation
ignored memory_cache_shared setting. All that resulted in an attempt to create
shared memory segments where none were needed or possible.

We now have a new Runners Registry (rrFinalizeConfig) that is dedicated to
finalizing complex configuration options, before those configurations options
are used to initialize modules, features, and services. As far as shared
memory is concerned, the initialization order is now:

  * rrFinalizeConfig: finalize memory_cache_shared if needed
  * rrClaimMemoryNeeds: request shared memory pages for the caches
  * rrAfterConfig: create shared memory segments

The same bug 3449 also needed a fix for shared segment paths (trunk r11961).

13 years agoBug 3268: Squid cannot do anything else during ufs/diskd rebuild
Alex Rousskov [Thu, 26 Jan 2012 04:51:21 +0000 (21:51 -0700)] 
Bug 3268: Squid cannot do anything else during ufs/diskd rebuild

Replaced 50-entries/step UFS rebuild logic with 50msec/step logic,
while also ensuring that other events can be processed between steps.

During a swap.state rebuild, progress reporting will now happen
every 4000 entries instead of every 0xFFF entries because humans do not
think in hex. Still no progress reporting for dirty rebuilds based on the
cache directory scans.

The code is based on Rock Store rebuild code. Eventually, the common rebuild
pacing logic among all stores should be merged to avoid code duplication.

Also removed RebuildState::next methods as unused. A copy-paste error?

13 years agoUse CbDataList to implement Ssl::Errors list
Christos Tsantilas [Tue, 24 Jan 2012 10:03:18 +0000 (12:03 +0200)] 
Use CbDataList to implement Ssl::Errors list

Convert type of Ssl::Errors from std::vector<ssl_error_t> to
CbDataList<Ssl::ssl_error_t>

13 years agoRenamed squid.h to squid-old.h and config.h to squid.h.
Francesco Chemolli [Sun, 22 Jan 2012 14:15:59 +0000 (15:15 +0100)] 
Renamed squid.h to squid-old.h and config.h to squid.h.

13 years agoFixed source-maintenance.sh
Francesco Chemolli [Sun, 22 Jan 2012 13:45:40 +0000 (14:45 +0100)] 
Fixed source-maintenance.sh

Updated guard against checking squid-old.h
Prevented checking libTrie as it uses its own config.h

13 years agoFixed typo in documentation.
Francesco Chemolli [Sun, 22 Jan 2012 11:12:00 +0000 (12:12 +0100)] 
Fixed typo in documentation.

13 years agoDisable OpenSSL SSL/TLS bug workarounds by default
Henrik Nordstrom [Sat, 21 Jan 2012 23:04:54 +0000 (00:04 +0100)] 
Disable OpenSSL SSL/TLS bug workarounds by default

On a closer inspection the set of "harmless" SSL/TLS bug workarounds
set by SSL_OP_ALL is not all of them harmless and reduces the SSL/TLS
strength to some attacks.

To revert to the older mode the ALL option can be set explicitly, but
it's better to understand which bug is encountered and enable only that
specific workaround if needed.

13 years agoRemoved some mentions of squid-old from the documentation.
Francesco Chemolli [Sat, 21 Jan 2012 17:11:05 +0000 (18:11 +0100)] 
Removed some mentions of squid-old from the documentation.

13 years agoSmall fixes.
Francesco Chemolli [Sat, 21 Jan 2012 17:06:38 +0000 (18:06 +0100)] 
Small fixes.

13 years agosslproxy_cert_adapt squid.conf option
Christos Tsantilas [Sat, 21 Jan 2012 10:11:43 +0000 (12:11 +0200)] 
sslproxy_cert_adapt squid.conf option

This patch add the sslproxy_cert_adapt option to squid.conf which gives to
squid administrators the required functionality to "fix" a known broken
certificate using acls.
Currently only the "Not After", "Not Before" and "Common Name" fields of a
certificate can be modified/fixed.

The sslproxy_cert_adapt option has the form:
   sslproxy_cert_adapt <adaptation algorithm> acl ...
where <adaptation algorithm> is one of the setValidAfter, setValidBefore and
setCommonName.

    setValidAfter: sets the "Not After" property to the signing cert's
                   "Not After" property.
    setValidBefore: sets the "Not Before" property to the signing cert's
                   "Not After" property.
    setCommonName: sets certificate Subject.CN property to the host name
                   from specified as a CN parameter (setCommonName{CN}) or,
                   if no explicit CN parameter was specified, extracted from
                   the CONNECT request

When the acl(s) match, the corresponding adaptation algorithm is applied to
the fake/generated certificate. Otherwise, the default mimicking action takes
place.

13 years agoFixed comment in source-maintenance.sh
Francesco Chemolli [Sat, 21 Jan 2012 08:08:51 +0000 (09:08 +0100)] 
Fixed comment in source-maintenance.sh

13 years agoClarified and corrected documentation.
Francesco Chemolli [Sat, 21 Jan 2012 08:06:33 +0000 (09:06 +0100)] 
Clarified and corrected documentation.

13 years agoDo not add HTTP 110 and 111 Warnings to TCP_REFRESH_UNMODIFIED responses.
Alex Rousskov [Fri, 20 Jan 2012 23:28:14 +0000 (16:28 -0700)] 
Do not add HTTP 110 and 111 Warnings to TCP_REFRESH_UNMODIFIED responses.

The old "stale if hit" logic did not account for cases where the stored stale
response became fresh due to a successful revalidation with the origin server.
When the stored response was stale at the time of the request, we were adding
110 "Response is stale" and even 111 "Revalidation failed" Warning headers to
responses while logging TCP_REFRESH_UNMODIFIED, which is considered a hit.

13 years agoRenamed squid.h to squid-old.h and config.h to squid.h
Francesco Chemolli [Fri, 20 Jan 2012 18:55:04 +0000 (19:55 +0100)] 
Renamed squid.h to squid-old.h and config.h to squid.h

13 years agoRemove unnecessary stub_tools dependency on String
Francesco Chemolli [Fri, 20 Jan 2012 15:59:58 +0000 (16:59 +0100)] 
Remove unnecessary stub_tools dependency on String

13 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 20 Jan 2012 01:42:50 +0000 (18:42 -0700)] 
SourceFormat Enforcement

13 years agoMerge from StatHist refactor.
Francesco Chemolli [Thu, 19 Jan 2012 20:08:53 +0000 (21:08 +0100)] 
Merge from StatHist refactor.

Added StatHist unit tests, and moved algorithm consistency checks there.
Expanded storage for histograms to 64bit unsigned.
Inlined StatHist constructor, destructor and assignment operator.
Implemented stubs for StatHist.cc and mem.cc

13 years agoGCC 4.7 fix
Jiri Skala [Tue, 17 Jan 2012 19:36:40 +0000 (20:36 +0100)] 
GCC 4.7 fix

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 17 Jan 2012 01:39:21 +0000 (18:39 -0700)] 
SourceFormat Enforcement

13 years agoSend DNS A and AAAA queries in parallel
Henrik Nordstrom [Mon, 16 Jan 2012 17:30:16 +0000 (18:30 +0100)] 
Send DNS A and AAAA queries in parallel

This implements sending DNS A & AAAA queries in parallel by
creating "slave" idns_query requests. Current implementation
uses the A lookup as "master" and AAAA as "slave" query.

Long term this should probably be restructured to separate "lookup
state" and "query", or even better yet to defer the DNS lookups
until connect time and perform A respective AAAA as needed only and
not look up both before attemting to connect.

This also drops the dns_v4_fallback directive as it have no effect with
parallel DNS lookups. This directive should be reinstanciated in future
to enable pure IPv6 usage.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 14 Jan 2012 01:30:37 +0000 (18:30 -0700)] 
SourceFormat Enforcement

13 years agotrimMemory for unswappable objects: fix NullStoreEntry::trimMemory compile error
Christos Tsantilas [Fri, 13 Jan 2012 16:22:21 +0000 (18:22 +0200)] 
trimMemory for unswappable objects: fix NullStoreEntry::trimMemory compile error

13 years agotrimMemory for unswappable objects
Christos Tsantilas [Fri, 13 Jan 2012 13:49:26 +0000 (15:49 +0200)] 
trimMemory for unswappable objects

Inside StoreEntry::swapOut() the StoreEntry::trimMemory() method called to
release unused MemObjects memory. The trimMemory method must called for all
store entries, but current code blocks that call for not-swappable objects,
at least.

This patch trying to fix this bug implementing the following simple logic:
   {
     bool weAreOrMayBeSwappingOut =
           swappingOut() || mayStartSwapout();

     trimMemory(weAreOrMayBeSwappingOut);

     if (!weAreOrMayBeSwappingOut)
         return; // nothing else to do
   }

This is a Measurement Factory project

13 years agoLanguage: fr updates
Bernard [Thu, 12 Jan 2012 23:05:38 +0000 (12:05 +1300)] 
Language: fr updates

13 years agoCheck SSL server certificate on reconnect
Christos Tsantilas [Tue, 10 Jan 2012 10:41:18 +0000 (12:41 +0200)] 
Check SSL server certificate on reconnect

In the case where the squid-to-server connection closed and we re-connect to
server we need to check if the server certificate changed.

Moreover we need to check stored certificates with the web server certificate
to handle the case the web server certificate is updated. In this case a new
certificate must generated to mimic the updated server certificate fields

13 years agoBug 3472: segfault with the message "urlParse: URL too large"
Christos Tsantilas [Mon, 9 Jan 2012 14:34:31 +0000 (16:34 +0200)] 
Bug 3472: segfault with the message "urlParse: URL too large"

13 years agoBug 3471: Segfault when %la formating code used
Christos Tsantilas [Mon, 9 Jan 2012 14:31:50 +0000 (16:31 +0200)] 
Bug 3471: Segfault when %la formating code used

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 8 Jan 2012 01:35:32 +0000 (18:35 -0700)] 
SourceFormat Enforcement

13 years agoCleanup: update most of the existing stub files to use the STUB.h framework
Amos Jeffries [Sat, 7 Jan 2012 10:15:40 +0000 (03:15 -0700)] 
Cleanup: update most of the existing stub files to use the STUB.h framework

There are still several sections to be done. Including adding library API
stubs. However these are the ones which can be done immediately without
breaking or re-writing existing unit tests.

13 years agoDrop dns_v4_fallback directive as it have no effect with parallel DNS lookups
Henrik Nordstrom [Fri, 6 Jan 2012 20:41:21 +0000 (21:41 +0100)] 
Drop dns_v4_fallback directive as it have no effect with parallel DNS lookups

The change to perform A and AAAA lookups in parallel made dns_v4_fallback
no longer have any effect.

This directive should be reinstanciated in future to enable pure IPv6 usage.

13 years agoSend DNS A and AAAA queries in parallel
Henrik Nordstrom [Fri, 6 Jan 2012 20:30:35 +0000 (21:30 +0100)] 
Send DNS A and AAAA queries in parallel

This implements sending DNS A & AAAA queries in parallel by
creating "slave" idns_query requests. Current implementation
uses the A lookup as "master" and AAAA as "slave" query.

Long term this should probably be restructured to separate "lookup
state" and "query", or even better yet to defer the DNS lookups
until connect time and perform A respective AAAA as needed only and
not look up both before attemting to connect.

13 years agoBump-server-first fails with SQUID_X509_V_ERR_DOMAIN_MISMATCH error BumpSslServerFirst.take03
Christos Tsantilas [Fri, 6 Jan 2012 12:01:42 +0000 (14:01 +0200)] 
Bump-server-first fails with SQUID_X509_V_ERR_DOMAIN_MISMATCH error

When the bump-server-first used we do not always know the hostname of the server
we are connecting to. Thus the the hostname validity check for the
SSL server certificate will fail with SQUID_X509_V_ERR_DOMAIN_MISMATCH error.

This patch does not check if server certificate is valid for the hostname on
bump-server-first case and move this check after the http request received
from the web client

13 years agoPolish compat library xfree/xxfree
Amos Jeffries [Thu, 5 Jan 2012 14:12:04 +0000 (03:12 +1300)] 
Polish compat library xfree/xxfree

* remove xxfree() entirely it has been a useless wrapper for free_const()
  for some time now.

* update replace xfree() to a static inline function to permit better
  compiler optimization

13 years agoFix testRock SHM file base path
Amos Jeffries [Thu, 5 Jan 2012 14:02:06 +0000 (03:02 +1300)] 
Fix testRock SHM file base path

13 years agoBug 3449: pt3: shm_open can fail with a mangled path
Amos Jeffries [Wed, 4 Jan 2012 22:55:08 +0000 (11:55 +1300)] 
Bug 3449: pt3: shm_open can fail with a mangled path

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 4 Jan 2012 01:22:23 +0000 (18:22 -0700)] 
SourceFormat Enforcement

13 years agoSourceLayout: DNS component code style changes
Amos Jeffries [Tue, 3 Jan 2012 02:19:30 +0000 (19:19 -0700)] 
SourceLayout: DNS component code style changes

- removes "dnsserver" terminology from all the Squid internals and
  ./configure docs. Replacing it with "helper" to avoid confusion.

- updates the automake conditional to ENABLE_DNSHELPER and code define
  to USE_DNSHELPER inline with coding guidelines.

- shuffles the DNS API definitions to their own header, SquidDns.h, and
  de-duplicates the init/shutdown API calls to remove some #if

13 years agoFix diskd includes
Amos Jeffries [Sun, 1 Jan 2012 13:13:06 +0000 (06:13 -0700)] 
Fix diskd includes

It seems CentOS and BSD do not include errno.h and iostream through compat

13 years agoCleanup: unlinkd is self-contained
Amos Jeffries [Sun, 1 Jan 2012 04:48:49 +0000 (17:48 +1300)] 
Cleanup: unlinkd is self-contained

This helper is very minimal. It does not use IP:: or Ipc:: symbols.
If we get linkage issues against it for them those need to be resolved
without pulling in dependencies from squid internal libraries.

13 years agoCleanup: detatch diskd from squid.h
Amos Jeffries [Sat, 31 Dec 2011 19:57:53 +0000 (08:57 +1300)] 
Cleanup: detatch diskd from squid.h

13 years agoBug 3444: send authentication challenge from ssl_bump and url_rewrite_access
Amos Jeffries [Sat, 31 Dec 2011 04:54:06 +0000 (21:54 -0700)] 
Bug 3444: send authentication challenge from ssl_bump and url_rewrite_access

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 31 Dec 2011 01:26:10 +0000 (18:26 -0700)] 
SourceFormat Enforcement

13 years agoCache Manager migration support
Amos Jeffries [Fri, 30 Dec 2011 16:01:37 +0000 (05:01 +1300)] 
Cache Manager migration support

 * Add a little bit of XHR script to the CGI cachemgr front page which
probes each of the managed proxies for http:// and https:// capabilities
and produces web links to their internal managers.

 * Reserve the template name MGR_INDEX for use by cachemgr scripts.
But do not distribute any preset template. This allows manager apps to
provide their own static template with linked scripts and objects.

 * The error page system is updated to create a blanket message
indicating missing template instead of aborting Squid if a template is
not even installed.

13 years agoPolish: allow service of internal requests over reverse-proxy ports
Amos Jeffries [Fri, 30 Dec 2011 12:29:14 +0000 (01:29 +1300)] 
Polish: allow service of internal requests over reverse-proxy ports

There is no reason why a revers-proxy port cannot service Squid internal
requests as well as whatever domain is being accelerated.

Also, scan the https_port list same as http_port list now that the
structures have been normalized.

13 years agoCleanup: de-duplicate internal URL detection
Amos Jeffries [Fri, 30 Dec 2011 12:26:51 +0000 (01:26 +1300)] 
Cleanup: de-duplicate internal URL detection

13 years agoPolish: display ACL enumeration text in debugs
Amos Jeffries [Fri, 30 Dec 2011 12:06:21 +0000 (01:06 +1300)] 
Polish: display ACL enumeration text in debugs

Slightly hackish way to do it. But avoids ACCESS_ in some weird places
and makes the cache.log reading a lot more friendly.

13 years agoSupport Cross-Origin Requests for the cache manager API
Amos Jeffries [Fri, 30 Dec 2011 03:42:50 +0000 (16:42 +1300)] 
Support Cross-Origin Requests for the cache manager API

Now that tools are being implemented to access the cache manager via
http:// scheme we need to accomodate the browser XSS protection
mechanisms which limit XHR based scripts abilities.

This adds CORS headers to manager responses. Permitting XHR to view the
Server header (to detect squid version for known capabilities) and to
flag that the XHR request may need access to credentials for
authenticating with the manager.

This also closes the feature bug 3407 requesting we support the
non-standard "Origin:" header, which is used by the CORS mechanisms.

Future work:
  Support the OPTIONS request used by CORS to detect requirements before
  POSTing. We do not yet use POST in the Squid code so that is left until
  needed.

13 years agoSourceLayout: shuffel UserRequest into Auth:: namespace
Amos Jeffries [Fri, 30 Dec 2011 01:24:57 +0000 (18:24 -0700)] 
SourceLayout: shuffel UserRequest into Auth:: namespace

No logic changes, symbols and debug only.

* shuffle AuthUserRequest to Auth::UserRequest
* shuffle AuthBasicUserRequest to Auth::Basic::UserRequest
* shuffle AuthDigestUserRequest to Auth::Digest::UserRequest
* shuffle AuthNegotiateUserRequest to Auth::Negotiate::UserRequest
* shuffle AuthNTLMUserRequest to Auth::NTLM::UserRequest

* polish and add documentation for several parts of the hierarchy

* replace obsolete debugs() location texts

13 years agoBug 3461: build regression in IPFilter NAT
Amos Jeffries [Sun, 25 Dec 2011 04:40:36 +0000 (21:40 -0700)] 
Bug 3461: build regression in IPFilter NAT

13 years agoThe error pages of failed "ssl bump first" requests contains urls in the form: BumpSslServerFirst.take02
Christos Tsantilas [Thu, 22 Dec 2011 16:36:55 +0000 (18:36 +0200)] 
The error pages of failed "ssl bump first" requests contains urls in the form:
    ssl_peek://hosrtname:443
This patch fixes this problem adding code which creates a new fake HttpRequest
which is a clone of the "ssl_peek" request but sets the hostname to the CN
retrieved from server certificate and protocol to Https.
The fake HttpRequest object passed to the ErrorState object.

13 years agoImplement the Ssl::CommonHostName name to recurn the CN from a certificate,
Christos Tsantilas [Thu, 22 Dec 2011 15:23:33 +0000 (17:23 +0200)] 
Implement the Ssl::CommonHostName name to recurn the CN from a certificate,
suitable for use as a host name.
Use this function to set the ConnStateData::sslHostName in ConnStateData::httpsPeeked method

13 years agoBug 3370: external ACL sometimes skipping
Amos Jeffries [Thu, 22 Dec 2011 04:49:24 +0000 (17:49 +1300)] 
Bug 3370: external ACL sometimes skipping

Emit tag/user/log/message/pass details to the request in the case where
the external ACL entry has expired but within graceful revalidate period.

The result of this bug appears as incorrect matches later down the ACL
processing in any config relying on the external ACL output values.
Example; for bypassing auth login, or for filtering tagged traffic.

13 years agoPolish: better debugs for IPFilter NAT
Amos Jeffries [Wed, 21 Dec 2011 12:17:34 +0000 (01:17 +1300)] 
Polish: better debugs for IPFilter NAT

13 years agoCherry-picked trunk r11900: Bug 3433: Segfault closing SNMP BumpSslServerFirst.take01
Alex Rousskov [Wed, 21 Dec 2011 01:44:04 +0000 (18:44 -0700)] 
Cherry-picked trunk r11900: Bug 3433: Segfault closing SNMP

13 years agoForward a StoreEntry holding the bumped secure connection establishment
Christos Tsantilas [Tue, 20 Dec 2011 15:35:27 +0000 (17:35 +0200)] 
Forward a StoreEntry holding the bumped secure connection establishment
error page from the server-side code (which generates the error) to the
client-side code (which delays the error until the first encrypted
request comes). This allows Squid to display the error page to the user
(using secure connection) when bumping intercepted SSL connections. The
code still needs more polishing, including generating errors with host
names and not IP addresses (when possible).

The peeked server certificate is now stored in
ConnStateData::bumpErrorEntry. This allows us to mimic the certificate
of dropped server connections.

Load signing certificate and key when initializing a tproxy-enabled
https_port.

Fixed debugging when opening a peeking connection.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Tue, 20 Dec 2011 01:47:48 +0000 (18:47 -0700)] 
SourceFormat Enforcement

13 years agoBug 3447: assertion failed: CommCalls.h:150: "dp"
Amos Jeffries [Mon, 19 Dec 2011 13:18:29 +0000 (06:18 -0700)] 
Bug 3447: assertion failed: CommCalls.h:150: "dp"

Detatch FD/connection close handlers from reliance on commCloseCbParams
some handlers use FdeCbParams and others are possible.

If the callback handler needs FD the call creator must save it in the
params at call construction time.

13 years agoCleanup: remove https_port_list type
Amos Jeffries [Mon, 19 Dec 2011 03:51:22 +0000 (16:51 +1300)] 
Cleanup: remove https_port_list type

* Complete the merger with http_port_list and remove the https-specific struct

* kept config file type for parser magics and backward compatibility

13 years agoLanguage: fr updates
Bernard [Sun, 18 Dec 2011 17:08:01 +0000 (06:08 +1300)] 
Language: fr updates

13 years agoLanguage: fr updates
Bernard [Sun, 18 Dec 2011 17:06:21 +0000 (06:06 +1300)] 
Language: fr updates

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 18 Dec 2011 01:31:58 +0000 (18:31 -0700)] 
SourceFormat Enforcement

13 years agoImplemented and made public StatHist copy-constructor
Francesco Chemolli [Sat, 17 Dec 2011 21:23:14 +0000 (22:23 +0100)] 
Implemented and made public StatHist copy-constructor

13 years agoStatHist fixes
Francesco Chemolli [Sat, 17 Dec 2011 08:32:53 +0000 (09:32 +0100)] 
StatHist fixes

- added protection against self-assignment
- hid copy-constructor
- de-virtualized destructor

13 years agoCleanup: comm Timeout API
Amos Jeffries [Sat, 17 Dec 2011 03:42:43 +0000 (20:42 -0700)] 
Cleanup: comm Timeout API

* accept Comm::Connection when setting timeout
 - use commSetConnTimeout() now

* drop old cbdata wrapper function

* drop raw-FD timeout setting (unused)

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 17 Dec 2011 01:26:31 +0000 (18:26 -0700)] 
SourceFormat Enforcement

13 years agoCertificate mimicking
Christos Tsantilas [Fri, 16 Dec 2011 17:17:57 +0000 (19:17 +0200)] 
Certificate mimicking

This patch try to mimic true server certificate properties when generating
a fake SSL certificate for SslBump. If ssl_crtd is enabled, it receives the
true server certificate and mimic its properties. Otherwise, the certificate
mimicking code will run in the worker.

Currently the following properties mimicked: subject name, not before/after,
and subject alternate name.

13 years agoBug 3391: forwarded_for log functionality broken
Amos Jeffries [Fri, 16 Dec 2011 11:29:40 +0000 (00:29 +1300)] 
Bug 3391: forwarded_for log functionality broken

13 years agoMerge StatHist feature-branch:
Francesco Chemolli [Fri, 16 Dec 2011 11:15:22 +0000 (12:15 +0100)] 
Merge StatHist feature-branch:
- StatHist refactoring
- StatCounters untangling from global symbol table

13 years agoMerged from trunk
Francesco Chemolli [Fri, 16 Dec 2011 11:06:46 +0000 (12:06 +0100)] 
Merged from trunk

13 years agoBug 3391: raise cbdata lock limits
Amos Jeffries [Fri, 16 Dec 2011 09:10:02 +0000 (22:10 +1300)] 
Bug 3391: raise cbdata lock limits

In 3.2 it is now possible to have >64K simultaneous connections
referencing some permanent cbdata locked state (port, peer, acl etc)

13 years agoRenamed some StatHist private variables to avoid name clases.
Francesco Chemolli [Fri, 16 Dec 2011 06:04:45 +0000 (07:04 +0100)] 
Renamed some StatHist private variables to avoid name clases.

13 years agoMoved some more typedefs to StatHist.h
Francesco Chemolli [Thu, 15 Dec 2011 23:14:48 +0000 (00:14 +0100)] 
Moved some more typedefs to StatHist.h
Improved documentation
Removed squid.h include
Changed StatHist::operator= to almost be an actual assignment operator
Fixed findBin corner-case

13 years agoUse CN from the peeked certificate to generate a fake certificate.
Alex Rousskov [Thu, 15 Dec 2011 19:19:53 +0000 (12:19 -0700)] 
Use CN from the peeked certificate to generate a fake certificate.

13 years agoRenamed some fields to CamelCase.
Francesco Chemolli [Thu, 15 Dec 2011 16:32:38 +0000 (17:32 +0100)] 
Renamed some fields to CamelCase.