aboutsummaryrefslogtreecommitdiff
path: root/src/or/channel.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/channel.c
parent1c0e87f6d8c7a0abdadf1b5cd9082c10abc7f4e2 (diff)
downloadtor-8e8c0674c4729a6aa39ded658e800baa654fe289.tar.gz
tor-8e8c0674c4729a6aa39ded658e800baa654fe289.zip
Implement proposal-214 rules for CircID checking.
Diffstat (limited to 'src/or/channel.c')
-rw-r--r--src/or/channel.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/or/channel.c b/src/or/channel.c
index cbf7f99be1..9b353a102c 100644
--- a/src/or/channel.c
+++ b/src/or/channel.c
@@ -4043,9 +4043,10 @@ channel_num_circuits(channel_t *chan)
* This is called when setting up a channel and replaces the old
* connection_or_set_circid_type()
*/
-
void
-channel_set_circid_type(channel_t *chan, crypto_pk_t *identity_rcvd)
+channel_set_circid_type(channel_t *chan,
+ crypto_pk_t *identity_rcvd,
+ int consider_identity)
{
int started_here;
crypto_pk_t *our_identity;
@@ -4053,6 +4054,15 @@ channel_set_circid_type(channel_t *chan, crypto_pk_t *identity_rcvd)
tor_assert(chan);
started_here = channel_is_outgoing(chan);
+
+ if (! consider_identity) {
+ if (started_here)
+ chan->circ_id_type = CIRC_ID_TYPE_HIGHER;
+ else
+ chan->circ_id_type = CIRC_ID_TYPE_LOWER;
+ return;
+ }
+
our_identity = started_here ?
get_tlsclient_identity_key() : get_server_identity_key();