aboutsummaryrefslogtreecommitdiff
path: root/src/or/directory.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-11 16:23:42 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:24:29 -0400
commit44ad73457303ed0bf80f6c4c645a62e03b42149b (patch)
treea7aeb75625c0643b7c2434dc4c57beecd87e8826 /src/or/directory.c
parent7206d784dc3def970d5bd8618242f7b9c9c71e37 (diff)
parent59f9097d5c3dc010847c359888d31757d1c97904 (diff)
downloadtor-44ad73457303ed0bf80f6c4c645a62e03b42149b.tar.gz
tor-44ad73457303ed0bf80f6c4c645a62e03b42149b.zip
Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcmp_022
Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
Diffstat (limited to 'src/or/directory.c')
-rw-r--r--src/or/directory.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/or/directory.c b/src/or/directory.c
index 68734e6042..309d99745f 100644
--- a/src/or/directory.c
+++ b/src/or/directory.c
@@ -2436,7 +2436,7 @@ client_likes_consensus(networkstatus_t *v, const char *want_url)
SMARTLIST_FOREACH_BEGIN(v->voters, networkstatus_voter_info_t *, vi) {
if (smartlist_len(vi->sigs) &&
- !memcmp(vi->identity_digest, want_digest, want_len)) {
+ tor_memeq(vi->identity_digest, want_digest, want_len)) {
have++;
break;
};
@@ -3609,17 +3609,17 @@ dir_routerdesc_download_failed(smartlist_t *failed, int status_code,
* every 10 or 60 seconds (FOO_DESCRIPTOR_RETRY_INTERVAL) in main.c. */
}
-/** Helper. Compare two fp_pair_t objects, and return -1, 0, or 1 as
- * appropriate. */
+/** Helper. Compare two fp_pair_t objects, and return negative, 0, or
+ * positive as appropriate. */
static int
_compare_pairs(const void **a, const void **b)
{
const fp_pair_t *fp1 = *a, *fp2 = *b;
int r;
- if ((r = memcmp(fp1->first, fp2->first, DIGEST_LEN)))
+ if ((r = fast_memcmp(fp1->first, fp2->first, DIGEST_LEN)))
return r;
else
- return memcmp(fp1->second, fp2->second, DIGEST_LEN);
+ return fast_memcmp(fp1->second, fp2->second, DIGEST_LEN);
}
/** Divide a string <b>res</b> of the form FP1-FP2+FP3-FP4...[.z], where each