aboutsummaryrefslogtreecommitdiff
path: root/src/test/testing_common.c
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-04-28 15:06:38 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2022-04-28 15:12:17 -0400
commit8f77db28427df202d9d6bcbac96da4d1daec099d (patch)
tree20b1affffa8cab792b7891b34c803dd1a10e2daa /src/test/testing_common.c
parent4259bc36af4aea0184488cbef00cef5dd1002044 (diff)
downloadtor-8f77db28427df202d9d6bcbac96da4d1daec099d.tar.gz
tor-8f77db28427df202d9d6bcbac96da4d1daec099d.zip
test: Re-init pregenerated RSA keys for NSS only
Not revalidating keys on every fork speeds up make test from about 45 seconds to 10 seconds with OpenSSL 1.1.1n and from 6 minutes to 10 seconds with OpenSSL 3.0.2.
Diffstat (limited to 'src/test/testing_common.c')
-rw-r--r--src/test/testing_common.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/testing_common.c b/src/test/testing_common.c
index 2fd424c07e..88d04e6082 100644
--- a/src/test/testing_common.c
+++ b/src/test/testing_common.c
@@ -244,14 +244,18 @@ void tinytest_postfork(void);
void
tinytest_prefork(void)
{
+#ifdef ENABLE_NSS
free_pregenerated_keys();
+#endif
subsystems_prefork();
}
void
tinytest_postfork(void)
{
subsystems_postfork();
+#ifdef ENABLE_NSS
init_pregenerated_keys();
+#endif
}
static void