diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/init.c | 25 | ||||
-rw-r--r-- | crypto/threads_pthread.c | 21 |
2 files changed, 21 insertions, 25 deletions
diff --git a/crypto/init.c b/crypto/init.c index cfd4eab9ed..f7c7d59f55 100644 --- a/crypto/init.c +++ b/crypto/init.c @@ -666,28 +666,3 @@ int OPENSSL_atexit(void (*handler)(void)) return 1; } -#ifdef OPENSSL_SYS_UNIX -/* - * The following three functions are for OpenSSL developers. This is - * where we set/reset state across fork (called via pthread_atfork when - * it exists, or manually by the application when it doesn't). - * - * WARNING! If you put code in either OPENSSL_fork_parent or - * OPENSSL_fork_child, you MUST MAKE SURE that they are async-signal- - * safe. See this link, for example: - * http://man7.org/linux/man-pages/man7/signal-safety.7.html - */ - -void OPENSSL_fork_prepare(void) -{ -} - -void OPENSSL_fork_parent(void) -{ -} - -void OPENSSL_fork_child(void) -{ - /* TODO(3.0): Inform all providers about a fork event */ -} -#endif diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c index a2735332b8..d7cac6566a 100644 --- a/crypto/threads_pthread.c +++ b/crypto/threads_pthread.c @@ -7,6 +7,9 @@ * https://www.openssl.org/source/license.html */ +/* We need to use the OPENSSL_fork_*() deprecated APIs */ +#define OPENSSL_SUPPRESS_DEPRECATED + #include <openssl/crypto.h> #include "internal/cryptlib.h" @@ -196,12 +199,30 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock) # ifndef FIPS_MODULE # ifdef OPENSSL_SYS_UNIX + +# ifndef OPENSSL_NO_DEPRECATED_3_0 + +void OPENSSL_fork_prepare(void) +{ +} + +void OPENSSL_fork_parent(void) +{ +} + +void OPENSSL_fork_child(void) +{ +} + +# endif static pthread_once_t fork_once_control = PTHREAD_ONCE_INIT; static void fork_once_func(void) { +# ifndef OPENSSL_NO_DEPRECATED_3_0 pthread_atfork(OPENSSL_fork_prepare, OPENSSL_fork_parent, OPENSSL_fork_child); +# endif } # endif |