diff options
author | Nick Mathewson <nickm@torproject.org> | 2010-10-21 11:08:15 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2010-11-12 19:52:27 -0500 |
commit | 2392290c1887b732fd2309e57ce04ab71b9b4e69 (patch) | |
tree | 8dc9c78acc8bb3ec42c0e4c062338ab8a47b3f31 /src/or/rendclient.c | |
parent | 5cd7953a2112d6ae8702c741d73b8b6a2d0c5251 (diff) | |
download | tor-2392290c1887b732fd2309e57ce04ab71b9b4e69.tar.gz tor-2392290c1887b732fd2309e57ce04ab71b9b4e69.zip |
Fix a remaining bug in Robert's bug1859 fix.
When intro->extend_info is created for an introduction point, it
only starts out with a nickname, not necessarily an identity digest.
Thus, doing router_get_by_digest isn't necessarily safe.
Diffstat (limited to 'src/or/rendclient.c')
-rw-r--r-- | src/or/rendclient.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c index ca3f213dca..1f253c10bd 100644 --- a/src/or/rendclient.c +++ b/src/or/rendclient.c @@ -810,7 +810,10 @@ rend_client_get_random_intro(const rend_data_t *rend_query) intro = smartlist_get(entry->parsed->intro_nodes, i); /* Do we need to look up the router or is the extend info complete? */ if (!intro->extend_info->onion_key) { - router = router_get_by_digest(intro->extend_info->identity_digest); + if (tor_digest_is_zero(intro->extend_info->identity_digest)) + router = router_get_by_hexdigest(intro->extend_info->nickname); + else + router = router_get_by_digest(intro->extend_info->identity_digest); if (!router) { log_info(LD_REND, "Unknown router with nickname '%s'; trying another.", intro->extend_info->nickname); |