Commit Graph

16 Commits (ca7940576927837fa7440f193ef03e066cbbbc28)

Author SHA1 Message Date
Soner Tari 98cda54c47 Reduce and improve debug logs 4 years ago
Soner Tari 8b27cfce95 Decouple code for thrmgr and conn handling threads, so create pxythr.c/h 4 years ago
Soner Tari 033cb732ac Decouple conn init from fd readcb 4 years ago
Soner Tari 191109951d Switch from thrmgr to connection handling thread asap
This prevents possible multithreading issues between thrmgr and conn
handling threads. So we can remove and clean up the code and comments
related with such possible issues now. For example, we can add the conn
to its thread list earlier, and we can handle errors immediately, thanks
to this early switch to conn handling threads. This also helps achieve
cleaner code.
4 years ago
Soner Tari 554fd3bd3a Improve code reuse, reduce code, clean up whitespace 4 years ago
Soner Tari 20eb2533d1 Fix autossl crash upon protocol error, need fuzzing tests
This happens if there was no autossl handshake prior to ClientHello,
e.g. no STARTTLS message. This is perhaps due to the SSL handshake of a
direct SSL connection, i.e. invalid protocol.
We should not crash upon protocol errors, hence the need for fuzzing
tests.
4 years ago
Soner Tari efa2b48b94 Disable autossl passthrough
Autossl passthrough crashes with signal 10.
4 years ago
Soner Tari 5c2ac6d1bf Remove writecb for srvdst except for passthrough, remove srvdst_connected and dst_connected flags, clean up autossl
We don't do anything in srvdst writecb except for passhtrough mode.
We handle srvdst and dst connect tasks in connectcb for them by
arranging connect events correctly, so we don't need any extra flags.
Correct connect ordering helps us remove code checking if bev exists.
There were a lot of unnecessary code in autossl. Tcp and ssl code are
decoupled now.
4 years ago
Soner Tari a24ac850b4 Fix readcb and writecb before connected
Do not enable srvdst readcb until connected
Enable read and write callbacks only after connected
4 years ago
Soner Tari a0d74baa43 Update copyright year to 2020 4 years ago
Soner Tari a34c953ef0 Validate the response from the smtp server to protect the client
Because we directly relay the packets from the server to the client
until we receive the first packet from the client, at which time we xfer
srvdst to the first child conn and effectively disable this readcb,
hence start diverting packets to the listening program.
Improve documentation.
4 years ago
Soner Tari 1445a5cdf8 Fix smtp proto
We enable readcb for srvdst to relay the 220 smtp greeting from the
server to the client, otherwise the conn stalls.
Related with issue #18 too.
4 years ago
Soner Tari 1a0d46587b Check libevent version before calling bufferevent_openssl_set_allow_dirty_shutdown() 4 years ago
Soner Tari 9ad477e0a7 Fix misc issues with autossl
And various improvements
4 years ago
Soner Tari 3af16b3228 Improve verbose debug logs using common header fields to better identify connections
Create function macros for fine* debug logs
Fix a few memory leaks when DEBUG_PROXY enabled
Add main.mk to MKFS list
Put a few function params within DEBUG_PROXY directives
Check retval of a snprintf() call
Fix segfault with -w/-W options if no ssl proxyspec specified, also fixed in sslsplit develop: https://github.com/droe/sslsplit/issues/271
Various clean-up
4 years ago
Soner Tari 8eab8d1da8 Restructure source tree, create src and tests folders, move files accordingly
Remove docker
4 years ago