aboutsummaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-05-08 12:59:08 -0400
committerNick Mathewson <nickm@torproject.org>2013-05-08 12:59:43 -0400
commit7d3fd858388ddd4916c604ed5ab3c8cfc72dfd1c (patch)
treee998edb9289e44bdf70453f133a5f8f23d7e9666 /src/test
parenta1d7f7ea503f2f739953d6a25ebb5d93981604be (diff)
downloadtor-7d3fd858388ddd4916c604ed5ab3c8cfc72dfd1c.tar
tor-7d3fd858388ddd4916c604ed5ab3c8cfc72dfd1c.tar.gz
Fix bug 8845: check the right length of memory in aes unit tests
This couldn't actually be a buffer overrun unless AES somehow turned into memcpy, but still it's good to fix it.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_crypto.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index fcaa0813e..f92bfd673 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -730,7 +730,7 @@ test_crypto_aes_iv(void *arg)
/* Decrypt with the wrong key. */
decrypted_size = crypto_cipher_decrypt_with_iv(key2, decrypted2, 4095,
encrypted1, encrypted_size);
- test_memneq(plain, decrypted2, encrypted_size);
+ test_memneq(plain, decrypted2, decrypted_size);
/* Alter the initialization vector. */
encrypted1[0] += 42;
decrypted_size = crypto_cipher_decrypt_with_iv(key1, decrypted1, 4095,