aboutsummaryrefslogtreecommitdiff
path: root/src/or/channeltls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2012-11-06 21:33:53 -0500
committerNick Mathewson <nickm@torproject.org>2012-11-06 21:33:53 -0500
commit8e8c0674c4729a6aa39ded658e800baa654fe289 (patch)
tree5c32d38030f3a1e87e10bcb18908c85015afd984 /src/or/channeltls.c
parent1c0e87f6d8c7a0abdadf1b5cd9082c10abc7f4e2 (diff)
downloadtor-8e8c0674c4729a6aa39ded658e800baa654fe289.tar.gz
tor-8e8c0674c4729a6aa39ded658e800baa654fe289.zip
Implement proposal-214 rules for CircID checking.
Diffstat (limited to 'src/or/channeltls.c')
-rw-r--r--src/or/channeltls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/or/channeltls.c b/src/or/channeltls.c
index 4f87eb5671..ed56e1ad19 100644
--- a/src/or/channeltls.c
+++ b/src/or/channeltls.c
@@ -1384,7 +1384,8 @@ channel_tls_process_netinfo_cell(cell_t *cell, channel_tls_t *chan)
tor_assert(tor_digest_is_zero(
(const char*)(chan->conn->handshake_state->
authenticated_peer_id)));
- channel_set_circid_type(TLS_CHAN_TO_BASE(chan), NULL);
+ channel_set_circid_type(TLS_CHAN_TO_BASE(chan), NULL,
+ chan->conn->link_proto < MIN_LINK_PROTO_FOR_WIDE_CIRC_IDS);
connection_or_init_conn_from_address(chan->conn,
&(chan->conn->base_.addr),
@@ -1638,7 +1639,8 @@ channel_tls_process_certs_cell(var_cell_t *cell, channel_tls_t *chan)
ERR("Internal error: Couldn't get RSA key from ID cert.");
memcpy(chan->conn->handshake_state->authenticated_peer_id,
id_digests->d[DIGEST_SHA1], DIGEST_LEN);
- channel_set_circid_type(TLS_CHAN_TO_BASE(chan), identity_rcvd);
+ channel_set_circid_type(TLS_CHAN_TO_BASE(chan), identity_rcvd,
+ chan->conn->link_proto < MIN_LINK_PROTO_FOR_WIDE_CIRC_IDS);
crypto_pk_free(identity_rcvd);
}
@@ -1922,7 +1924,8 @@ channel_tls_process_authenticate_cell(var_cell_t *cell, channel_tls_t *chan)
memcpy(chan->conn->handshake_state->authenticated_peer_id,
id_digests->d[DIGEST_SHA1], DIGEST_LEN);
- channel_set_circid_type(TLS_CHAN_TO_BASE(chan), identity_rcvd);
+ channel_set_circid_type(TLS_CHAN_TO_BASE(chan), identity_rcvd,
+ chan->conn->link_proto < MIN_LINK_PROTO_FOR_WIDE_CIRC_IDS);
crypto_pk_free(identity_rcvd);
connection_or_init_conn_from_address(chan->conn,