summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>2022-03-29 21:50:21 +0200
committerDr. Matthias St. Pierre <matthias.st.pierre@ncp-e.com>2022-04-09 23:06:27 +0200
commitc1c7004e7fcddcbb767c47f8dc1831c4637d1b74 (patch)
treedaa92635edfb9db5016baf63a4a4b0b06716b063
parent2b6617511e424e5a0e8b841918ad2cae864e2699 (diff)
err: get rid of err_free_strings_int()
Even though the function is not part of the public api, it is not entirely removed, in order to minimize the chance of breakage, because it is exported from libcrypto. Instead, we keep a dummy implementation. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17975)
-rw-r--r--crypto/err/err.c3
-rw-r--r--crypto/init.c11
-rw-r--r--ssl/ssl_init.c17
3 files changed, 3 insertions, 28 deletions
diff --git a/crypto/err/err.c b/crypto/err/err.c
index 7af598fb81..49e6f479db 100644
--- a/crypto/err/err.c
+++ b/crypto/err/err.c
@@ -415,8 +415,7 @@ int ERR_unload_strings(int lib, ERR_STRING_DATA *str)
void err_free_strings_int(void)
{
- if (!RUN_ONCE(&err_string_init, do_err_strings_init))
- return;
+ /* obsolete */
}
/********************************************************/
diff --git a/crypto/init.c b/crypto/init.c
index 1b0d523bea..09d75864f4 100644
--- a/crypto/init.c
+++ b/crypto/init.c
@@ -211,7 +211,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_nodelete)
}
static CRYPTO_ONCE load_crypto_strings = CRYPTO_ONCE_STATIC_INIT;
-static int load_crypto_strings_inited = 0;
+
DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings)
{
int ret = 1;
@@ -225,7 +225,6 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_crypto_strings)
"err_load_crypto_strings_int()\n");
# endif
ret = err_load_crypto_strings_int();
- load_crypto_strings_inited = 1;
#endif
return ret;
}
@@ -549,14 +548,6 @@ void OPENSSL_cleanup(void)
async_deinit();
}
- if (load_crypto_strings_inited) {
-#ifdef OPENSSL_INIT_DEBUG
- fprintf(stderr, "OPENSSL_INIT: OPENSSL_cleanup: "
- "err_free_strings_int()\n");
-#endif
- err_free_strings_int();
- }
-
key = destructor_key.value;
destructor_key.sane = -1;
CRYPTO_THREAD_cleanup_local(&key);
diff --git a/ssl/ssl_init.c b/ssl/ssl_init.c
index d083d95970..d2bcd97398 100644
--- a/ssl/ssl_init.c
+++ b/ssl/ssl_init.c
@@ -116,7 +116,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_ssl_base)
}
static CRYPTO_ONCE ssl_strings = CRYPTO_ONCE_STATIC_INIT;
-static int ssl_strings_inited = 0;
+
DEFINE_RUN_ONCE_STATIC(ossl_init_load_ssl_strings)
{
/*
@@ -129,7 +129,6 @@ DEFINE_RUN_ONCE_STATIC(ossl_init_load_ssl_strings)
"ERR_load_SSL_strings()\n");
# endif
ERR_load_SSL_strings();
- ssl_strings_inited = 1;
#endif
return 1;
}
@@ -157,20 +156,6 @@ static void ssl_library_stop(void)
ssl_comp_free_compression_methods_int();
#endif
}
-
- if (ssl_strings_inited) {
-#ifdef OPENSSL_INIT_DEBUG
- fprintf(stderr, "OPENSSL_INIT: ssl_library_stop: "
- "err_free_strings_int()\n");
-#endif
- /*
- * If both crypto and ssl error strings are inited we will end up
- * calling err_free_strings_int() twice - but that's ok. The second
- * time will be a no-op. It's easier to do that than to try and track
- * between the two libraries whether they have both been inited.
- */
- err_free_strings_int();
- }
}
/*