summaryrefslogtreecommitdiffstats
path: root/crypto/threads_pthread.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2019-04-10 16:01:40 +0200
committerMatt Caswell <matt@openssl.org>2019-05-23 12:02:04 +0200
commit3593266d1c924ea595a1074e78381890f964392c (patch)
tree79a8cd84bb1413f1f692022d433d2fbfa1255bb9 /crypto/threads_pthread.c
parentAdd the NIST CAVS test vectors for CCM (diff)
downloadopenssl-3593266d1c924ea595a1074e78381890f964392c.tar.xz
openssl-3593266d1c924ea595a1074e78381890f964392c.zip
Make core code available within the FIPS module
Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/8728)
Diffstat (limited to 'crypto/threads_pthread.c')
-rw-r--r--crypto/threads_pthread.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index 0a6c903b8b..0d351ca6fa 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -175,7 +175,10 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
return 1;
}
-# ifdef OPENSSL_SYS_UNIX
+# ifndef FIPS_MODE
+/* TODO(3.0): No fork protection in FIPS module yet! */
+
+# ifdef OPENSSL_SYS_UNIX
static pthread_once_t fork_once_control = PTHREAD_ONCE_INIT;
static void fork_once_func(void)
@@ -183,14 +186,15 @@ static void fork_once_func(void)
pthread_atfork(OPENSSL_fork_prepare,
OPENSSL_fork_parent, OPENSSL_fork_child);
}
-# endif
+# endif
int openssl_init_fork_handlers(void)
{
-# ifdef OPENSSL_SYS_UNIX
+# ifdef OPENSSL_SYS_UNIX
if (pthread_once(&fork_once_control, fork_once_func) == 0)
return 1;
-# endif
+# endif
return 0;
}
+# endif /* FIPS_MODE */
#endif