]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Use digest256_len in networkstatus_copy_old_consensus_info()
authorNick Mathewson <nickm@torproject.org>
Fri, 31 Oct 2014 15:36:31 +0000 (11:36 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 31 Oct 2014 15:36:31 +0000 (11:36 -0400)
Now, if a router ever changes its microdescriptor, but the new
microdescriptor SHA256 hash has the same 160-bit prefix as the old
one, we treat it as a new microdescriptor when deciding whether to
copy status information.

(This function also is used to compare SHA1 digests of router
descriptors, but don't worry: the descriptor_digest field either holds
a SHA256 hash, or a SHA1 hash padded with 0 bytes.)

changes/bug13399
src/or/networkstatus.c

index bbd0b2376bc79232260ac28213eade308d185ffd..fcaf58a53c8803b72b7ea3a00cd48e8c2375bf30 100644 (file)
@@ -5,3 +5,8 @@
       the same first 160 bits. Fixes part of bug 13399; bugfix on
       0.2.3.1-alpha.
 
+    - Reset a router's status if its microdescriptor digest changes,
+      even if the first 160 bits remain the same.  Fixes part of bug
+      13399; bugfix on 0.2.3.1-alpha.
+
+
index 351b20c3af571f41cb0ee2618f91dc3fd840284a..21efdd129d74afd07fa05970882ab4eec8ab4d27 100644 (file)
@@ -1123,7 +1123,7 @@ networkstatus_copy_old_consensus_info(networkstatus_t *new_c,
     rs_new->last_dir_503_at = rs_old->last_dir_503_at;
 
     if (tor_memeq(rs_old->descriptor_digest, rs_new->descriptor_digest,
-                  DIGEST_LEN)) { /* XXXX Change this to digest256_len */
+                  DIGEST256_LEN)) {
       /* And the same descriptor too! */
       memcpy(&rs_new->dl_status, &rs_old->dl_status,sizeof(download_status_t));
     }