]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
When making sure digest256 matches in ei, look at sd, not ri.
authorNick Mathewson <nickm@torproject.org>
Tue, 17 May 2016 16:57:03 +0000 (12:57 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 17 May 2016 16:57:03 +0000 (12:57 -0400)
The routerinfo we pass to routerinfo_incompatible_with_extrainfo is
the latest routerinfo for the relay.  The signed_descriptor_t, on
the other hand, is the signed_descriptor_t that corresponds to the
extrainfo.  That means we should be checking the digest256 match
with that signed_descriptor_t, not with the routerinfo.

Fixes bug 17150 (and 19017); bugfix on 0.2.7.2-alpha.

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

diff --git a/changes/bug17150 b/changes/bug17150
new file mode 100644 (file)
index 0000000..3fb7821
--- /dev/null
@@ -0,0 +1,6 @@
+  o Minor bugfixes (directory warnings):
+    - When fetching extrainfo documents, compare their SHA256 digests
+      with the routerinfo that led us to fetch them, rather than
+      with the most recent routerinfo. Otherwise we generate many
+      spurious warnings about mismatches. Fixes bug 17150; bugfix
+      on 0.2.7.2-alpha.
index 3d85d86f203abe095edbc7d14a0b5bffae85eae3..2e347b0692fc4d6c52c46201c9cefe6c690934eb 100644 (file)
@@ -4926,9 +4926,9 @@ routerinfo_incompatible_with_extrainfo(const routerinfo_t *ri,
   /* Set digest256_matches to 1 if the digest is correct, or if no
    * digest256 was in the ri. */
   digest256_matches = tor_memeq(ei->digest256,
-                                ri->cache_info.extra_info_digest256, DIGEST256_LEN);
+                                sd->extra_info_digest256, DIGEST256_LEN);
   digest256_matches |=
-    tor_mem_is_zero(ri->cache_info.extra_info_digest256, DIGEST256_LEN);
+    tor_mem_is_zero(sd->extra_info_digest256, DIGEST256_LEN);
 
   /* The identity must match exactly to have been generated at the same time
    * by the same router. */