From 7779c63e93c516c7a2fdfedc8ef73ccdb06e1df8 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 12 May 2011 00:51:11 -0400 Subject: [PATCH 1/2] Accept hs descriptors even if we don't see an HSDir for us The old behavior contributed to unreliability when hidden services and hsdirs had different consensus versions, and so had different opinions about who should be cacheing hsdir info. Bugfix on 0.2.0.10-alpha; based on discussions surrounding bug 2732. --- changes/bug2732-simple | 7 +++++++ src/or/routerlist.c | 5 ----- 2 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 changes/bug2732-simple diff --git a/changes/bug2732-simple b/changes/bug2732-simple new file mode 100644 index 0000000000..367836152d --- /dev/null +++ b/changes/bug2732-simple @@ -0,0 +1,7 @@ + o Minor bugfixes + - Do not reject hidden service descriptors simply because we don't + think we have not been assigned the HSDir flag. Clients and + hidden services can have a more up-to-date view of the network + consensus, and if they think that the directory authorities + list us a HSDir, we might actually be one. Related to bug 2732; + bugfix on 0.2.0.10-alpha. diff --git a/src/or/routerlist.c b/src/or/routerlist.c index f567ccdf3c..354e026306 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5778,11 +5778,6 @@ hid_serv_acting_as_directory(void) "being a hidden service directory."); return 0; } - if (!rs->is_hs_dir) { - log_info(LD_REND, "We're not listed as a hidden service directory in " - "the consensus, so we won't be one."); - return 0; - } return 1; } From 1b512fb9146a4354067491d9d7de92f594a83390 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Sun, 15 May 2011 11:14:28 -0400 Subject: [PATCH 2/2] Rip out more of hid_serv_acting_as_directory rransom notes correctly that now that we aren't checking our HSDir flag, we have no actual reason to check whether we are listed in the consensus at all when determining if we should act like a hidden service directory. --- src/or/routerlist.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 354e026306..22cf87e801 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -5758,8 +5758,6 @@ int hid_serv_acting_as_directory(void) { routerinfo_t *me = router_get_my_routerinfo(); - networkstatus_t *c; - routerstatus_t *rs; if (!me) return 0; if (!get_options()->HidServDirectoryV2) { @@ -5767,17 +5765,6 @@ hid_serv_acting_as_directory(void) "because we have not been configured as such."); return 0; } - if (!(c = networkstatus_get_latest_consensus())) { - log_info(LD_REND, "There's no consensus, so I can't tell if I'm a hidden " - "service directory"); - return 0; - } - rs = networkstatus_vote_find_entry(c, me->cache_info.identity_digest); - if (!rs) { - log_info(LD_REND, "We're not listed in the consensus, so we're not " - "being a hidden service directory."); - return 0; - } return 1; }