summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2009-11-05 18:13:08 -0500
committerNick Mathewson <nickm@torproject.org>2009-11-05 18:13:08 -0500
commitce0a89e2624471272ffc4950c5069d9b81a7f0b9 (patch)
tree3f430604ba70db318b670429c65e0f21ebca4e5e /src/or
parent54973a45a693cf3e0dada2572016fa6695a51e75 (diff)
downloadtor-ce0a89e2624471272ffc4950c5069d9b81a7f0b9.tar.gz
tor-ce0a89e2624471272ffc4950c5069d9b81a7f0b9.zip
Make Tor work with OpenSSL 0.9.8l
To fix a major security problem related to incorrect use of SSL/TLS renegotiation, OpenSSL has turned off renegotiation by default. We are not affected by this security problem, however, since we do renegotiation right. (Specifically, we never treat a renegotiated credential as authenticating previous communication.) Nevertheless, OpenSSL's new behavior requires us to explicitly turn renegotiation back on in order to get our protocol working again. Amusingly, this is not so simple as "set the flag when you create the SSL object" , since calling connect or accept seems to clear the flags. For belt-and-suspenders purposes, we clear the flag once the Tor handshake is done. There's no way to exploit a second handshake either, but we might as well not allow it.
Diffstat (limited to 'src/or')
-rw-r--r--src/or/connection_or.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index b4e80926be..2a52b3fcd6 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -844,6 +844,7 @@ connection_or_tls_renegotiated_cb(tor_tls_t *tls, void *_conn)
/* Don't invoke this again. */
tor_tls_set_renegotiate_callback(tls, NULL, NULL);
+ tor_tls_block_renegotiation(tls);
if (connection_tls_finish_handshake(conn) < 0) {
/* XXXX_TLS double-check that it's ok to do this from inside read. */
@@ -1087,6 +1088,7 @@ connection_tls_finish_handshake(or_connection_t *conn)
connection_or_init_conn_from_address(conn, &conn->_base.addr,
conn->_base.port, digest_rcvd, 0);
}
+ tor_tls_block_renegotiation(conn->tls);
return connection_or_set_state_open(conn);
} else {
conn->_base.state = OR_CONN_STATE_OR_HANDSHAKING;