if (type == SSL_CB_ACCEPT_LOOP && ssl->state == SSL3_ST_SW_SRVR_HELLO_A) { /* Call tor_tls_got_client_hello() for every SSL ClientHello we receive. */
As OpenSSL's code says, such conditions happens not after ClientHello recved. It happens already when serverhello sent. It's too late for accurate counting cleinthello with limit renegs.
Server shouldn't say hello if doesn't want a new clienthello.
Correct states for such case is
SSL3_ST_SR_CLNT_HELLO_A || SSL3_ST_SR_CLNT_HELLO_B || SSL3_ST_SR_CLNT_HELLO_C (reason is non blocking io)
Trac: Username: troll_un
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
/* We got more than one renegotiation requests. The Tor protocol needs just one renegotiation; more than that probably means They are trying to DoS us and we have to stop them. We can't close their connection from in here since it's an OpenSSL callback, so we set a libevent timer that triggers in the next event loop and closes the connection. */ if (tor_run_in_libevent_loop(tls->excess_renegotiations_callback, tls->callback_arg) < 0) { log_warn(LD_GENERAL, "Didn't manage to set a renegotiation " "limiting callback."); }
Server anyway continues handshaking while looping ssl3_accept() and sends hellos and key stuff and anything that it can to do for nonblocking io.
IIUC, this isn't a correctness issue so much as it is an anti-renegotiation-DOS issue. It matters when we go back and try to merge in the reverted renegotiation-counting code again in 0.2.4.x. For 0.2.3.x, though, it doesn't help.
Trac: Milestone: Tor: 0.2.3.x-final to Tor: 0.2.4.x-final
Okay, this ticket is a mess, but it appears that we merged fixes for many of the above issues. In the long term, the multi-clienthello vector is probably just better off getting fixed through dropping v2 handshakes and migrating to TLS 1.3
Trac: Severity: N/Ato Normal Sponsor: N/AtoN/A Status: new to closed Reviewer: N/AtoN/A Resolution: N/Ato wontfix