diff options
author | Nick Mathewson <nickm@torproject.org> | 2009-01-21 15:38:39 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2009-01-21 15:38:39 +0000 |
commit | 8ebceeb352113839467b7bf26e4d910c1f31308e (patch) | |
tree | d4f652ce727802d1b63b54b3fdcc8bed3bcff64b /src/or/router.c | |
parent | bf2b71beb86804acc16f98b8a10ffbb9544ff758 (diff) | |
download | tor-8ebceeb352113839467b7bf26e4d910c1f31308e.tar.gz tor-8ebceeb352113839467b7bf26e4d910c1f31308e.zip |
Make sure that even in the weird fiddly paths that lead to init_keys,
crypto_global_init gets called. Also have it be crypto_global_init
that calls crypto_seed_rng, so we are not dependent on OpenSSL's
RAND_poll in these fiddly cases.
Should fix bug 907. Bugfix on 0.0.9pre6. Backport candidate.
svn:r18210
Diffstat (limited to 'src/or/router.c')
-rw-r--r-- | src/or/router.c | 6 |
1 files changed, 6 insertions, 0 deletions
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)) { |