Commit Graph

117 Commits (8ad3b5db25300c61b7174fca006e79fb7a60c34c)

Author SHA1 Message Date
Soner Tari 8ad3b5db25 Defer all e2 setup until after parent is connected
Clean-up and improvements
7 years ago
Soner Tari 6975175117 Defer e2 setup until after parent is connected, to prevent multithreading issues
Refactoring, improvements
7 years ago
Soner Tari 4d88906d24 Clean up and improve 7 years ago
Soner Tari 4f6b207e57 Improve conn termination: Close children asap if there is no parent, close parent asap if there is no child 7 years ago
Soner Tari ad1f95e465 Remove conn mutexes: Use thrmgr mutex during attach/detatch only, do eveything in the same thread, do not touch the other threads
Flex, fix, and improve conn termination: Make it more similar to orig sslsplit code
Fix issues, and clean-up
7 years ago
Soner Tari ecfaf24614 Add more child info to conns list, and clean-up 7 years ago
Soner Tari 5047df8cba Fix some of the compiler warnings, rearrange, and clean-up 7 years ago
Soner Tari be54db770f Add comments, improvements, and clean-up 7 years ago
Soner Tari 0b0f6b21dc Add uuid to all conn mctxs, otherwise we cannot uniquely identify them, causing trouble especially while deleting conns
Fix issues, clean-up
7 years ago
Soner Tari 833e1903e1 Dump conn info list
Remove conns using delete list of timed out conns
Fix issues, improvements
7 years ago
Soner Tari c11ca7a195 Fix freeing of non-ssl buffer events and fds 7 years ago
Soner Tari 4a34c4792b travis-cgi.org issue seems to be gone now
Rely less on parent ctx, and more on meta ctx
Rearrange, improve, and clean-up
7 years ago
Soner Tari 82b58c2dab Fix multithreading
Clean-up
7 years ago
Soner Tari 9858928b73 Add debug levels, initial 7 years ago
Soner Tari ab600c8215 Leave if getsockname() fails 7 years ago
Soner Tari d71533f0b9 Remove SSL proxy specific header line from the packet on the egress exit
Insert our header line right after the first header line in the packet in case the packet is fragmented, otherwise Squid is confused when it cannot find our header line in the first packet
7 years ago
Soner Tari 85a96ec844 First working SSL version, surprisingly running so fine and stable for a first prototype that I think there is something wrong and it is just running in passthrough mode :), seriously this is just the beginning. 7 years ago
Soner Tari d033ea68dd Plain TCP version is running good enough, next will try to switch the SSL on 7 years ago
Daniel Roethlisberger ca7f20e442 Fix connect log for autossl connections 9 years ago
Daniel Roethlisberger e67978f4dd Merge branch 'develop' into feature/autossl 9 years ago
Daniel Roethlisberger 3c20f473fa Rename and improve autossl peeking function 9 years ago
Daniel Roethlisberger 9843ead5d7 Copy SNI hostname from OpenSSL if ctx->sni is NULL 9 years ago
Daniel Roethlisberger 2f834419eb Handle inbound EOF before outbound CONNECTED
Fix segmentation fault upon receiving BEV_EVENT_EOF on the inbound
bufferevent while the outbound bufferevent has not received
BEV_EVENT_CONNECTED yet.

Issue:		#124
Patch by:	Eun Soo Park
9 years ago
Daniel Roethlisberger 25b096450d Modernize DHE and ECDHE support
Enable full strength DHE and ECDHE by default in order to allow modern
browsers to connect without weak crypto warnings.

Issue:		#119
Reported by:	@curioustwo
9 years ago
Daniel Roethlisberger 0506024587 Update copyright notices to 2016 9 years ago
Daniel Roethlisberger b3b7a7ab17 Merge branch 'develop' into feature/autossl 9 years ago
Daniel Roethlisberger ba2f451f5e Fix bev write handler for other->closed case
When other->closed is set, the bufferevent write handler accesses
other->bev even though it is invalid.  Fix this access, and as added
layer of defense against future bugs, set ->bev to NULL whenever
invalidating it, except where the connection is torn down completely.

Reported by:	Eun Soo Park
Introduced in:	2bcfaf4 17d753f
Issue:		#109
9 years ago
Daniel Roethlisberger 17d753fc2d Fix NULL pointer dereference in bev write handler
Only manipulate other->bev if it is not NULL to avoid a NULL pointer
dereference in the proxy bufferevent write handler when only one
direction is fully established, for example during connection shutdown.

Reported by:	@david-holonet
Introduced in:	2bcfaf4
Issue:		#109
9 years ago
Daniel Roethlisberger 2bcfaf4b44 Re-enable EV_READ if disabled and outbuf empty
The event buffer write handler failes to re-enable the corresponding
read event of the opposite connection if the buffer is not only down to
less than half the limit, but completely emptied.  In that case, the
read event would never be re-enabled and the connection would stall and
time out.

Issue:		#109
Patch by:	Eun Soo Park
9 years ago
Daniel Roethlisberger 57a2ab8588 Rewrite protocol version macros and refactoring
Introduce HAVE_SSLV2, HAVE_SSLV3, HAVE_TLSV10, HAVE_TLSV11 and
HAVE_TLSV12 to indicate that support for the respective protocol is
available in OpenSSL.  This was necessary due to the increased
complexity of testing version support following the phasing out of SSLv2
and SSLv3 from OpenSSL implementations.  This fixes the build with
OpenSSL versions which have SSLv3 support removed.

While here, de-duplicate code for setting SSL_CTX options and do not set
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION anymore; it has no benefit
in the context of splitting SSL/TLS for analysis.

Reported by:	Jérémie Courrèges-Anglas
9 years ago
Daniel Roethlisberger 769da7565e Style fix 9 years ago
Daniel Roethlisberger a08a7233ab Move free() to the else branch where it belongs
This prevents free(NULL) in case of failures in ssl_x509_fingerprint().

Issue:		#103
Reported by:	@david-stratusee
9 years ago
Daniel Roethlisberger f12dd5bb92 Fix debug mode memory leak of cert fingerprint
Issue:		#103
Reported by:	Scot Loach
9 years ago
Daniel Roethlisberger 74f62c3e5e Refactor and unify ClientHello parsers
Refactor and unify ssl_tls_clienthello_identify() and the earlier
ssl_tls_clienthello_parse_sni() into a single
ssl_tls_clienthello_parse() function that handles parsing ClientHello
messages for different purposes.  As a result, rename the debug knob
DEBUG_SNI_PARSER into DEBUG_CLIENTHELLO_PARSER.
9 years ago
Daniel Roethlisberger 6671a82aed Rename genericstarttls to autossl and improve docs
Issue:		#87
10 years ago
Richard Poole 5c8b5e30d5 connection upgrade feature: upgrade tcp to ssl on client hello
This code looks at the beginning of each read from the src for something
that looks like an ssl client hello message; if it finds one it tries to
upgrade the connection to proxied ssl. So it works only in the simple
case where the connection has no binary data before the upgrade attempt
(so there are no false positives), and where the client hello comes at
the beginning of a packet from the source.
10 years ago
Richard Poole 0f2714ed8a spelling fix 10 years ago
Richard Poole 1f1f7b5559 bugfix: correct calls to log_dbg_printf 10 years ago
Daniel Roethlisberger 914360eb5e Separate host and port into separate strings
Store host and port in separate strings internally and get rid of the
[host]:port representation where separate host and port would be
cleaner.  This includes the following user-visible changes:

-   Generated filenames that contain host and port, such as by -S and
    -F %d and %s, now use a host,port format instead of [host]:port.

-   Connect log now uses separate fields for host and port.

Issue:		#69 #74
Reported by:	Adam Jacob Muller
10 years ago
Daniel Roethlisberger 91da4674e5 Update copyright, license and tagline
-   Update copyright to 2015
-   Remove the non-standard "unmodified" from the 2-clause BSD license
-   Remove scalable from the tagline to avoid misinterpretations
10 years ago
Daniel Roethlisberger f16783cee2 Move cert writer to logger thread using privsep
Make -w and -W work in conjunction with dropping privileges and
chrooting by moving the cert writer code to a separate logger thread and
using the privsep framework to open the files if they do not exist
already.

Issue:		#70
10 years ago
Daniel Roethlisberger 6ec6c56ded Refactored -w/-W and improved docs 10 years ago
PsychoMario 3aff928daf moved key output to main.c, caught some bugs 10 years ago
PsychoMario a83cd68605 stored fpr as char* in ctx 10 years ago
PsychoMario 1736564b32 error handling 10 years ago
PsychoMario 4f310a877a implemented -W to write original certs 10 years ago
PsychoMario a7e2d99b39 added logging of fingerprints, uppercased names 10 years ago
PsychoMario 13dce0aa35 moved write to pxy_srccert_create, -X to -w, opts_free use 10 years ago
PsychoMario 73042d4daa fix mutual exclusivity, sprintf->asprintf 10 years ago
PsychoMario cbb2a179f9 naive implementation with -X, no help, validation, logging 10 years ago