[openssl] master update

Dr. Paul Dale pauli at openssl.org
Mon Dec 14 00:46:15 UTC 2020


The branch master has been updated
       via  c739222b5ad68fa23bfdf4807106769f9428506c (commit)
      from  469491536d7810337110823f1b5ca296c7ca8cc1 (commit)


- Log -----------------------------------------------------------------
commit c739222b5ad68fa23bfdf4807106769f9428506c
Author: Matt Caswell <matt at openssl.org>
Date:   Wed Dec 9 16:26:29 2020 +0000

    Fix no-threads
    
    Make OPENSSL_fork_prepare() et al always available even in a no-threads
    build. These functions are no-ops anyway so this shouldn't make any
    difference.
    
    This fixes an issue where the symbol_presence test fails in a no-threads
    build. This is because these functions have not been marked in
    libcrypto.num as being dependent on thread support. Enclosing the
    declarations of the functions in the header with an appropriate guard
    does not help because we never define OPENSSL_NO_THREADS (we define the
    opposite OPENSSL_THREADS). This confuses the scripts which only consider
    OPENSSL_NO_* guards. The simplest solution is to just make them always
    available.
    
    Reviewed-by: Richard Levitte <levitte at openssl.org>
    Reviewed-by: Paul Dale <paul.dale at oracle.com>
    (Merged from https://github.com/openssl/openssl/pull/13647)

-----------------------------------------------------------------------

Summary of changes:
 crypto/build.info                              |  2 +-
 include/crypto/types.h => crypto/threads_lib.c | 19 ++++++++++++++-----
 crypto/threads_pthread.c                       | 15 ---------------
 3 files changed, 15 insertions(+), 21 deletions(-)
 copy include/crypto/types.h => crypto/threads_lib.c (66%)

diff --git a/crypto/build.info b/crypto/build.info
index 814d8dcab7..7fe79e2296 100644
--- a/crypto/build.info
+++ b/crypto/build.info
@@ -71,7 +71,7 @@ $UTIL_COMMON=\
         cryptlib.c params.c params_from_text.c bsearch.c ex_data.c o_str.c \
         ctype.c threads_pthread.c threads_win.c threads_none.c initthread.c \
         context.c sparse_array.c asn1_dsa.c packet.c param_build.c $CPUIDASM \
-        param_build_set.c der_writer.c passphrase.c
+        param_build_set.c der_writer.c passphrase.c threads_lib.c
 $UTIL_DEFINE=$CPUIDDEF
 
 SOURCE[../libcrypto]=$UTIL_COMMON \
diff --git a/include/crypto/types.h b/crypto/threads_lib.c
similarity index 66%
copy from include/crypto/types.h
copy to crypto/threads_lib.c
index ccb75e3cbf..0c7162392d 100644
--- a/include/crypto/types.h
+++ b/crypto/threads_lib.c
@@ -6,11 +6,20 @@
  * in the file LICENSE in the source distribution or at
  * https://www.openssl.org/source/license.html
  */
+#include <openssl/crypto.h>
 
-/* When removal is simulated, we still need the type internally */
+#ifndef OPENSSL_NO_DEPRECATED_3_0
 
-#ifdef OPENSSL_NO_DEPRECATED_3_0
-typedef struct rsa_st RSA;
-typedef struct rsa_meth_st RSA_METHOD;
-#endif
+void OPENSSL_fork_prepare(void)
+{
+}
+
+void OPENSSL_fork_parent(void)
+{
+}
 
+void OPENSSL_fork_child(void)
+{
+}
+
+#endif
diff --git a/crypto/threads_pthread.c b/crypto/threads_pthread.c
index d7cac6566a..afc29b7961 100644
--- a/crypto/threads_pthread.c
+++ b/crypto/threads_pthread.c
@@ -200,21 +200,6 @@ 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)


More information about the openssl-commits mailing list