diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-08-25 00:34:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-25 00:34:23 -0400 |
commit | 2452302354fdd6d34e1637380ffc73af067fd904 (patch) | |
tree | 706a678ffdf0f3c5de50cee44efe1e2325a2c482 /src/or/connection_or.c | |
parent | 0fd8f5781b8535c1735d9f984ff833a3024ddc95 (diff) | |
parent | a5610cfa64189db693dbad3efaa973d6720c42fe (diff) | |
download | tor-2452302354fdd6d34e1637380ffc73af067fd904.tar.gz tor-2452302354fdd6d34e1637380ffc73af067fd904.zip |
Merge remote-tracking branch 'origin/maint-0.2.4'
Diffstat (limited to 'src/or/connection_or.c')
-rw-r--r-- | src/or/connection_or.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index 7912bfb7fc..120f732ce6 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -2112,6 +2112,12 @@ connection_or_send_netinfo(or_connection_t *conn) tor_assert(conn->handshake_state); + if (conn->handshake_state->sent_netinfo) { + log_warn(LD_BUG, "Attempted to send an extra netinfo cell on a connection " + "where we already sent one."); + return 0; + } + memset(&cell, 0, sizeof(cell_t)); cell.command = CELL_NETINFO; @@ -2153,6 +2159,7 @@ connection_or_send_netinfo(or_connection_t *conn) } conn->handshake_state->digest_sent_data = 0; + conn->handshake_state->sent_netinfo = 1; connection_or_write_cell_to_buf(&cell, conn); return 0; @@ -2281,7 +2288,7 @@ connection_or_compute_authenticate_cell_body(or_connection_t *conn, const tor_cert_t *id_cert=NULL, *link_cert=NULL; const digests_t *my_digests, *their_digests; const uint8_t *my_id, *their_id, *client_id, *server_id; - if (tor_tls_get_my_certs(0, &link_cert, &id_cert)) + if (tor_tls_get_my_certs(server, &link_cert, &id_cert)) return -1; my_digests = tor_cert_get_id_digests(id_cert); their_digests = tor_cert_get_id_digests(conn->handshake_state->id_cert); |