Commit Graph

1046 Commits

Author SHA1 Message Date
Daniel Roethlisberger
a5660fa3c9 Update NEWS 2014-01-14 00:29:45 +01:00
Daniel Roethlisberger
2235e1aad9 Fix memory leak in fake cert generation code
The code in pxy_ossl_servername_cb() which generated the forged
certificates did not call SSL_CTX_free() on the newly allocated SSL_CTX
struct after associating it with the SSL struct, which increments the
reference count internally.  Also add some comments explaining OpenSSL
reference counting behaviour to be more explicit on what happens to the
instances that OpenSSL keeps track of.
2014-01-13 23:56:59 +01:00
Daniel Roethlisberger
05410fe9b3 Enable SSL_MODE_RELEASE_BUFFERS by default 2014-01-13 23:33:31 +01:00
Daniel Roethlisberger
202b1270e3 Create session.pem without Internet connectivity
Use openssl s_server in order to create a temporary SSL server for
creating an SSL session dump for the unit tests to work with.  This
removes the requirement of having Internet connectivity for running the
test suite, which prevented package builds from running the unit tests.
2014-01-11 21:49:05 +01:00
Daniel Roethlisberger
54685bab6d Update NEWS 2014-01-11 19:14:11 +01:00
Daniel Roethlisberger
56842b2f63 Fix file descriptor leak in passthrough mode (-P)
When using passthrough mode, if a connection to a server fails with an
SSL error, sslsplit falls back to plain TCP passthrough.  When
reconnecting with plain TCP, the SSL context was freed, but the file
descriptor was never closed.  The fix remedies that by calling the
proper cleanup function for the dst bev before reconnecting.

Reported by:	Peter Haag
2014-01-11 19:12:00 +01:00
Daniel Roethlisberger
e129041c1c Add some OpenSSL refcounting comments 2014-01-11 19:03:15 +01:00
Daniel Roethlisberger
c8723506e7 Update NEWS 2014-01-11 17:55:17 +01:00
Daniel Roethlisberger
e7ba15f184 Remove unused variable 2014-01-11 17:55:01 +01:00
Daniel Roethlisberger
4849a9738b Set ssl fields to NULL after freeing 2014-01-11 17:35:36 +01:00
Daniel Roethlisberger
7b09128ead Fix double free of SSL_CTX
Remove a superfluous call to SSL_CTX_free() which caused SSL_CTX
structures to be free'd twice under some circumstances.

Issue:		#16
Reported by:	Amit Chowdhary
2014-01-11 17:30:06 +01:00
Daniel Roethlisberger
b82ca9b414 Print status of free'd SSL structs in debug mode 2014-01-11 17:28:41 +01:00
Daniel Roethlisberger
de27f40b04 Fix two typos in comments 2014-01-11 15:17:31 +01:00
Daniel Roethlisberger
bccbdbf1cc Free SSL_CTX directly after calling SSL_new()
Since SSL_new() increments the refcount of the passed SSL_CTX, free it
directly after handing it to SSL_new() instead of later after SSL_free().
2014-01-11 00:39:28 +01:00
Daniel Roethlisberger
a42db4d3fe Also undefine rdport in Mac pf support hack 2014-01-10 15:09:21 +01:00
Daniel Roethlisberger
6643d832d9 Add experimental support for pf on Mac OS X
Support pf rdr on Mac OS X 10.7, 10.8 and 10.9 by including the missing
Apple headers in the source tree and enable private Apple code.  Since
we are using an interface marked private by Apple, this code is very
experimental.

Issue:		#15
Reported by:	Amit Chowdhary
2014-01-10 15:03:13 +01:00
Daniel Roethlisberger
032605e9d3 Update khash to 0.2.8 2014-01-10 15:03:13 +01:00
Daniel Roethlisberger
cfa5b15223 Fix dst bufferevent BEV_EVENT_CONNECTED handler
This removes the spurious "Unknown bufferevent 0x80" debug message but
does not have any change in functionality, since return would have been
called anyway after falling down the debug message.

While here, remove the useless "ignoring event" debug message unless
DEBUG_PROXY is defined, and also print the timeout flag in debug mode.
2014-01-10 12:08:26 +01:00
Daniel Roethlisberger
a0bf21b1a4 Add basic pthread sanity check test case
Issue:		#13
Reported by:	vinies
2014-01-08 02:06:46 +01:00
Daniel Roethlisberger
90fd8ec28e Update NEWS 2014-01-07 23:18:16 +01:00
Daniel Roethlisberger
13ed7f8425 Slightly improve error logging on log init failure
Issue:		#13
Reported by:	vinies
2014-01-06 19:03:29 +01:00
Daniel Roethlisberger
06a02f946a Always explicitly name the non-null arguments
Always explicitly name which arguments are non-null, even if all
arguments are non-null.  This is to avoid bugs where newly added
arguments are automatically non-null by accident, possibly leading to
optimisation errors.

This also fixes a few potential errors related to non-null arguments;
specifically it prevents the compiler optimising away a test for sni
being NULL in cachedsess_mkkey().

Issue:		#14
Reported by:	kythyria
2014-01-06 14:28:33 +01:00
Daniel Roethlisberger
ca923ee7f1 Update copyright notices to 2014 2014-01-06 14:09:18 +01:00
Daniel Roethlisberger
7839de3b0d Update NEWS 2013-12-23 14:39:15 +01:00
Daniel Roethlisberger
13c85ce5c1 Also build ipfw if pf is detected
OpenBSD 4.7+ and FreeBSD 9.0+ also include ipfw-style divert-to in pf,
so build ipfw NAT engine as well if pf is detected.

Reported by:	Stuart Henderson
2013-12-23 14:27:39 +01:00
Daniel Roethlisberger
8cc81c7f1c FreeBSD pf also has divert-to since 9.0-RELEASE 2013-12-23 14:13:27 +01:00
Daniel Roethlisberger
0987300e28 Improve IPFW and pf wording in the documentation 2013-12-23 13:57:57 +01:00
Daniel Roethlisberger
68a60b9734 Update manual page for OpenBSD
Add configuration examples for both old and new OpenBSD pf syntax and
give an example of using OpenBSD pf divert sockets for redirection.
Based on the OpenBSD port patchset.

Reported by:	Stuart Henderson
2013-12-17 15:28:30 +01:00
Daniel Roethlisberger
fc29806663 Fix off by one error in thrmgr error cleanup code
This should remove another potential source of segmentation faults when
the thread manager fails to start.

Issue:          #10
Reported by:    linuxton
2013-08-24 21:44:40 +02:00
Daniel Roethlisberger
29f912096b More verbose debugging in pxy_thrmgr_run() 2013-08-23 17:28:08 +02:00
Daniel Roethlisberger
080604e3c2 Fix segfault after thread manager start failure
This should fix the segmentation fault in issue #10 but not the
underlying reason why the thread manager fails to start in the first
place.

Issue:          #10
Reported by:    linuxton
2013-08-23 16:56:12 +02:00
Daniel Roethlisberger
a94dbc8c3a Refactor event handler for clarity 2013-08-23 15:07:07 +02:00
Daniel Roethlisberger
054ae555b5 Enable unit tests on Travis CI 2013-07-03 15:53:52 +02:00
Daniel Roethlisberger
22d98f2c21 Add Travis-CI configuration 2013-07-03 15:34:30 +02:00
Daniel Roethlisberger
33692df51a SSLsplit 0.4.7 release 2013-07-02 16:06:16 +02:00
Daniel Roethlisberger
a0fd9c1050 Start thrmgr threads after forking 2013-07-02 15:54:46 +02:00
Daniel Roethlisberger
c73ce64c16 Update README and manual page for HPKP prevention 2013-06-29 23:29:31 +02:00
Daniel Roethlisberger
1e67db0b66 Update NEWS after merge of feature/resphdrfilter 2013-06-29 22:52:29 +02:00
Daniel Roethlisberger
38280818f8 Add HTTP content-length to connect log 2013-06-29 22:50:39 +02:00
Daniel Roethlisberger
b746a6f6bb Add HTTP response header filtering
Filter response headers in order to remove HPKP headers.  As an added
benefit, parse the HTTP status code and add it to the connection log.
2013-06-29 22:35:51 +02:00
Daniel Roethlisberger
82bbae7fde make test requires Internet connectivity 2013-06-27 09:59:18 +02:00
Daniel Roethlisberger
b662906f9b SSLsplit 0.4.6 release 2013-06-03 17:58:03 +02:00
Daniel Roethlisberger
8fceac4201 Update NEWS for issue #9 2013-05-27 00:29:02 +02:00
Daniel Roethlisberger
2a4a9c8b23 Fix fallback to passthrough when no cert present
Properly reset connection state when reconnecting the dst part of the
connection.  This fixes the fallback to passthrough when no certficates
are present which can be used to split the SSL.

Issue:          #9
Reported by:    ceear
2013-05-27 00:22:45 +02:00
Daniel Roethlisberger
ac9a2613e0 Only generate RSA leaf key if CA key present
Issue:          #9
Reported by:    ceear
2013-05-27 00:17:36 +02:00
Daniel Roethlisberger
9f23fb31aa Log new bev connections to debug log 2013-05-27 00:03:05 +02:00
Daniel Roethlisberger
b06a2474f5 Shortcut errlog thrqueue in debug mode 2013-05-27 00:01:44 +02:00
Daniel Roethlisberger
c972501063 Update copyright notices 2013-04-24 20:36:38 +02:00
Daniel Roethlisberger
711448759c Bind to ports before dropping privileges
This fixes a regression which caused bind() to ports < 1024 to fail with
the default settings of dropping privileges to nobody.

Issue:          #8
Reported by:    Ian Grispan
2013-04-24 17:17:23 +02:00
Daniel Roethlisberger
f99e5e34a7 Improve workaround for OpenSSL 1.0.0k/1.0.1e
Extend and improve the workaround introduced in commit 20b3f66120.
Automatically replace SSL_get_certificate() with a drop-in replacement
if a version of OpenSSL known to be broken is used.  This now covers the
use of SSL_get_certificate() within the connection manager as well and
resolves one more case where OpenSSL could crash.
2013-04-24 17:15:49 +02:00