[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] [tor/master 38/38] Make the bufferevent code use the renegotiation-reenabling hack



Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Mon, 27 Sep 2010 16:07:14 -0400
Subject: Make the bufferevent code use the renegotiation-reenabling hack
Commit: 6950749c0afae7b7c1b6f9a311275d0ae86bbeb5

---
 src/common/tortls.c    |    3 +--
 src/common/tortls.h    |    1 +
 src/or/connection_or.c |    2 ++
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/common/tortls.c b/src/common/tortls.c
index bd6840a..ce5411a 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 0810d81..f8603b5 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 3e4a6e2..90e60e4 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 {
-- 
1.7.1