diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-01-11 12:49:28 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-01-11 13:00:15 -0500 |
commit | 42751e2123f6dcc87f3992d38c1889f7da981a7b (patch) | |
tree | 9e8ef66f99c7d74a4af5021dbcb227667bf2b91f /src/common | |
parent | 18ea91ee6b3ad2a8088d6fb3361c9a598ceffe83 (diff) | |
download | tor-42751e2123f6dcc87f3992d38c1889f7da981a7b.tar.gz tor-42751e2123f6dcc87f3992d38c1889f7da981a7b.zip |
On shutdown, mark openssl as uninitialized.
This causes openssl to get completely reinitialized on startup,
which is probably a good idea.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/crypto.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c index 85bed538e5..b519caed07 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -283,11 +283,12 @@ crypto_force_rand_ssleay(void) return 0; } +static int have_seeded_siphash = 0; + /** Set up the siphash key if we haven't already done so. */ int crypto_init_siphash_key(void) { - static int have_seeded_siphash = 0; struct sipkey key; if (have_seeded_siphash) return 0; @@ -3495,6 +3496,12 @@ crypto_global_cleanup(void) tor_free(crypto_openssl_version_str); tor_free(crypto_openssl_header_version_str); + + crypto_early_initialized_ = 0; + crypto_global_initialized_ = 0; + have_seeded_siphash = 0; + siphash_unset_global_key(); + return 0; } |