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

[tor-commits] [tor/master] Make sure NSS is initialized before running benchmarks



commit be8d497b656b674e33726f49d9829cc03fccea09
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Fri Jul 13 13:43:23 2018 -0400

    Make sure NSS is initialized before running benchmarks
---
 src/test/bench.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/test/bench.c b/src/test/bench.c
index 50af9e0d6..2b90ccf73 100644
--- a/src/test/bench.c
+++ b/src/test/bench.c
@@ -681,9 +681,9 @@ main(int argc, const char **argv)
 
   tor_threads_init();
   tor_compress_init();
+  init_logging(1);
 
   if (argc == 4 && !strcmp(argv[1], "diff")) {
-    init_logging(1);
     const int N = 200;
     char *f1 = read_file_to_str(argv[2], RFTS_BIN, NULL);
     char *f2 = read_file_to_str(argv[3], RFTS_BIN, NULL);
@@ -719,13 +719,12 @@ main(int argc, const char **argv)
 
   reset_perftime();
 
-  if (crypto_seed_rng() < 0) {
+  if (crypto_global_init(0, NULL, NULL) < 0) {
     printf("Couldn't seed RNG; exiting.\n");
     return 1;
   }
 
   init_protocol_warning_severity_level();
-  crypto_init_siphash_key();
   options = options_new();
   init_logging(1);
   options->command = CMD_RUN_UNITTESTS;



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