[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make crypto/rng_engine test pass on libressl. Bug not in any released tor.



commit c1c3e45eab08b3ce31254c749fe10d93c6b65cb9
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Wed Feb 3 11:18:16 2016 -0500

    Make crypto/rng_engine test pass on libressl. Bug not in any released tor.
---
 src/test/test_crypto.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/test/test_crypto.c b/src/test/test_crypto.c
index 3244c21..671ae7d 100644
--- a/src/test/test_crypto.c
+++ b/src/test/test_crypto.c
@@ -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 */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits