aboutsummaryrefslogtreecommitdiff
path: root/src/test/test-timers.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-07-13 14:35:51 -0400
committerNick Mathewson <nickm@torproject.org>2018-07-31 19:46:00 -0400
commit60705a5719d929a5f3180bc4e6906f972855f84b (patch)
tree01ac15d5c956b5cdc0cf7a9ee31296c7b7e7afaa /src/test/test-timers.c
parentbe8d497b656b674e33726f49d9829cc03fccea09 (diff)
downloadtor-60705a5719d929a5f3180bc4e6906f972855f84b.tar.gz
tor-60705a5719d929a5f3180bc4e6906f972855f84b.zip
Use NSS in crypto_rand.c
This is comparatively straightforward too, except for a couple of twists: * For as long as we're building with two crypto libraries, we want to seed _both_ their RNGs, and use _both_ their RNGs to improve the output of crypto_strongest_rand() * The NSS prng will sometimes refuse to generate huge outputs. When it does, we stretch the output with SHAKE. We only need this for the tests.
Diffstat (limited to 'src/test/test-timers.c')
-rw-r--r--src/test/test-timers.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/test-timers.c b/src/test/test-timers.c
index f9276c25d6..923f51ecce 100644
--- a/src/test/test-timers.c
+++ b/src/test/test-timers.c
@@ -9,6 +9,7 @@
#include "lib/evloop/compat_libevent.h"
#include "lib/evloop/timers.h"
+#include "lib/crypt_ops/crypto_init.h"
#include "lib/crypt_ops/crypto_rand.h"
#include "lib/log/util_bug.h"
#include "lib/time/compat_time.h"
@@ -62,6 +63,10 @@ main(int argc, char **argv)
memset(&cfg, 0, sizeof(cfg));
tor_libevent_initialize(&cfg);
timers_initialize();
+ init_logging(1);
+
+ if (crypto_global_init(0, NULL, NULL) < 0)
+ return 1;
int i;
int ret;