diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-05-04 08:49:02 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-05-04 08:49:02 -0400 |
commit | e1d31f2a2f5c7810c9c34ffa57e4b86ec8fd860b (patch) | |
tree | e55f60ae702157efa44de566fa0804a50faf18c0 /src/or/routerparse.c | |
parent | a8eccb6363ff02d4c59526a4daace96f71ff01c8 (diff) | |
download | tor-e1d31f2a2f5c7810c9c34ffa57e4b86ec8fd860b.tar.gz tor-e1d31f2a2f5c7810c9c34ffa57e4b86ec8fd860b.zip |
Update the consdiff directory code based on #22143 fixes
These are mostly just identifier renames, except for one place in
routerparse.c where we switch to using a correct hash.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r-- | src/or/routerparse.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 4def75a23e..fa79cf7132 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -3384,7 +3384,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, networkstatus_voter_info_t *voter = NULL; networkstatus_t *ns = NULL; common_digests_t ns_digests; - uint8_t sha3_full[DIGEST256_LEN]; + uint8_t sha3_as_signed[DIGEST256_LEN]; const char *cert, *end_of_header, *end_of_footer, *s_dup = s; directory_token_t *tok; struct in_addr in; @@ -3398,10 +3398,8 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, if (eos_out) *eos_out = NULL; - // XXXX replace SHA3_full with as_signed digest once #22143 is merged. - // XXXX Merge #22143 before this! if (router_get_networkstatus_v3_hashes(s, &ns_digests) || - crypto_digest256((char *)sha3_full, s, strlen(s), DIGEST_SHA3_256)<0) { + router_get_networkstatus_v3_sha3_as_signed(sha3_as_signed, s)<0) { log_warn(LD_DIR, "Unable to compute digest of network-status"); goto err; } @@ -3418,7 +3416,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out, ns = tor_malloc_zero(sizeof(networkstatus_t)); memcpy(&ns->digests, &ns_digests, sizeof(ns_digests)); - memcpy(&ns->digest_full_sha3, sha3_full, sizeof(sha3_full)); + memcpy(&ns->digest_sha3_as_signed, sha3_as_signed, sizeof(sha3_as_signed)); tok = find_by_keyword(tokens, K_NETWORK_STATUS_VERSION); tor_assert(tok); |