aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-11-07 08:48:23 -0800
committerRobert Ransom <rransom.8774@gmail.com>2011-11-07 08:48:23 -0800
commit749b37bcf41917a449830e1cd1f63430b23a3346 (patch)
tree84eeee3238242d14a16b0f901ff5f2b0fb17d74d
parent350fe952590fdfd1711aaaddcb478cdea20b6e6a (diff)
downloadtor-749b37bcf41917a449830e1cd1f63430b23a3346.tar
tor-749b37bcf41917a449830e1cd1f63430b23a3346.tar.gz
Fix assert on clients of and authorities for v0 HS descs
-rw-r--r--changes/bug441110
-rw-r--r--src/or/rendclient.c15
2 files changed, 23 insertions, 2 deletions
diff --git a/changes/bug4411 b/changes/bug4411
new file mode 100644
index 000000000..1273d0264
--- /dev/null
+++ b/changes/bug4411
@@ -0,0 +1,10 @@
+ o Major bugfixes
+
+ - Fix a rare assertion failure when checking whether a v0 hidden
+ service descriptor has any usable introduction points left, and
+ we don't have enough information to build a circuit to the first
+ intro point named in the descriptor. The HS client code in
+ 0.2.3.x no longer uses v0 HS descriptors, but this assertion can
+ trigger on (and crash) v0 HS authorities. Fixes bug 4411.
+ Bugfix on 0.2.3.1-alpha; diagnosed by frosty_un.
+
diff --git a/src/or/rendclient.c b/src/or/rendclient.c
index 1038378de..79714f958 100644
--- a/src/or/rendclient.c
+++ b/src/or/rendclient.c
@@ -1048,6 +1048,7 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
/* Do we need to look up the router or is the extend info complete? */
if (!intro->extend_info->onion_key) {
const node_t *node;
+ extend_info_t *new_extend_info;
if (tor_digest_is_zero(intro->extend_info->identity_digest))
node = node_get_by_hex_id(intro->extend_info->nickname);
else
@@ -1058,8 +1059,18 @@ rend_client_get_random_intro_impl(const rend_cache_entry_t *entry,
smartlist_del(usable_nodes, i);
goto again;
}
- extend_info_free(intro->extend_info);
- intro->extend_info = extend_info_from_node(node);
+ new_extend_info = extend_info_from_node(node);
+ if (!new_extend_info) {
+ log_info(LD_REND, "We don't have a descriptor for the intro-point relay "
+ "'%s'; trying another.",
+ extend_info_describe(intro->extend_info));
+ smartlist_del(usable_nodes, i);
+ goto again;
+ } else {
+ extend_info_free(intro->extend_info);
+ intro->extend_info = new_extend_info;
+ }
+ tor_assert(intro->extend_info != NULL);
}
/* Check if we should refuse to talk to this router. */
if (strict &&