summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-10-25 10:15:03 -0400
committerNick Mathewson <nickm@torproject.org>2012-10-25 10:15:03 -0400
commitda336312eb7fde5cdc311465e2a9036ac60273e7 (patch)
tree314f983aa735fdd315424f3f48668a28937020b4 /src
parent89dc27b989509600a557181be376c7848800f02b (diff)
parent758428dd32128874cefacc92ef63c1b5bc9a656e (diff)
downloadtor-da336312eb7fde5cdc311465e2a9036ac60273e7.tar.gz
tor-da336312eb7fde5cdc311465e2a9036ac60273e7.zip
Merge branch 'link_negotiation_assert_023' into release-0.2.3
Diffstat (limited to 'src')
-rw-r--r--src/or/command.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/command.c b/src/or/command.c
index 975af046cd..d935b5b18d 100644
--- a/src/or/command.c
+++ b/src/or/command.c
@@ -719,6 +719,15 @@ command_process_versions_cell(var_cell_t *cell, or_connection_t *conn)
"handshake. Closing connection.");
connection_mark_for_close(TO_CONN(conn));
return;
+ } else if (highest_supported_version != 2 &&
+ conn->_base.state == OR_CONN_STATE_OR_HANDSHAKING_V2) {
+ /* XXXX This should eventually be a log_protocol_warn */
+ log_fn(LOG_WARN, LD_OR,
+ "Negotiated link with non-2 protocol after doing a v2 TLS "
+ "handshake with %s. Closing connection.",
+ fmt_addr(&conn->_base.addr));
+ connection_mark_for_close(TO_CONN(conn));
+ return;
}
conn->link_proto = highest_supported_version;