commit fe46fffd980cb97661b6bf0f16c66522d7e58e61
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Thu Nov 26 09:34:44 2015 -0500
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)
---
src/test/test_tortls.c | 17 -----------------
1 file changed, 17 deletions(-)
diff --git a/src/test/test_tortls.c b/src/test/test_tortls.c
index b1d91a6..94d74c3 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);