diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-10-31 11:36:31 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-10-31 11:36:31 -0400 |
commit | efd5001c3b94c633850d7ae9b9f5b6e1ee45ab4e (patch) | |
tree | 5dcbf61772b6846a03f8b12315e97f25b195bcf9 /src | |
parent | dc05b8549a73064337020eb3f0d8d91c8149518a (diff) | |
download | tor-efd5001c3b94c633850d7ae9b9f5b6e1ee45ab4e.tar.gz tor-efd5001c3b94c633850d7ae9b9f5b6e1ee45ab4e.zip |
Use digest256_len in networkstatus_copy_old_consensus_info()
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.)
Diffstat (limited to 'src')
-rw-r--r-- | src/or/networkstatus.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 351b20c3af..21efdd129d 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -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)); } |