diff options
Diffstat (limited to 'src/or')
-rw-r--r-- | src/or/main.c | 5 | ||||
-rw-r--r-- | src/or/router.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/src/or/main.c b/src/or/main.c index d1c2b516ff..353082749c 100644 --- a/src/or/main.c +++ b/src/or/main.c @@ -1817,9 +1817,8 @@ tor_init(int argc, char *argv[]) "and you probably shouldn't."); #endif - crypto_global_init(get_options()->HardwareAccel); - if (crypto_seed_rng(1)) { - log_err(LD_BUG, "Unable to seed random number generator. Exiting."); + if (crypto_global_init(get_options()->HardwareAccel)) { + log_err(LD_BUG, "Unable to initialize OpenSSL. Exiting."); return -1; } diff --git a/src/or/router.c b/src/or/router.c index 1cdcd20652..3d6cae367e 100644 --- a/src/or/router.c +++ b/src/or/router.c @@ -444,6 +444,12 @@ init_keys(void) if (!key_lock) key_lock = tor_mutex_new(); + /* There are a couple of paths that put us here before */ + if (crypto_global_init(get_options()->HardwareAccel)) { + log_err(LD_BUG, "Unable to initialize OpenSSL. Exiting."); + return -1; + } + /* OP's don't need persistent keys; just make up an identity and * initialize the TLS context. */ if (!server_mode(options)) { |