]> git.ipfire.org Git - thirdparty/squid.git/log
thirdparty/squid.git
12 years agoFix clang compile error in acl/Gadgets.h
Amos Jeffries [Thu, 10 Jan 2013 01:00:54 +0000 (14:00 +1300)] 
Fix clang compile error in acl/Gadgets.h

Since rev.12562 dlink_list is a class not a struct.

Detected by Squi dbuild farm FreeBSD 9.x node.

12 years agoFix memory leak in IP address unit test
Amos Jeffries [Wed, 9 Jan 2013 00:42:25 +0000 (17:42 -0700)] 
Fix memory leak in IP address unit test

Another failure to call FreeAddrInfo() after calling GetAddrInfo().

 Detected by Coverity Scan. Issue 740438.

12 years agoPrep for 3.1.23, 3.2.6, 3.3.0.3
Amos Jeffries [Wed, 9 Jan 2013 00:22:17 +0000 (17:22 -0700)] 
Prep for 3.1.23, 3.2.6, 3.3.0.3

12 years agoBug 3731: use 'int' on all systems settign TOS value.
Amos Jeffries [Tue, 8 Jan 2013 23:51:02 +0000 (16:51 -0700)] 
Bug 3731: use 'int' on all systems settign TOS value.

FreeBSD is confirmed erroring out on 8-bit variable size. Other BSD are
documented in a way that implies they do as well, although not at this
stage confirmed to be failing.
 Linux seems to be the only confirmed system workign with 8-bit size sent
to setsockopt(). So we revert this to 'int' (32-bit or 64-bit) as was
working in Squid 3.1.

12 years agoAnother piece of SQUID-2012:1
Eygene Ryabinkin [Tue, 8 Jan 2013 22:39:29 +0000 (15:39 -0700)] 
Another piece of SQUID-2012:1

12 years agosquidpurge: ensure PURGE repsonse buffer is terminated
Amos Jeffries [Sat, 5 Jan 2013 08:14:46 +0000 (01:14 -0700)] 
squidpurge: ensure PURGE repsonse buffer is terminated

 Detected by Coverity Scan. Issue 965807.

Also, additional validation check for issue 740488

12 years agoBug 3676: Fix various shadowed variables
Amos Jeffries [Wed, 2 Jan 2013 23:40:49 +0000 (12:40 +1300)] 
Bug 3676: Fix various shadowed variables

Also, fixes logformat dumper to output 'logformat' instead of 'format'.
'format' directive is the planned future name but is not yet parsed.

 Detected by GCC 4.7 with -Wshadow

12 years agoFixed SMP cache mgr request handling.
Alex Rousskov [Wed, 2 Jan 2013 18:50:24 +0000 (11:50 -0700)] 
Fixed SMP cache mgr request handling.

Coordinator could not successfully parse any SMP cache manager request since
r12410 "Polish: Http::MethodType upgrade" because the parsing code assumed the
presence of the request method ID field that was no longer added by the
request packing code.

12 years agoBug 3676: fix shadowed variable in negotiate_wrapper
Amos Jeffries [Wed, 2 Jan 2013 11:09:45 +0000 (00:09 +1300)] 
Bug 3676: fix shadowed variable in negotiate_wrapper

Detected by GCC 4.7 with -Wshadow

12 years agoFix initialization of helper and doubly-linked list objects
Amos Jeffries [Wed, 2 Jan 2013 03:16:45 +0000 (20:16 -0700)] 
Fix initialization of helper and doubly-linked list objects

  Detected by Coverity Scan. Issue 740565.

12 years agolibacl: Fix various issues in ASN and random ACL types
Amos Jeffries [Wed, 2 Jan 2013 00:42:43 +0000 (17:42 -0700)] 
libacl: Fix various issues in ASN and random ACL types

* replace malloc+memset pattern with calloc in ASN ACL.
  Highlighted by Coverity Scan, issue 434128.

* Log the even where ACL random is configured with no parameters.

* Improve detecton of negative values in random ACL.
  Detected by Coverity Scan, issue 740486.

NOTE: coverity issues which brought these to view require additional
fixes.

12 years agoAdditional pieces of SQUID-2012:1
Amos Jeffries [Tue, 1 Jan 2013 05:28:12 +0000 (22:28 -0700)] 
Additional pieces of SQUID-2012:1

12 years agoBug 3731: FreeBSD requires 32-bit TOS options
Amos Jeffries [Tue, 1 Jan 2013 03:55:32 +0000 (20:55 -0700)] 
Bug 3731: FreeBSD requires 32-bit TOS options

12 years agoFix memory leaks in ICMP
Amos Jeffries [Tue, 1 Jan 2013 03:20:47 +0000 (20:20 -0700)] 
Fix memory leaks in ICMP

InitAddrInfo() and GetAddrInfo() both allocate addrinfo structs which
must be freed by FreeAddrInfo(). Several places in ICMP were not doing
that free step.

 Detected by Coverity Scan. Issues 740434, 740435, 740436, 740437.

12 years agocbdataUnlock may deallocate cbdata as well.
Alex Rousskov [Mon, 31 Dec 2012 19:48:11 +0000 (12:48 -0700)] 
cbdataUnlock may deallocate cbdata as well.

12 years agoCompleted initializer for constructors of Adaptation::Config and AsyncJob
Francesco Chemolli [Mon, 31 Dec 2012 10:52:17 +0000 (11:52 +0100)] 
Completed initializer for constructors of Adaptation::Config and AsyncJob

12 years agosquidpurge: fix META TLV parsing issues
Amos Jeffries [Mon, 31 Dec 2012 07:42:32 +0000 (20:42 +1300)] 
squidpurge: fix META TLV parsing issues

* current Squid may stoe objects with up to 64KB URLs and 64KB headers
  in the disk cache. Increas the tool buffer to 128KB to prevent
  truncating the loaded meta data.

* check for and report when meta data overruns the end of loaded buffer
  content. Ignore the truncated TLV entry and produce a WARNING.

* validate the TLV size field loaded from disk to prevent buffer overrun
  errors from corrupted files on disk.

 Detected by Coverity Scan. Issues 740381, 740488.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 31 Dec 2012 01:13:06 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agoCompletd and fixed some class constructors, removed redundant htcpReplyData class.
Francesco Chemolli [Sun, 30 Dec 2012 12:53:01 +0000 (13:53 +0100)] 
Completd and fixed some class constructors, removed redundant htcpReplyData class.

Address several Coverity issues dealing with noninitialized data members.

12 years agoBug 3729: 32-bit overflow in parsing 64-bit configuration values
Tianyin Xu [Sat, 29 Dec 2012 02:52:50 +0000 (19:52 -0700)] 
Bug 3729: 32-bit overflow in parsing 64-bit configuration values

12 years agoTypo in rev.12550
Amos Jeffries [Sat, 29 Dec 2012 02:49:04 +0000 (19:49 -0700)] 
Typo in rev.12550

12 years agoFix various Disk I/O issues in all modules
Tomas Hozza [Sat, 29 Dec 2012 02:40:12 +0000 (19:40 -0700)] 
Fix various Disk I/O issues in all modules

* Uninitialized class members.

* Handle NULL potential after several dynamic_cast.

* Better error result handling from several system functions
  lseek(), fcntl() can report errors which need handling.

* diskd explicit NULL dereference on broken input.
  Extremely unlikely, but worth protecting against.

 Detected by Coverity Scan. Issues 740510, 740358, 740359,
  740511, 740317, 740360, 740513, 740318, 740514

12 years agoFix some issues revealed by Coverty Scan, improve documentation of parseHttpRequest
Francesco Chemolli [Fri, 28 Dec 2012 15:23:21 +0000 (16:23 +0100)] 
Fix some issues revealed by Coverty Scan, improve documentation of parseHttpRequest

Address issues for the defect classes:
- Array compared against 0
- Copy into fixed size buffer
- Dereference after null check
- Dereference before null check

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 28 Dec 2012 01:13:14 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agoFix error in configuration parser which would misassigne the sslcrlfile directive.
Francesco Chemolli [Thu, 27 Dec 2012 18:15:38 +0000 (19:15 +0100)] 
Fix error in configuration parser which would misassigne the sslcrlfile directive.
Fix potentially crashing flaw in CPU affinity map display code.

Detected by Coverity Scan, defects 740336 and 740337.

12 years agoRemoved useless checks for guaranteed-defined pointers.
Francesco Chemolli [Thu, 27 Dec 2012 17:58:29 +0000 (18:58 +0100)] 
Removed useless checks for guaranteed-defined pointers.

Detected by Coverity Scan. Defects 740936 and 740937.

12 years agoPlugged memory leaks in digest authentication module.
Francesco Chemolli [Thu, 27 Dec 2012 17:23:08 +0000 (18:23 +0100)] 
Plugged memory leaks in digest authentication module.

Detected by Coverity Scan. Issue 740431.

12 years agoFix various issues in unit tests
Amos Jeffries [Thu, 27 Dec 2012 10:17:04 +0000 (03:17 -0700)] 
Fix various issues in unit tests

* Define MemObject stub constructor to initialize teh stub object properly
  apparently store unit tests needs one defined. Best to make it work and
  set base values than leave garbage in the object fields.

* Buffer overrun on config parser if test is ever given a too-long
  string input.

* Memory leak in HttpRequest testing. One instance of a short array.

* Range: header testing may thor exceptions which were not caught by the
  test binary. Could lead to difficulty debugging exception errors.

 Detected by Coverity Scan. Issues 740523, 740482, 740440, 740498

12 years agoFix build error on FreeBSD in kqueue
Amos Jeffries [Thu, 27 Dec 2012 06:21:06 +0000 (19:21 +1300)] 
Fix build error on FreeBSD in kqueue

12 years agoBug 3728: Improve debug for cache_dir
Tianyin Xu [Thu, 27 Dec 2012 02:26:28 +0000 (19:26 -0700)] 
Bug 3728: Improve debug for cache_dir

12 years agokqueue: update status from experimental to fully available net I/O method
Amos Jeffries [Thu, 27 Dec 2012 01:42:48 +0000 (14:42 +1300)] 
kqueue: update status from experimental to fully available net I/O method

kqueue has been in use on FreeBSD and maybe others for some time now and
has less bugs than epoll. So the issues on record should not be held
against it.

The attached patch adds auto-detection for the kqueue dependencies and
enables it by default when it can build. Unfortunately due to the
dependencies we cannot add it to maximus layer for force-enable, but the
default layer will test it on FreeBSD at least. It is still less
preferred than epoll(), but more than select() and poll().

12 years agoImport fixes for defects in client_side_reply, client_side_request, esi
Thomas Hozza [Wed, 26 Dec 2012 14:03:11 +0000 (15:03 +0100)] 
Import fixes for defects in client_side_reply, client_side_request, esi
and ufsswapdir from Red Hat's patchset.

12 years agoImport fixes for some defects found by Coverity Scan from Red Hat's patchset.
Thomas Hozza [Tue, 25 Dec 2012 19:43:38 +0000 (20:43 +0100)] 
Import fixes for some defects found by Coverity Scan from Red Hat's patchset.

12 years agoRemoved useless check in store_swapout.cc
Francesco Chemolli [Mon, 24 Dec 2012 13:39:37 +0000 (14:39 +0100)] 
Removed useless check in store_swapout.cc

Detected by Coverity Scan; fix by  Tomas Hozza.

12 years agoMake sure copied strings are properly terminated in snmplib and wccp2.
Francesco Chemolli [Sun, 23 Dec 2012 18:43:09 +0000 (19:43 +0100)] 
Make sure copied strings are properly terminated in snmplib and wccp2.

Detected by Coverity Scan; fix by  Tomas Hozza.

12 years agoRemoved useless variable assignment in acl/Asn.cc
Francesco Chemolli [Sat, 22 Dec 2012 17:58:56 +0000 (18:58 +0100)] 
Removed useless variable assignment in acl/Asn.cc

Detected by Coverity Scan. Issue 740592.

12 years agoRmoved useless variable in auth_digest.cc.
Francesco Chemolli [Sat, 22 Dec 2012 13:58:20 +0000 (14:58 +0100)] 
Rmoved useless variable in auth_digest.cc.

  Detected by Coverity Scan, issue 740594.

12 years agoRmoved useless variable in peer_digest.cc.
Francesco Chemolli [Sat, 22 Dec 2012 13:25:50 +0000 (14:25 +0100)] 
Rmoved useless variable in peer_digest.cc.

Detected by Coverity Scan, issue 740596

12 years agoFix end-of-reply handling in helperHandleRead.
Francesco Chemolli [Fri, 21 Dec 2012 09:27:17 +0000 (10:27 +0100)] 
Fix end-of-reply handling in helperHandleRead.

Detected by Coverity Scan. Issue 747703.

12 years agoFix wrong string length in testHttpReply.
Francesco Chemolli [Fri, 21 Dec 2012 09:24:24 +0000 (10:24 +0100)] 
Fix wrong string length in testHttpReply.

Detected by Coverity Scan. Issue 740413

12 years agoBug 3727: kerberos_ldap_group: explicitly assigning a variable to itself
Tianyin Xu [Fri, 21 Dec 2012 06:53:55 +0000 (19:53 +1300)] 
Bug 3727: kerberos_ldap_group: explicitly assigning a variable to itself

 Detected by LLVM compiler.

12 years agoFixed job entering/leaving search patterns in job tracing scripts
Alex Rousskov [Thu, 20 Dec 2012 04:33:39 +0000 (21:33 -0700)] 
Fixed job entering/leaving search patterns in job tracing scripts
broken by r12436 "Modify debugs() to automatically include HERE"

12 years agoFix typos in AccessLogEntry
Amos Jeffries [Mon, 17 Dec 2012 02:19:47 +0000 (15:19 +1300)] 
Fix typos in AccessLogEntry

Some of these were added by rev.12527 patch.

Clash between USE_ICAP_CLIENT and USE_ADAPTATION uncovered while testing
the fix for the those issues. Breaks build for eCAP without ICAP.

12 years agoSourceFormat Enforcement
Automatic source maintenance [Mon, 17 Dec 2012 01:13:14 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agoFix uninitialized fields in IcapLogEntry
Tomas Hozza [Sun, 16 Dec 2012 06:30:55 +0000 (19:30 +1300)] 
Fix uninitialized fields in IcapLogEntry

 Detected by Coverity Scan. Issue 740507

12 years agoFix various issues in snmplib
Tomas Hozza [Sat, 15 Dec 2012 12:18:50 +0000 (01:18 +1300)] 
Fix various issues in snmplib

* Memory leaks in OID management

* NULL pointer dereference on OID tree creation

* Ensure buffer terminations on OID data copy

* Better file handle management

  Detected by Coverity Scan. Issues 740480, 740357, 740429,
    443111, 740479, 740500

12 years agoFix various issues in smblib
Tomas Hozza [Sat, 15 Dec 2012 04:30:03 +0000 (17:30 +1300)] 
Fix various issues in smblib

* Crash on NTLM handshakes without domain.

* Memory leak on several internal DC connection failures

* Potential buffer overruns on specially crafted tokens

  Detected by Coverity Scan. Issues 740356, 740406, 740428,
   740476, 740477, 740478

12 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 15 Dec 2012 01:13:21 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agoPolished helper messages debugging slightly.
Alex Rousskov [Fri, 14 Dec 2012 16:10:05 +0000 (09:10 -0700)] 
Polished helper messages debugging slightly.

Made stateful and stateless debugging a little bit more similar/symmetric.
Debug helperStatefulSubmit message contents length.
Debug accumulated helperStatefulHandleRead buffer.
Polished helperHandleRead buffer debugging.

12 years agoAdded Raw, an std::ostream manipulator to print possibly non-terminated buffers
Alex Rousskov [Fri, 14 Dec 2012 16:07:18 +0000 (09:07 -0700)] 
Added Raw, an std::ostream manipulator to print possibly non-terminated buffers
and their labels/sizes.

The Raw manipulator tries to be smart about printing buffers at various
debugging levels: Large buffers are only printed at DBG_DATA by default.
This allows the caller to mix higher-level debug messages with dumping
of potentially large volumes of data. This smartness can be overruled
using an explicit minLevel() method call.

12 years agocert validation cache: fix to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 13:34:13 +0000 (15:34 +0200)] 
cert validation cache: fix to build on amd64-CentOS-5.3

12 years agocert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 11:11:16 +0000 (13:11 +0200)] 
cert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3

12 years agocert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3
Christos Tsantilas [Fri, 14 Dec 2012 09:46:42 +0000 (11:46 +0200)] 
cert validation cache: Fixes to LruMap template class to build on amd64-CentOS-5.3

12 years agocert validation cache: Add missing include file to avoid building errors on amd64...
Christos Tsantilas [Fri, 14 Dec 2012 08:25:59 +0000 (10:25 +0200)] 
cert validation cache: Add missing include file to avoid building errors on amd64-CentOs-icc and amd64-ubuntu-precise platforms

12 years agoext_kerberos_ldap_group_acl: Fix various bugs in rev.12512
Amos Jeffries [Fri, 14 Dec 2012 05:52:56 +0000 (22:52 -0700)] 
ext_kerberos_ldap_group_acl: Fix various bugs in rev.12512

Two issues added by patch hunk mis-alignment in rev.12512.
and correct patch for issue 740423.

 Detected by Coverity Scan. Issues 751097, 740423, 751096

12 years agoSourceFormat Enforcement
Automatic source maintenance [Fri, 14 Dec 2012 01:13:32 +0000 (18:13 -0700)] 
SourceFormat Enforcement

12 years agocert validation cache
Christos Tsantilas [Thu, 13 Dec 2012 22:31:55 +0000 (00:31 +0200)] 
cert validation cache

This patch add cache to cert validation helper. The following new options
added to "sslcrtvalidator_program" configuration parameter to control cache
behaviour:
   ttl=n         TTL in seconds for cached results.The default is 60 secs
   cache=n       limit the result cache size. The default value is 2048

To implement the cert validation cache a new template class investigated,
the LruMap which implements a simple lru cache.

The LruMap templete class also used to replace the old Ssl::LocalContextStorage
class which implements a SSL contexts cache.

This is a Measurement Factory project

12 years agoSSL server certificate validator implementation: remove more "#if 1 //USE_SSL_CERT_VA...
Christos Tsantilas [Thu, 13 Dec 2012 21:51:36 +0000 (23:51 +0200)] 
SSL server certificate validator implementation: remove more "#if 1 //USE_SSL_CERT_VALIDATOR" conditionals

12 years agoSSL server certificate validator implementation: remove "#if 1 //USE_SSL_CERT_VALIDAT...
Christos Tsantilas [Thu, 13 Dec 2012 21:39:46 +0000 (23:39 +0200)] 
SSL server certificate validator implementation: remove "#if 1 //USE_SSL_CERT_VALIDATOR" conditionals

12 years agoFix memory leaks in Kerberos LDAP group helper
Markus Moeller [Thu, 13 Dec 2012 07:34:45 +0000 (00:34 -0700)] 
Fix memory  leaks in Kerberos LDAP group helper

Memory was not released when parsing invalid input config parameters.

 Detected by Coverity Scan. Issue 740421, 740423, 740424.

12 years agoBug 3650: Negotiate auth missing challenge token
Steve Hill [Wed, 12 Dec 2012 04:35:22 +0000 (21:35 -0700)] 
Bug 3650: Negotiate auth missing challenge token

12 years agoBug 3712: Rotating logs overwrites the previous log
Markus Rietzler [Mon, 10 Dec 2012 12:05:29 +0000 (05:05 -0700)] 
Bug 3712: Rotating logs overwrites the previous log

12 years agoPrep for 3.2.5
Amos Jeffries [Mon, 10 Dec 2012 07:15:18 +0000 (00:15 -0700)] 
Prep for 3.2.5

12 years agoFix helper buffer management
Amos Jeffries [Sat, 8 Dec 2012 01:50:46 +0000 (14:50 +1300)] 
Fix helper buffer management

Identified by Tsantilas Christos.

"One byte remains in helpers io buffer after parsing the response. This is
will cause problems when the next response from helper will enter squid.

After the  srv->rbuf parsed, the srv->rbuf still contains on byte (a '\0'
char) and the srv->roffset is 1."

Perform memmove() in helperHandleRead() instead of helperReturnBuffer()

* helperReturnBuffer is only dealing with the message sub-string, but has
  been made to memmove() the buffer contents which means it has to become
  aware of these problematic terminal \0 octet(s). However
  helperHandleRead() is where the termination is being done and the
  buffer information is all being handled.

Pass the first of the termination \0 octets to helperReturnBuffer() not
the last \0. This is made possible after fixing (1a).

* helpers which return \r\n were still passing the location of the \n as
  endpoint to workaround (1a) even though the \r is also replaced with
  \0 and shortens the msg portion by one octet. This affects the
  HelperReply parser length checks on responses without kv-pair.

Also, clear out an obsolete TODO.

Also, document a remaining design issue in stateful helpers assuming each
read() operation is on response and ignoring any octets in the buffer
after parsing one reply.

12 years agoSSL server certificate validator implementation: Ssl::CertValidationMsg::parseRespons...
Christos Tsantilas [Fri, 7 Dec 2012 14:00:13 +0000 (16:00 +0200)] 
SSL server certificate validator implementation: Ssl::CertValidationMsg::parseResponse fix

The parsed SSL errors returned by cert validator checking is wrong and causes
the Ssl::CertValidationMsg::parseResponse method to return false on valid
messages

12 years agoBug 3709: Wrong url at the end of ./configure --help
Amos Jeffries [Fri, 7 Dec 2012 10:41:11 +0000 (23:41 +1300)] 
Bug 3709: Wrong url at the end of ./configure --help

12 years agoDocs: fix confusing channel-ID description on URL-rewrite interface
Amos Jeffries [Thu, 6 Dec 2012 00:05:33 +0000 (13:05 +1300)] 
Docs: fix confusing channel-ID description on URL-rewrite interface

12 years ago"SSL server certificate fingerprint ACL type" patch: trunk does not build on amd64...
Christos Tsantilas [Wed, 5 Dec 2012 18:09:48 +0000 (20:09 +0200)] 
"SSL server certificate fingerprint ACL type" patch: trunk does not build on amd64-CentOs-icc

12 years agoSSL server certificate fingerprint ACL type
Christos Tsantilas [Wed, 5 Dec 2012 14:18:13 +0000 (16:18 +0200)] 
SSL server certificate fingerprint ACL type

This patch add the "server_ssl_cert_fingerprint" acl type to match against
server SSL certificate fingerprint.
The new acl type has the form:
  acl aclname server_ssl_cert_fingerprint [-sha1] fingerprint1 ...

The fingerprint must given in the form:
    XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX
where X are any valid hexadecimal number

Example usage:
acl BrokeServer dst 192.168.1.23
acl GoodCert server_ssl_cert_fingerprint AB:2A:82:AF:46:AE:1F:31:21:74:65:BF:56:47:25:D1:87:51:41:AE
sslproxy_cert_error allow BrokeServer GoodCert
sslproxy_cert_error deny all

This is a Measurement Factory project

12 years agorun formater
Christos Tsantilas [Wed, 5 Dec 2012 14:17:35 +0000 (16:17 +0200)] 
run formater

12 years agomerge from trunk r12502
Christos Tsantilas [Wed, 5 Dec 2012 14:13:05 +0000 (16:13 +0200)] 
merge from trunk r12502

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 5 Dec 2012 01:13:21 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agomerge from parent SslServerCertValidator r12337
Christos Tsantilas [Tue, 4 Dec 2012 17:30:30 +0000 (19:30 +0200)] 
merge from parent SslServerCertValidator r12337

13 years agoSSL server certificate validator implementation
Christos Tsantilas [Tue, 4 Dec 2012 14:29:02 +0000 (16:29 +0200)] 
SSL server certificate validator implementation

This patch implements the certificate validation helper interface described at:
  http://wiki.squid-cache.org/Features/SslServerCertValidator

The helper consulted after the internal OpenSSL validation, regardless of the
validation results. The helper will receive:
   1) the origin server certificate [chain],
   2) the intended domain name, and
   3) a list of OpenSSL validation errors (if any).

If the helper decides to honor an OpenSSL error or report another validation
error(s), the helper will return:
   1) A list of certificates.
   2) A list of items consists the the validation error name (see %err_name
      error page macro and %err_details logformat code), error reason
      (%ssl_lib_error macro), and the offending certificate.

The returned information mimics what the internal OpenSSL-based validation code
collects now. Returned errors, if any, fed to sslproxy_cert_error, triggering
the existing SSL error processing code.

The helper invocation controlled by the "sslcrtvalidator_program" and
"sslcrtvalidator_children" configurations options which are similar to the
ssl_crtd related options.

A simple testing cert validation helper developed in perl included in this
patch. This helper just echo back the certificate errors.

This is a Measurement Factory Project

13 years agoParse validation helper response bug
Christos Tsantilas [Tue, 4 Dec 2012 12:49:21 +0000 (14:49 +0200)] 
Parse validation helper response bug

- CertValidationResponse bug: The CertValidationResponse::RecvdError::id is
  not intialized in constructors

- Inside Ssl::CertValidationMsg::parseResponse, after parsing response run
  through the parsed errors for errors.

13 years agominor fix to build after latest merge from trunk
Christos Tsantilas [Tue, 4 Dec 2012 12:49:01 +0000 (14:49 +0200)] 
minor fix to build after latest merge from trunk

13 years agomerge from trunk r12500
Christos Tsantilas [Tue, 4 Dec 2012 10:17:43 +0000 (12:17 +0200)] 
merge from trunk r12500

13 years agoAdd missing initializer from rev.12495
Amos Jeffries [Sun, 2 Dec 2012 23:10:23 +0000 (12:10 +1300)] 
Add missing initializer from rev.12495

Fixes segfault in testHttpRequest destructor testing.

13 years agoPrep for 3.3.0.2, 3.2.4, 3.1.22
Amos Jeffries [Sun, 2 Dec 2012 08:24:33 +0000 (01:24 -0700)] 
Prep for 3.3.0.2, 3.2.4, 3.1.22

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sun, 2 Dec 2012 01:13:09 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoBug 3688: Lots of Orphan Comm:Connections to ICAP server
Alexander Komyagin [Sat, 1 Dec 2012 03:32:44 +0000 (20:32 -0700)] 
Bug 3688: Lots of Orphan Comm:Connections to ICAP server

13 years agoSourceFormat Enforcement
Automatic source maintenance [Sat, 1 Dec 2012 01:20:32 +0000 (18:20 -0700)] 
SourceFormat Enforcement

13 years agoAdd kv-pair support to url_rewrite_helper interface
Amos Jeffries [Fri, 30 Nov 2012 23:02:11 +0000 (12:02 +1300)] 
Add kv-pair support to url_rewrite_helper interface

This stage of the helper reply protocol adds kv-pair support to the
url_rewrite_helper interfacefor URL redirect and rewrite operations.

It uses the new Notes objects and kv-pair field added by the stage 2
helper protocol instead of parsing the 'other' field. Although,
the 'other' field is still parsed when *no* result field is received
for backward compatibility with older helpers.

The response syntax for URL helpers becomes:
  [channel-ID SP] result [SP kv-pair ...] [SP other] EOL

NP: 'other' field is now deprecated and will be ignored/discarded on any
  response containing a result code field.

When result code "OK" is presented by the helper several kv-pairs are
reserved to control Squid actions:

* "rewrite-url=" is added to return a re-written URL.
 - When this key is presented the URL is re-written to the new one by
   Squid without client interaction.
 - The 'url' keys presence will override this key.

* "url=" is added to return the redirected-to URL.
 - When this key name is presented an HTTP redirect response is generated
   for the client.
 - This keys presence overrides the 'rewrite-url' key actions.

* "status=" is added to hold the HTTP status code for use in redirect
  operations.
 - This field is optional and status is no longer required for marking
   redirect actions.
 - If no redirect status is provided Squid will assign one (currently the
   default is 302, that may change in the future).
 - This key is only relevant when 'url' key is also presented. In all
   other uses it is currently ignored.

When result codes BH or ERR are presented by the helper no redirect or
rewrite action is performed and no kv-pair key names are reserved for use
at this time.

Any other keys MAY be sent on any response. The URL helper interface
makes no other use of them, but this patch does pass them on to the ALE
object for logging as transaction Notes. All kv-pairs returned by the
helper (including the url, stauts rewrite-url keys) are available for
logging via the %{...}note log format option.

As with changes to other helpers interfaces in earlier updates, only
the first value presented for any of the reserved kv-pairs is used.
Multiple values are accepted as notes, but otherwise ignored by Squid and
do not affect the transaction outcome.

Additionally, when the BH result code is received from the helper a
simple recovery is attempted. The lookup request will be re-scheduled (up
to once) in an attempt to find a better responding helper.

NOTE: Helper notes are *not* passed to adaptation interfaces.
 - REQMOD adaptation happens before URL helpers are used.
 - REPMOD adaptation may at some point receive them, but that change is
   not done by this update.

 This update was sponsored by Edgewave.

13 years agoDocs: doxygenate the HttpRequest::helperRnotes member
Amos Jeffries [Fri, 30 Nov 2012 22:57:54 +0000 (11:57 +1300)] 
Docs: doxygenate the HttpRequest::helperRnotes member

13 years agoTypo in HttpRequest
Amos Jeffries [Fri, 30 Nov 2012 22:54:46 +0000 (11:54 +1300)] 
Typo in HttpRequest

13 years agoPolish: Improve the messages output by UFS swap log management.
Amos Jeffries [Fri, 30 Nov 2012 11:57:23 +0000 (04:57 -0700)] 
Polish: Improve the messages output by UFS swap log management.

It also includes a small local variable symbol change from "new_path" to
"tmp_path" to prevent future developer mistakes like the one seen in
bug 3663 mistaking "new_path" for the new destination path of xrename().

13 years agoMerged from trunk
Amos Jeffries [Fri, 30 Nov 2012 11:24:03 +0000 (00:24 +1300)] 
Merged from trunk

13 years agoAdd kv-pir support to url_rewrite_helper interface
Amos Jeffries [Fri, 30 Nov 2012 11:08:47 +0000 (00:08 +1300)] 
Add kv-pir support to url_rewrite_helper interface

This stage of the helper reply protocol adds kv-pair support to the
url_rewrite_helper interfacefor URL redirect and rewrite operations.

It uses the new Notes objects and kv-pair field added by the stage 2
helper protocol instead of parsing the 'other' field. Although,
the 'other' field is still parsed when *no* result field is received
for backward compatibility with older helpers.

The response syntax for URL helpers becomes:
  [channel-ID SP] result [SP kv-pair ...] [SP other] EOL

NP: 'other' field is now deprecated and will be ignored/discarded on any
  response containing a result code field.

When result code "OK" is presented by the helper several kv-pairs are
reserved to control Squid actions:

* "rewrite-url=" is added to return a re-written URL.
 - When this key is presented the URL is re-written to the new one by
   Squid without client interaction.
 - The 'url' keys presence will override this key.

* "url=" is added to return the redirected-to URL.
 - When this key name is presented an HTTP redirect response is generated
   for the client.
 - This keys presence overrides the 'rewrite-url' key actions.

* "status=" is added to hold the HTTP status code for use in redirect
  operations.
 - This field is optional and status is no longer required for marking
   redirect actions.
 - If no redirect status is provided Squid will assign one (currently the
   default is 302, that may change in the future).
 - This key is only relevant when 'url' key is also presented. In all
   other uses it is currently ignored.

When result codes BH or ERR are presented by the helper no redirect or
rewrite action is performed and no kv-pair key names are reserved for use
at this time.

Any other keys MAY be sent on any response. The URL helper interface
makes no other use of them, but this patch does pass them on to the ALE
object for logging as transaction Notes. All kv-pairs returned by the
helper (including the url, stauts rewrite-url keys) are available for
logging via the %{...}note log format option.

As with changes to other helpers interfaces in earlier updates, only
the first value presented for any of the reserved kv-pairs is used.
Multiple values are accepted as notes, but otherwise ignored by Squid and
do not affect the transaction outcome.

Additionally, when the BH result code is received from the helper a
simple recovery is attempted. The lookup request will be re-scheduled (up
to once) in an attempt to find a better responding helper.

NOTE: Helper notes are *not* passe to adaptation interfaces.
 - REQMOD adaptation happens before URL helpers are used.
 - REPMOD adaptation may at some point receive them, but that change is
   not done by this update.

 This update was sponsored by Edgewave.

13 years agoRemove unnecessary xmemset()
Amos Jeffries [Thu, 29 Nov 2012 08:51:27 +0000 (01:51 -0700)] 
Remove unnecessary xmemset()

Was a simple wrapper around memset() to add debugs() traces. However
other profiling tools can trace memset far better.

13 years agoFix accept_filter on Linux
Amos Jeffries [Wed, 28 Nov 2012 09:49:15 +0000 (22:49 +1300)] 
Fix accept_filter on Linux

accept_filter directive on Linux requires TCP_DEFER_ACCEPT which
in turn requires netinet/tcp.h. This was removed when splitting comm
into libcomm.la.

13 years agoSourceFormat Enforcement
Automatic source maintenance [Wed, 28 Nov 2012 01:13:21 +0000 (18:13 -0700)] 
SourceFormat Enforcement

13 years agoStage 2 synced with trunk
Amos Jeffries [Tue, 27 Nov 2012 22:04:18 +0000 (11:04 +1300)] 
Stage 2 synced with trunk

13 years agoHelper protocol upgrade: add optional kv-pair field to responses
Amos Jeffries [Tue, 27 Nov 2012 22:02:02 +0000 (11:02 +1300)] 
Helper protocol upgrade: add optional kv-pair field to responses

This adds an optional kv-pair field immediately following the result field
on all helper interface responses. This field contains a list of key=value
pairs where the value is a RFC1738 (URL) encoded token or a quoted string.
Quoted-string MAY contain whitespace and shell escaping.

The response syntax for all helpers becomes:
  [channel-ID SP] result [SP key-pair ...] [SP other] EOL

The parser for HelperReply is also updated to map the old AF and NA
NTLM/Negotiate response fields into the HelperReply notes:
 * "token=" is added to supply the NTLM and Negotiate server blob/token.
 * "user=" is added to supply the user label field.
The relevant callback handlers are updated for these helpers to make use
of these new keys.

The bundled Digest authentication helpers are all upgraded to send the new
format responses. They now use ERR for failed lookup, BH for internal
errors, and OK with "ha1=" key added to supply a HA1 response. The handler
for Digest authentication is updated to process the new HelperReply fields
with failover the old format on Unknown result codes.

The external ACL handler is updated to pull its key=value pairs out of the
Notes list. The old parser loop becomes useless with this and is removed.
Taking with it support for several long deprecated keys "login=", "passwd=",
and "error=" which are now ignored.

Any other keys MAY be sent on any response. However at this stage 2 patch
they are ignored. As are repeated / secondary values for the expected key
names, only the first instance sent in the response is used.

13 years agoMerged from trunk
Amos Jeffries [Tue, 27 Nov 2012 21:31:35 +0000 (10:31 +1300)] 
Merged from trunk

13 years agoAudit Review updates
Amos Jeffries [Tue, 27 Nov 2012 21:19:46 +0000 (10:19 +1300)] 
Audit Review updates

* guarantee that note values output by the HelperReply parser are ""
  nil-terminated string and not undefined String.
* rename HelperReply::responseKeys to 'notes'
* rename Notes::findByName() to find()
* add Note::firstValue() to locate first value provided for a given key
  and present it as a char* terminated string
* various documentation updates

13 years agoTreat no-cache and must-revalidate in Authentication
Amos Jeffries [Tue, 27 Nov 2012 10:57:12 +0000 (23:57 +1300)] 
Treat no-cache and must-revalidate in Authentication

Wrapped as a violation because this operation is off-spec.

CC:no-cache was omitted from the HTTP spec apparently on grounds that
changing its caching effects on authentication would come as a surprise.
The actual operation is safe enough to use when parameterless no-cache
is treated strictly as an alias for must-revalidate (as done by Squid now).

Ref: http://lists.w3.org/Archives/Public/ietf-http-wg/2012OctDec/0387.html

13 years agoMake it possible to match empty header field values using req_header and rep_header.
Alex Rousskov [Mon, 26 Nov 2012 18:54:43 +0000 (11:54 -0700)] 
Make it possible to match empty header field values using req_header and rep_header.

Warning: Some req_header and rep_header ACLs that were [accidentally] not
matching empty headers (e.g., "^$" or ".*") will now start matching them.

A new HttpHeader::getByNameIfPresent() method is added to be able to detect
presence of empty header fields while ACLHTTPHeaderData::match() is adjusted
to convert undefined String values into empty c-strings ("") for
ACLRegexData::match() to work.

Prior to these changes, when trying to match an empty header value with a
regex like "^$", ACLHTTPHeaderData::match() would return false because:

  * HttpHeader::getStrOrList() and getByName() return an undefined String.
  * String::termedBuf() returns NULL for undefined Strings; and
  * ACLRegexData::match() always fails on NULL c-strings.

13 years agoBug 3685: Squid hangs in ClassCBucket::update
Amos Jeffries [Mon, 26 Nov 2012 11:13:08 +0000 (04:13 -0700)] 
Bug 3685: Squid hangs in ClassCBucket::update

13 years agoAmos requested changes
Christos Tsantilas [Sat, 24 Nov 2012 15:44:47 +0000 (17:44 +0200)] 
Amos requested changes

13 years agomerge from parent
Christos Tsantilas [Sat, 24 Nov 2012 15:12:32 +0000 (17:12 +0200)] 
merge from parent