Deprecate CRYPTO_cleanup_all_ex_data() and make it a no-op
authorMatt Caswell <matt@openssl.org>
Mon, 4 Apr 2016 13:38:45 +0000 (14:38 +0100)
committerMatt Caswell <matt@openssl.org>
Wed, 13 Apr 2016 07:52:33 +0000 (08:52 +0100)
CRYPTO_cleanup_all_ex_data() should not be called expicitly - we should
leave auto-deinit to clean this up instead.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ex_data.c
crypto/include/internal/cryptlib.h
crypto/init.c
include/openssl/crypto.h

index 6984a1fb2ef232aba3c71a63d56711087b6c815a..573aa4810678ab507028e86b1dbf05d7157495ca 100644 (file)
@@ -175,7 +175,7 @@ static void cleanup_cb(EX_CALLBACK *funcs)
  * called under potential race-conditions anyway (it's for program shutdown
  * after all).
  */
-void CRYPTO_cleanup_all_ex_data(void)
+void crypto_cleanup_all_ex_data_intern(void)
 {
     int i;
 
index 8fe9057935accb407e33e2a38518d45c6cf73941..86adaea7341fef318a83545c98286462a1e60505 100644 (file)
@@ -113,6 +113,7 @@ void OPENSSL_cpuid_setup(void);
 extern unsigned int OPENSSL_ia32cap_P[];
 void OPENSSL_showfatal(const char *fmta, ...);
 extern int OPENSSL_NONPIC_relocated;
+void crypto_cleanup_all_ex_data_intern(void);
 
 #ifdef  __cplusplus
 }
index d93f28281808e16848b81155b78c235e7aa8b8e7..3bfe4502ebbe7f7776c9cbbc67a264466831f24d 100644 (file)
@@ -461,7 +461,7 @@ void OPENSSL_cleanup(void)
                     "ENGINE_cleanup()\n");
 #endif
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
-                    "CRYPTO_cleanup_all_ex_data()\n");
+                    "crypto_cleanup_all_ex_data_intern()\n");
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
                     "BIO_sock_cleanup()\n");
     fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
@@ -483,7 +483,7 @@ void OPENSSL_cleanup(void)
 #ifndef OPENSSL_NO_ENGINE
     ENGINE_cleanup();
 #endif
-    CRYPTO_cleanup_all_ex_data();
+    crypto_cleanup_all_ex_data_intern();
 #ifndef OPENSSL_NO_SOCK
     BIO_sock_cleanup();
 #endif
index d775e9e0b217bdb47155330ff3797f85831f709d..d0ec86a46c8ba70bed1352d8cfdffc1f29018571 100644 (file)
@@ -297,13 +297,14 @@ void CRYPTO_free_ex_data(int class_index, void *obj, CRYPTO_EX_DATA *ad);
  */
 int CRYPTO_set_ex_data(CRYPTO_EX_DATA *ad, int idx, void *val);
 void *CRYPTO_get_ex_data(const CRYPTO_EX_DATA *ad, int idx);
+
+# if OPENSSL_API_COMPAT < 0x10100000L
 /*
  * This function cleans up all "ex_data" state. It mustn't be called under
  * potential race-conditions.
  */
-void CRYPTO_cleanup_all_ex_data(void);
+# define CRYPTO_cleanup_all_ex_data()
 
-# if OPENSSL_API_COMPAT < 0x10100000L
 /*
  * The old locking functions have been removed completely without compatibility
  * macros. This is because the old functions either could not properly report