aboutsummaryrefslogtreecommitdiff
path: root/src/or/relay.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-10 16:58:38 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:12:51 -0400
commit59f9097d5c3dc010847c359888d31757d1c97904 (patch)
treebaed5184d13d62645e00d1ed815ffc0861b2ff87 /src/or/relay.c
parentdb7b2a33eef9c8d432442b072f9c8868a068bb91 (diff)
downloadtor-59f9097d5c3dc010847c359888d31757d1c97904.tar.gz
tor-59f9097d5c3dc010847c359888d31757d1c97904.zip
Hand-conversion and audit phase of memcmp transition
Here I looked at the results of the automated conversion and cleaned them up as follows: If there was a tor_memcmp or tor_memeq that was in fact "safe"[*] I changed it to a fast_memcmp or fast_memeq. Otherwise if there was a tor_memcmp that could turn into a tor_memneq or tor_memeq, I converted it. This wants close attention. [*] I'm erring on the side of caution here, and leaving some things as tor_memcmp that could in my opinion use the data-dependent fast_memcmp variant.
Diffstat (limited to 'src/or/relay.c')
-rw-r--r--src/or/relay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/or/relay.c b/src/or/relay.c
index 61971a4c10..59e2c5c969 100644
--- a/src/or/relay.c
+++ b/src/or/relay.c
@@ -89,7 +89,7 @@ relay_digest_matches(crypto_digest_env_t *digest, cell_t *cell)
crypto_digest_add_bytes(digest, (char*) cell->payload, CELL_PAYLOAD_SIZE);
crypto_digest_get_digest(digest, calculated_integrity, 4);
- if (tor_memcmp(received_integrity, calculated_integrity, 4)) {
+ if (tor_memneq(received_integrity, calculated_integrity, 4)) {
// log_fn(LOG_INFO,"Recognized=0 but bad digest. Not recognizing.");
// (%d vs %d).", received_integrity, calculated_integrity);
/* restore digest to its old form */