aboutsummaryrefslogtreecommitdiff
path: root/src/or/entrynodes.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-01-31 11:46:06 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-31 11:47:09 -0500
commit26957a127a80404ca243e50c3f0c2bac01e480b8 (patch)
treee29842b44f26e5390fc8d323b55e2140be04ad24 /src/or/entrynodes.c
parent93b39c51629ed0ded2bf807cb6a06d59f3a55347 (diff)
downloadtor-26957a127a80404ca243e50c3f0c2bac01e480b8.tar.gz
tor-26957a127a80404ca243e50c3f0c2bac01e480b8.zip
entry_guard_pick_for_circuit(): TRAFFIC guards must have descriptors
This relates to the 21242 fix -- entry_guard_pick_for_circuit() should never yield nodes without descriptors when the node is going to be used for traffic, since we won't be able to extend through them.
Diffstat (limited to 'src/or/entrynodes.c')
-rw-r--r--src/or/entrynodes.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/or/entrynodes.c b/src/or/entrynodes.c
index c5fb92e35a..344b69d65f 100644
--- a/src/or/entrynodes.c
+++ b/src/or/entrynodes.c
@@ -2068,6 +2068,8 @@ entry_guard_pick_for_circuit(guard_selection_t *gs,
// XXXX prop271 check Ed ID.
if (! node)
goto fail;
+ if (BUG(usage != GUARD_USAGE_DIRGUARD && !node_has_descriptor(node)))
+ goto fail;
*chosen_node_out = node;
*guard_state_out = tor_malloc_zero(sizeof(circuit_guard_state_t));