aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2015-11-26 09:34:44 -0500
committerNick Mathewson <nickm@torproject.org>2015-11-26 09:34:44 -0500
commitfe46fffd980cb97661b6bf0f16c66522d7e58e61 (patch)
tree5ffdb5cd1b91b0e25898070a2c9e718836aeea89 /src/test/test_tortls.c
parentb0e601086148b9f39f113da12c9d14ddd00f0f1e (diff)
downloadtor-fe46fffd980cb97661b6bf0f16c66522d7e58e61.tar.gz
tor-fe46fffd980cb97661b6bf0f16c66522d7e58e61.zip
Fix test_tortls.c to no longer test failing crypto_rand.
(crypto_rand is no longer allowed to fail.) Closes bug 17686; bug not in any released tor. (No backport, since the tortls tests aren't in 0.2.7)
Diffstat (limited to 'src/test/test_tortls.c')
-rw-r--r--src/test/test_tortls.c17
1 files changed, 0 insertions, 17 deletions
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index b1d91a61c7..94d74c3a7c 100644
--- a/src/test/test_tortls.c
+++ b/src/test/test_tortls.c
@@ -2579,7 +2579,6 @@ test_tortls_context_new(void *ignored)
static int fixed_crypto_pk_get_evp_pkey_result_index = 0;
static EVP_PKEY *fixed_crypto_pk_get_evp_pkey_result[5];
-static int fixed_crypto_rand_result;
static EVP_PKEY *
fixed_crypto_pk_get_evp_pkey_(crypto_pk_t *env, int private)
@@ -2590,13 +2589,6 @@ fixed_crypto_pk_get_evp_pkey_(crypto_pk_t *env, int private)
fixed_crypto_pk_get_evp_pkey_result_index++];
}
-static int
-fixed_crypto_rand(char *to, size_t n)
-{
- (void)to;
- (void)n;
- return fixed_crypto_rand_result;
-}
static void
test_tortls_create_certificate(void *ignored)
@@ -2626,16 +2618,7 @@ test_tortls_create_certificate(void *ignored)
ret = tor_tls_create_certificate(pk1, pk2, "hello", "hello2", 1);
tt_assert(!ret);
- MOCK(crypto_rand, fixed_crypto_rand);
- fixed_crypto_rand_result = -1;
- fixed_crypto_pk_get_evp_pkey_result_index = 0;
- fixed_crypto_pk_get_evp_pkey_result[0] = tor_malloc_zero(sizeof(EVP_PKEY));
- fixed_crypto_pk_get_evp_pkey_result[1] = tor_malloc_zero(sizeof(EVP_PKEY));
- ret = tor_tls_create_certificate(pk1, pk2, "hello", "hello2", 1);
- tt_assert(!ret);
-
done:
- UNMOCK(crypto_rand);
UNMOCK(crypto_pk_get_evp_pkey_);
crypto_pk_free(pk1);
crypto_pk_free(pk2);