[tor-commits] [tor/master] Believe that v3 dirauths always serve extra infos.

nickm at torproject.org nickm at torproject.org
Thu Jun 19 17:16:44 UTC 2014


commit 5e9bd1b5db1815698f7aed6caf5df9587185a8d1
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date:   Mon May 5 15:31:52 2014 +0200

    Believe that v3 dirauths always serve extra infos.
    
    Clients should always believe that v3 directory authorities serve
    extra-info documents, regardless of whether their server descriptor
    contains a "caches-extra-info" line or not.
    
    Fixes part of #11683.
---
 changes/bug11683    |    6 ++++++
 src/or/directory.c  |    6 +++---
 src/or/routerlist.c |    6 ++++--
 3 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/changes/bug11683 b/changes/bug11683
new file mode 100644
index 0000000..52f623c
--- /dev/null
+++ b/changes/bug11683
@@ -0,0 +1,6 @@
+  o Minor bugfixes:
+    - Always believe that v3 directory authorities serve extra-info
+      documents, regardless of whether their server descriptor contains a
+      "caches-extra-info" line or not. Fixes part of #11683. Bugfix on
+      0.2.0.1-alpha.
+
diff --git a/src/or/directory.c b/src/or/directory.c
index 76cb8fa..8b37590 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -197,9 +197,9 @@ dir_conn_purpose_to_string(int purpose)
   return "(unknown)";
 }
 
-/** Return true iff <b>identity_digest</b> is the digest of a router we
- * believe to support extrainfo downloads.  (If <b>is_authority</b> we do
- * additional checking that's only valid for authorities.) */
+/** Return true iff <b>identity_digest</b> is the digest of a router which
+ * says that it caches extrainfos.  (If <b>is_authority</b> we always
+ * believe that to be true.) */
 int
 router_supports_extrainfo(const char *identity_digest, int is_authority)
 {
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 8f3477a..2c0f193 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1438,7 +1438,7 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags)
 
   /* Find all the running dirservers we know about. */
   SMARTLIST_FOREACH_BEGIN(nodelist_get_list(), const node_t *, node) {
-    int is_trusted;
+    int is_trusted, is_trusted_extrainfo;
     int is_overloaded;
     tor_addr_t addr;
     const routerstatus_t *status = node->rs;
@@ -1453,8 +1453,10 @@ router_pick_directory_server_impl(dirinfo_type_t type, int flags)
     if (requireother && router_digest_is_me(node->identity))
       continue;
     is_trusted = router_digest_is_trusted_dir(node->identity);
+    is_trusted_extrainfo = router_digest_is_trusted_dir_type(
+                           node->identity, EXTRAINFO_DIRINFO);
     if ((type & EXTRAINFO_DIRINFO) &&
-        !router_supports_extrainfo(node->identity, 0))
+        !router_supports_extrainfo(node->identity, is_trusted_extrainfo))
       continue;
     if ((type & MICRODESC_DIRINFO) && !is_trusted &&
         !node->rs->version_supports_microdesc_cache)





More information about the tor-commits mailing list