aboutsummaryrefslogtreecommitdiff
path: root/src/lib/crypt_ops/crypto_init.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2018-08-29 08:39:19 -0400
committerNick Mathewson <nickm@torproject.org>2018-09-04 14:52:35 -0400
commit36f3bdac032523c6d98022c84059d8ebd69dfdfe (patch)
treeeea45e6d9bbef824151bd098dbc9e06fa70f626c /src/lib/crypt_ops/crypto_init.c
parent52ac539b9938af6c47355b67ce1def1236f4ee39 (diff)
downloadtor-36f3bdac032523c6d98022c84059d8ebd69dfdfe.tar.gz
tor-36f3bdac032523c6d98022c84059d8ebd69dfdfe.zip
Update prefork and postfork NSS code for unit tests.
Diffstat (limited to 'src/lib/crypt_ops/crypto_init.c')
-rw-r--r--src/lib/crypt_ops/crypto_init.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib/crypt_ops/crypto_init.c b/src/lib/crypt_ops/crypto_init.c
index f9b077e9e7..6fc8e5d94c 100644
--- a/src/lib/crypt_ops/crypto_init.c
+++ b/src/lib/crypt_ops/crypto_init.c
@@ -58,7 +58,7 @@ crypto_early_init(void)
crypto_openssl_early_init();
#endif
#ifdef ENABLE_NSS
- crypto_nss_early_init();
+ crypto_nss_early_init(0);
#endif
if (crypto_seed_rng() < 0)
@@ -137,6 +137,16 @@ crypto_global_cleanup(void)
/** Run operations that the crypto library requires to be happy again
* after forking. */
void
+crypto_prefork(void)
+{
+#ifdef ENABLE_NSS
+ crypto_nss_prefork();
+#endif
+}
+
+/** Run operations that the crypto library requires to be happy again
+ * after forking. */
+void
crypto_postfork(void)
{
#ifdef ENABLE_NSS