diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-03-25 12:04:11 +0100 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-03-31 10:04:44 -0400 |
commit | 1a14e5be91cfd32f8eee30896eb432a7ff060c05 (patch) | |
tree | 235b2f7fef2653270f7c707df41b7712809e05d0 /src/test/test_crypto.c | |
parent | 38fb651f0d740bef575ad7f95475cc504ea4cb8f (diff) | |
download | tor-1a14e5be91cfd32f8eee30896eb432a7ff060c05.tar.gz tor-1a14e5be91cfd32f8eee30896eb432a7ff060c05.zip |
Remove crypto/rand include from test_crypto.c
Create a new test_crypto_openssl to test openssl-only crypto.c
functionality.
Diffstat (limited to 'src/test/test_crypto.c')
-rw-r--r-- | src/test/test_crypto.c | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c index 3a6c222bc4..f722492943 100644 --- a/src/test/test_crypto.c +++ b/src/test/test_crypto.c @@ -16,7 +16,6 @@ #include "ed25519_vectors.inc" #include <openssl/evp.h> -#include <openssl/rand.h> /** Run unit tests for Diffie-Hellman functionality. */ static void @@ -331,38 +330,6 @@ test_crypto_rng_strongest(void *arg) #undef N } -/* Test for rectifying openssl RAND engine. */ -static void -test_crypto_rng_engine(void *arg) -{ - (void)arg; - RAND_METHOD dummy_method; - memset(&dummy_method, 0, sizeof(dummy_method)); - - /* We should be a no-op if we're already on RAND_OpenSSL */ - tt_int_op(0, ==, crypto_force_rand_ssleay()); - tt_assert(RAND_get_rand_method() == RAND_OpenSSL()); - - /* We should correct the method if it's a dummy. */ - RAND_set_rand_method(&dummy_method); -#ifdef LIBRESSL_VERSION_NUMBER - /* On libressl, you can't override the RNG. */ - tt_assert(RAND_get_rand_method() == RAND_OpenSSL()); - tt_int_op(0, ==, crypto_force_rand_ssleay()); -#else - tt_assert(RAND_get_rand_method() == &dummy_method); - tt_int_op(1, ==, crypto_force_rand_ssleay()); -#endif - tt_assert(RAND_get_rand_method() == RAND_OpenSSL()); - - /* Make sure we aren't calling dummy_method */ - crypto_rand((void *) &dummy_method, sizeof(dummy_method)); - crypto_rand((void *) &dummy_method, sizeof(dummy_method)); - - done: - ; -} - /** Run unit tests for our AES128 functionality */ static void test_crypto_aes128(void *arg) @@ -2941,7 +2908,6 @@ struct testcase_t crypto_tests[] = { CRYPTO_LEGACY(formats), CRYPTO_LEGACY(rng), { "rng_range", test_crypto_rng_range, 0, NULL, NULL }, - { "rng_engine", test_crypto_rng_engine, TT_FORK, NULL, NULL }, { "rng_strongest", test_crypto_rng_strongest, TT_FORK, NULL, NULL }, { "rng_strongest_nosyscall", test_crypto_rng_strongest, TT_FORK, &passthrough_setup, (void*)"nosyscall" }, |