]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Stop discarding downloaded full descriptors when using microdescs for circuits
authorteor <teor2345@gmail.com>
Wed, 30 Nov 2016 01:20:28 +0000 (12:20 +1100)
committerteor <teor2345@gmail.com>
Wed, 30 Nov 2016 01:20:28 +0000 (12:20 +1100)
This affects clients with FetchUselessDescriptors 1.

It might also cause subtle bugs on directory mirrors and authorities,
causing them to consider all full descriptors as failed or old.

changes/bug20839 [new file with mode: 0644]
src/or/routerlist.c

diff --git a/changes/bug20839 b/changes/bug20839
new file mode 100644 (file)
index 0000000..c290097
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes (descriptors):
+    - Correctly recognise downloaded full descriptors as valid, even when
+      using microdescriptors as circuits. This affects clients with
+      FetchUselessDescriptors set, and may affect directory authorities.
+      Fixes bug 20839; bugfix on commit 6083276 in 0.2.3.2-alpha.
index 9d5b74d8b684a5e6fa860e7affe3ea8e7c06ca72..9bcca76b63c60d15b41f8e18c0f239a18fff07f9 100644 (file)
@@ -3896,7 +3896,7 @@ router_add_to_routerlist(routerinfo_t *router, const char **msg,
                router_describe(router));
       *msg = "Router descriptor is not referenced by any network-status.";
 
-      /* Only journal this desc if we'll be serving it. */
+      /* Only journal this desc if we want to keep old descriptors */
       if (!from_cache && should_cache_old_descriptors())
         signed_desc_append_to_journal(&router->cache_info,
                                       &routerlist->desc_store);
@@ -4526,13 +4526,14 @@ router_load_extrainfo_from_string(const char *s, const char *eos,
   smartlist_free(extrainfo_list);
 }
 
-/** Return true iff any networkstatus includes a descriptor whose digest
- * is that of <b>desc</b>. */
+/** Return true iff the latest ns-flavored consensus includes a descriptor
+ * whose digest is that of <b>desc</b>. */
 static int
 signed_desc_digest_is_recognized(signed_descriptor_t *desc)
 {
   const routerstatus_t *rs;
-  networkstatus_t *consensus = networkstatus_get_latest_consensus();
+  networkstatus_t *consensus = networkstatus_get_latest_consensus_by_flavor(
+                                                                      FLAV_NS);
 
   if (consensus) {
     rs = networkstatus_vote_find_entry(consensus, desc->identity_digest);