summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-10 16:23:43 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:12:51 -0400
commitdb7b2a33eef9c8d432442b072f9c8868a068bb91 (patch)
treece364a8c6abea10a8e21460cdc205f590cb820d5 /src/or/router.c
parent1d703ed22b249567c2df31db9035a4dda66483ca (diff)
downloadtor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar.gz
tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.zip
Automated conversion of memcmp to tor_memcmp/tor_mem[n]eq
This commit is _exactly_ the result of perl -i -pe 's/\bmemcmp\(/tor_memcmp\(/g' src/*/*.[ch] perl -i -pe 's/\!\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*==\s*tor_memcmp\(/tor_memeq\(/g' src/*/*.[ch] perl -i -pe 's/0\s*!=\s*tor_memcmp\(/tor_memneq\(/g' src/*/*.[ch] git checkout src/common/di_ops.[ch] git checkout src/or/test.c git checkout src/common/test.h
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 52bfa64e43..bfb6d5c871 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -634,7 +634,7 @@ init_keys(void)
ds->type = type;
}
if (v3_digest_set && (ds->type & V3_AUTHORITY) &&
- memcmp(v3_digest, ds->v3_identity_digest, DIGEST_LEN)) {
+ tor_memcmp(v3_digest, ds->v3_identity_digest, DIGEST_LEN)) {
log_warn(LD_DIR, "V3 identity key does not match identity declared in "
"DirServer line. Adjusting.");
memcpy(ds->v3_identity_digest, v3_digest, DIGEST_LEN);
@@ -1119,7 +1119,7 @@ router_compare_to_my_exit_policy(edge_connection_t *conn)
int
router_digest_is_me(const char *digest)
{
- return identitykey && !memcmp(identitykey_digest, digest, DIGEST_LEN);
+ return identitykey && tor_memeq(identitykey_digest, digest, DIGEST_LEN);
}
/** Return true iff I'm a server and <b>digest</b> is equal to
@@ -1131,7 +1131,7 @@ router_extrainfo_digest_is_me(const char *digest)
if (!ei)
return 0;
- return !memcmp(digest,
+ return tor_memeq(digest,
ei->cache_info.signed_descriptor_digest,
DIGEST_LEN);
}