summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-28 01:55:34 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-28 01:55:34 -0400
commit42b15a0aaa6e00c2ce0ce030abdb87e787f27fe4 (patch)
tree2461a1a5f1660e0e4f3bc1aed52d3fc80c968f1b /src/test
parent6f200b61b7effe811809fe60459b0b5b58cb3dbb (diff)
parenta5232e0c4c572cdff85701f698b8b90c9443d7e4 (diff)
downloadtor-42b15a0aaa6e00c2ce0ce030abdb87e787f27fe4.tar.gz
tor-42b15a0aaa6e00c2ce0ce030abdb87e787f27fe4.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test_crypto.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index 781081a4ad..bf2cc48174 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -69,7 +69,7 @@ test_crypto_rng(void)
uint64_t big;
char *host;
j = crypto_rand_int(100);
- if (i < 0 || i >= 100)
+ if (j < 0 || j >= 100)
allok = 0;
big = crypto_rand_uint64(U64_LITERAL(1)<<40);
if (big >= (U64_LITERAL(1)<<40))
@@ -240,11 +240,13 @@ test_crypto_sha(void)
/* Test SHA-1 with a test vector from the specification. */
i = crypto_digest(data, "abc", 3);
test_memeq_hex(data, "A9993E364706816ABA3E25717850C26C9CD0D89D");
+ tt_int_op(i, ==, 0);
/* Test SHA-256 with a test vector from the specification. */
i = crypto_digest256(data, "abc", 3, DIGEST_SHA256);
test_memeq_hex(data, "BA7816BF8F01CFEA414140DE5DAE2223B00361A3"
"96177A9CB410FF61F20015AD");
+ tt_int_op(i, ==, 0);
/* Test HMAC-SHA-1 with test cases from RFC2202. */