summaryrefslogtreecommitdiff
path: root/src/ext
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-01-11 12:49:28 -0500
committerNick Mathewson <nickm@torproject.org>2018-01-11 13:00:15 -0500
commit42751e2123f6dcc87f3992d38c1889f7da981a7b (patch)
tree9e8ef66f99c7d74a4af5021dbcb227667bf2b91f /src/ext
parent18ea91ee6b3ad2a8088d6fb3361c9a598ceffe83 (diff)
downloadtor-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/ext')
-rw-r--r--src/ext/csiphash.c6
-rw-r--r--src/ext/siphash.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/ext/csiphash.c b/src/ext/csiphash.c
index 508e4f6ceb..0427c87950 100644
--- a/src/ext/csiphash.c
+++ b/src/ext/csiphash.c
@@ -123,3 +123,9 @@ void siphash_set_global_key(const struct sipkey *key)
the_siphash_key.k1 = key->k1;
the_siphash_key_is_set = 1;
}
+
+void siphash_unset_global_key(void)
+{
+ the_siphash_key_is_set = 0;
+ memset(&the_siphash_key, 0, sizeof(the_siphash_key));
+}
diff --git a/src/ext/siphash.h b/src/ext/siphash.h
index d9b34b8980..730e49937d 100644
--- a/src/ext/siphash.h
+++ b/src/ext/siphash.h
@@ -9,5 +9,6 @@ uint64_t siphash24(const void *src, unsigned long src_sz, const struct sipkey *k
void siphash_set_global_key(const struct sipkey *key);
uint64_t siphash24g(const void *src, unsigned long src_sz);
+void siphash_unset_global_key(void);
#endif