Correct error reason of verify_signature() in cmp_vfy.c
[openssl.git] / crypto / threads_pthread.c
index c3fd2411db18e27d1a9ff98e1ed3561c7c658c69..8b60251e776714d912bf773d6ca075105b55c4c8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016-2018 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2016-2020 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the Apache License 2.0 (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
 
 #if defined(OPENSSL_THREADS) && !defined(CRYPTO_TDEBUG) && !defined(OPENSSL_SYS_WINDOWS)
 
+# if defined(OPENSSL_SYS_UNIX)
+#  include <sys/types.h>
+#  include <unistd.h>
+#endif
+
 # ifdef PTHREAD_RWLOCK_INITIALIZER
 #  define USE_RWLOCK
 # endif
@@ -185,7 +190,7 @@ int CRYPTO_atomic_add(int *val, int amount, int *ret, CRYPTO_RWLOCK *lock)
     return 1;
 }
 
-# ifndef FIPS_MODE
+# ifndef FIPS_MODULE
 /* TODO(3.0): No fork protection in FIPS module yet! */
 
 #  ifdef OPENSSL_SYS_UNIX
@@ -206,5 +211,10 @@ int openssl_init_fork_handlers(void)
 #  endif
     return 0;
 }
-# endif /* FIPS_MODE */
+# endif /* FIPS_MODULE */
+
+int openssl_get_fork_id(void)
+{
+    return getpid();
+}
 #endif