]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't schedule excess_renegotiations_callback unless it's set
authorNick Mathewson <nickm@torproject.org>
Sun, 27 Nov 2011 13:21:59 +0000 (08:21 -0500)
committerNick Mathewson <nickm@torproject.org>
Sun, 27 Nov 2011 13:21:59 +0000 (08:21 -0500)
Partial fix for bug 4587; reported by "frosty_un".

src/common/tortls.c

index 0571b346dd8f235f3df90e09fbf6f86e12381527..e052c85eb228175bca0b5b2c79cbd666e32c47a4 100644 (file)
@@ -1318,7 +1318,8 @@ tor_tls_got_client_hello(tor_tls_t *tls)
     }
 
     tls->got_renegotiate = 1;
-  } else if (tls->server_handshake_count > 2) {
+  } else if (tls->server_handshake_count > 2 &&
+             tls->excess_renegotiations_callback) {
     /* 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