]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Make sure NSS is initialized before running benchmarks
authorNick Mathewson <nickm@torproject.org>
Fri, 13 Jul 2018 17:43:23 +0000 (13:43 -0400)
committerNick Mathewson <nickm@torproject.org>
Tue, 31 Jul 2018 23:46:00 +0000 (19:46 -0400)
src/test/bench.c

index 50af9e0d69f8f9dad46bedc9f336bb28fca88552..2b90ccf734055e29f954a0431ba51be1f2fde869 100644 (file)
@@ -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;