aboutsummaryrefslogtreecommitdiff
path: root/src/or/onion.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/onion.c
parent1d703ed22b249567c2df31db9035a4dda66483ca (diff)
downloadtor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar
tor-db7b2a33eef9c8d432442b072f9c8868a068bb91.tar.gz
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/onion.c')
-rw-r--r--src/or/onion.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/or/onion.c b/src/or/onion.c
index e455a5263..ecd04a59f 100644
--- a/src/or/onion.c
+++ b/src/or/onion.c
@@ -311,7 +311,7 @@ onion_skin_client_handshake(crypto_dh_env_t *handshake_state,
if (len < 0)
goto err;
- if (memcmp(key_material, handshake_reply+DH_KEY_LEN, DIGEST_LEN)) {
+ if (tor_memcmp(key_material, handshake_reply+DH_KEY_LEN, DIGEST_LEN)) {
/* H(K) does *not* match. Something fishy. */
log_warn(LD_PROTOCOL,"Digest DOES NOT MATCH on onion handshake. "
"Bug or attack.");
@@ -398,7 +398,7 @@ fast_client_handshake(const uint8_t *handshake_state,/*DIGEST_LEN bytes*/
if (crypto_expand_key_material(tmp, sizeof(tmp), out, out_len)) {
goto done;
}
- if (memcmp(out, handshake_reply_out+DIGEST_LEN, DIGEST_LEN)) {
+ if (tor_memcmp(out, handshake_reply_out+DIGEST_LEN, DIGEST_LEN)) {
/* H(K) does *not* match. Something fishy. */
log_warn(LD_PROTOCOL,"Digest DOES NOT MATCH on fast handshake. "
"Bug or attack.");