]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix a remaining bug in Robert's bug1859 fix.
authorNick Mathewson <nickm@torproject.org>
Thu, 21 Oct 2010 15:08:15 +0000 (11:08 -0400)
committerNick Mathewson <nickm@torproject.org>
Thu, 21 Oct 2010 15:09:35 +0000 (11:09 -0400)
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.

src/or/rendclient.c

index cc1c2733a81d621480a9a823fbc27444c6f1087f..3e1083f69498fa907c241c5003b13f359335d4b6 100644 (file)
@@ -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);