summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-09-27 16:07:14 -0400
committerNick Mathewson <nickm@torproject.org>2010-09-27 16:07:14 -0400
commit6950749c0afae7b7c1b6f9a311275d0ae86bbeb5 (patch)
tree33797b3e031e281b47d055dd19585555c6b6050b /src
parent21e5f3c43197b4d844e25b5de8ff59c3304fd3dd (diff)
downloadtor-6950749c0afae7b7c1b6f9a311275d0ae86bbeb5.tar.gz
tor-6950749c0afae7b7c1b6f9a311275d0ae86bbeb5.zip
Make the bufferevent code use the renegotiation-reenabling hack
Diffstat (limited to 'src')
-rw-r--r--src/common/tortls.c3
-rw-r--r--src/common/tortls.h1
-rw-r--r--src/or/connection_or.c2
3 files changed, 4 insertions, 2 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index bd6840af70..ce5411a55e 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -195,7 +195,6 @@ static X509* tor_tls_create_certificate(crypto_pk_env_t *rsa,
const char *cname,
const char *cname_sign,
unsigned int lifetime);
-static void tor_tls_unblock_renegotiation(tor_tls_t *tls);
/** Global tls context. We keep it here because nobody else needs to
* touch it. */
@@ -1032,7 +1031,7 @@ tor_tls_set_renegotiate_callback(tor_tls_t *tls,
/** If this version of openssl requires it, turn on renegotiation on
* <b>tls</b>.
*/
-static void
+void
tor_tls_unblock_renegotiation(tor_tls_t *tls)
{
/* Yes, we know what we are doing here. No, we do not treat a renegotiation
diff --git a/src/common/tortls.h b/src/common/tortls.h
index 0810d81cd1..f8603b529b 100644
--- a/src/common/tortls.h
+++ b/src/common/tortls.h
@@ -66,6 +66,7 @@ int tor_tls_write(tor_tls_t *tls, const char *cp, size_t n);
int tor_tls_handshake(tor_tls_t *tls);
int tor_tls_finish_handshake(tor_tls_t *tls);
int tor_tls_renegotiate(tor_tls_t *tls);
+void tor_tls_unblock_renegotiation(tor_tls_t *tls);
void tor_tls_block_renegotiation(tor_tls_t *tls);
int tor_tls_shutdown(tor_tls_t *tls);
int tor_tls_get_pending_bytes(tor_tls_t *tls);
diff --git a/src/or/connection_or.c b/src/or/connection_or.c
index 3e4a6e22b8..90e60e49f0 100644
--- a/src/or/connection_or.c
+++ b/src/or/connection_or.c
@@ -1019,10 +1019,12 @@ connection_or_handle_event_cb(struct bufferevent *bufev, short event,
if (!tor_tls_is_server(conn->tls)) {
if (conn->_base.state == OR_CONN_STATE_TLS_HANDSHAKING) {
conn->_base.state = OR_CONN_STATE_TLS_CLIENT_RENEGOTIATING;
+ tor_tls_unblock_renegotiation(conn->tls);
if (bufferevent_ssl_renegotiate(conn->_base.bufev)<0) {
log_warn(LD_OR, "Start_renegotiating went badly.");
connection_mark_for_close(TO_CONN(conn));
}
+ tor_tls_unblock_renegotiation(conn->tls);
return; /* ???? */
}
} else {