]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make crypto/rng_engine test pass on libressl. Bug not in any released tor.
authorNick Mathewson <nickm@torproject.org>
Wed, 3 Feb 2016 16:18:16 +0000 (11:18 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 3 Feb 2016 16:18:16 +0000 (11:18 -0500)
src/test/test_crypto.c

index 3244c210e6687efa024e94a9a58885da55153f39..671ae7d7b266179da339caca77148a30949179dc 100644 (file)
@@ -147,8 +147,14 @@ test_crypto_rng_engine(void *arg)
 
   /* 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 */