summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2010-10-21 11:08:15 -0400
committerNick Mathewson <nickm@torproject.org>2010-10-21 11:09:35 -0400
commit5f3010667d9473d5c246ff77d6dc3d0ad4c4f30a (patch)
tree00e1dbddb9f9fe9d638188a2ad95d520a4b4e780
parent0e8d1c22177fa10b7f5fd6214d6b3c7e5eeaafac (diff)
downloadtor-5f3010667d9473d5c246ff77d6dc3d0ad4c4f30a.tar.gz
tor-5f3010667d9473d5c246ff77d6dc3d0ad4c4f30a.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.
-rw-r--r--src/or/rendclient.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index cc1c2733a8..3e1083f694 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -755,7 +755,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);