diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-05-11 16:39:45 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-05-11 16:39:45 -0400 |
commit | 9fba014e3f7f89520841b65b8b038e5fb931b1d6 (patch) | |
tree | 2197904844e7ae25b4a2d6465c2aa0cca1798019 /src/or/dirserv.c | |
parent | 6d5478a8a7734553fc84574e725625610f46dc8c (diff) | |
parent | 8fb38331c3213caef2d2e003e02cdb361504f14f (diff) | |
download | tor-9fba014e3f7f89520841b65b8b038e5fb931b1d6.tar.gz tor-9fba014e3f7f89520841b65b8b038e5fb931b1d6.zip |
Merge remote-tracking branch 'public/bug3122_memcmp_022' into bug3122_memcmp_023
Conflicts in various places, mainly node-related. Resolved them in
favor of HEAD, with copying of tor_mem* operations from bug3122_memcmp_022.
src/common/Makefile.am
src/or/circuitlist.c
src/or/connection_edge.c
src/or/directory.c
src/or/microdesc.c
src/or/networkstatus.c
src/or/router.c
src/or/routerlist.c
src/test/test_util.c
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r-- | src/or/dirserv.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 0ac2d804c7..d22ef3bac3 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -2116,7 +2116,7 @@ routerstatus_format_entry(char *buf, size_t buf_len, /* This assert can fire for the control port, because * it can request NS documents before all descriptors * have been fetched. */ - if (memcmp(desc->cache_info.signed_descriptor_digest, + if (tor_memneq(desc->cache_info.signed_descriptor_digest, rs->descriptor_digest, DIGEST_LEN)) { char rl_d[HEX_DIGEST_LEN+1]; @@ -2132,7 +2132,7 @@ routerstatus_format_entry(char *buf, size_t buf_len, "(router %s)\n", rl_d, rs_d, id); - tor_assert(!memcmp(desc->cache_info.signed_descriptor_digest, + tor_assert(tor_memeq(desc->cache_info.signed_descriptor_digest, rs->descriptor_digest, DIGEST_LEN)); }; @@ -2234,9 +2234,9 @@ _compare_routerinfo_by_ip_and_bw(const void **a, const void **b) /* They're equal! Compare by identity digest, so there's a * deterministic order and we avoid flapping. */ - return memcmp(first->cache_info.identity_digest, - second->cache_info.identity_digest, - DIGEST_LEN); + return fast_memcmp(first->cache_info.identity_digest, + second->cache_info.identity_digest, + DIGEST_LEN); } /** Given a list of routerinfo_t in <b>routers</b>, return a new digestmap_t @@ -3185,7 +3185,7 @@ dirserv_orconn_tls_done(const char *address, SMARTLIST_FOREACH_BEGIN(rl->routers, routerinfo_t *, ri) { if (!strcasecmp(address, ri->address) && or_port == ri->or_port && as_advertised && - !memcmp(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) { + fast_memeq(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) { /* correct digest. mark this router reachable! */ if (!bridge_auth || ri->purpose == ROUTER_PURPOSE_BRIDGE) { tor_addr_t addr, *addrp=NULL; |