summaryrefslogtreecommitdiff
path: root/src/or/circuitbuild.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-07 12:58:47 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-15 09:55:49 +1000
commit579a80d4ae54ec03fd9b02c4a125b2943770c85d (patch)
tree816ee00f3ed7dff2fe350d1a2fcb49469baea1ac /src/or/circuitbuild.c
parenta76d528bec970e500d3339d9e0f253bded17c338 (diff)
downloadtor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.tar.gz
tor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.zip
Clients avoid choosing nodes that can't do ntor
If we know a node's version, and it can't do ntor, consider it not running. If we have a node's descriptor, and it doesn't have a valid ntor key, consider it not running. Refactor these checks so they're consistent between authorities and clients.
Diffstat (limited to 'src/or/circuitbuild.c')
-rw-r--r--src/or/circuitbuild.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 13cc16670c..d6c5c85f2c 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -820,8 +820,8 @@ circuit_pick_create_handshake(uint8_t *cell_type_out,
/** Decide whether to use a TAP or ntor handshake for connecting to <b>ei</b>
* directly, and set *<b>handshake_type_out</b> accordingly. Decide whether,
- * in extending through <b>node</b> to do so, we should use an EXTEND2 or an
- * EXTEND cell to do so, and set *<b>cell_type_out</b> and
+ * in extending through <b>node_prev</b> to do so, we should use an EXTEND2 or
+ * an EXTEND cell to do so, and set *<b>cell_type_out</b> and
* *<b>create_cell_type_out</b> accordingly. */
static void
circuit_pick_extend_handshake(uint8_t *cell_type_out,
@@ -837,7 +837,8 @@ circuit_pick_extend_handshake(uint8_t *cell_type_out,
if (node_prev &&
*handshake_type_out != ONION_HANDSHAKE_TYPE_TAP &&
(node_has_curve25519_onion_key(node_prev) ||
- (node_prev->rs && node_prev->rs->version_supports_extend2_cells))) {
+ (node_prev->rs &&
+ routerstatus_version_supports_ntor(node_prev->rs, 0)))) {
*cell_type_out = RELAY_COMMAND_EXTEND2;
*create_cell_type_out = CELL_CREATE2;
} else {