diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-11-25 10:30:58 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-11-25 22:29:59 -0500 |
commit | dedea28c2ef59eb86f5d9704e5609ae13fa8b3c2 (patch) | |
tree | 92ddba2410a8a80aad28734be47c78c460bbd6e6 /src/test/bench.c | |
parent | 232ccc18c40f0d0302b2e21b0f67885c548f8e63 (diff) | |
download | tor-dedea28c2ef59eb86f5d9704e5609ae13fa8b3c2.tar.gz tor-dedea28c2ef59eb86f5d9704e5609ae13fa8b3c2.zip |
Make crypto_seed_rng() and crypto_rand() less scary.
These functions must really never fail; so have crypto_rand() assert
that it's working okay, and have crypto_seed_rng() demand that
callers check its return value. Also have crypto_seed_rng() check
RAND_status() before returning.
Diffstat (limited to 'src/test/bench.c')
-rw-r--r-- | src/test/bench.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/test/bench.c b/src/test/bench.c index 2a27377c80..70ec025b7b 100644 --- a/src/test/bench.c +++ b/src/test/bench.c @@ -643,7 +643,10 @@ main(int argc, const char **argv) reset_perftime(); - crypto_seed_rng(); + if (crypto_seed_rng() < 0) { + printf("Couldn't seed RNG; exiting.\n"); + return 1; + } crypto_init_siphash_key(); options = options_new(); init_logging(1); |