From 59f9097d5c3dc010847c359888d31757d1c97904 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 10 May 2011 16:58:38 -0400 Subject: 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. --- src/or/rendmid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/or/rendmid.c') diff --git a/src/or/rendmid.c b/src/or/rendmid.c index c8e614d78..d73f0a1ba 100644 --- a/src/or/rendmid.c +++ b/src/or/rendmid.c @@ -57,7 +57,7 @@ rend_mid_establish_intro(or_circuit_t *circ, const uint8_t *request, log_warn(LD_BUG, "Internal error computing digest."); goto err; } - if (tor_memcmp(expected_digest, request+2+asn1len, DIGEST_LEN)) { + if (tor_memneq(expected_digest, request+2+asn1len, DIGEST_LEN)) { log_warn(LD_PROTOCOL, "Hash of session info was not as expected."); reason = END_CIRC_REASON_TORPROTOCOL; goto err; -- cgit v1.2.3