summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorRich Salz <rsalz@akamai.com>2019-12-04 13:15:08 -0500
committerRichard Levitte <levitte@openssl.org>2019-12-14 20:57:35 +0100
commit742ccab318b13a8779d9f9164d479b4a428a6da8 (patch)
tree47e5cb0544e2f74a4fbefcdd30cb65d8078f214f /providers
parent4e3ee452d091615e52a43e6e7c6db7d09e260353 (diff)
Deprecate most of debug-memory
Fixes #8322 The leak-checking (and backtrace option, on some platforms) provided by crypto-mdebug and crypto-mdebug-backtrace have been mostly neutered; only the "make malloc fail" capability remains. OpenSSL recommends using the compiler's leak-detection instead. The OPENSSL_DEBUG_MEMORY environment variable is no longer used. CRYPTO_mem_ctrl(), CRYPTO_set_mem_debug(), CRYPTO_mem_leaks(), CRYPTO_mem_leaks_fp() and CRYPTO_mem_leaks_cb() return a failure code. CRYPTO_mem_debug_{malloc,realloc,free}() have been removed. All of the above are now deprecated. Merge (now really small) mem_dbg.c into mem.c Reviewed-by: Paul Dale <paul.dale@oracle.com> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/10572)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/fipsprov.c9
-rw-r--r--providers/fips/selftest.c3
2 files changed, 0 insertions, 12 deletions
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index 6a5ae3a3f1..12c471f325 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -60,7 +60,6 @@ static OSSL_CRYPTO_secure_zalloc_fn *c_CRYPTO_secure_zalloc;
static OSSL_CRYPTO_secure_free_fn *c_CRYPTO_secure_free;
static OSSL_CRYPTO_secure_clear_free_fn *c_CRYPTO_secure_clear_free;
static OSSL_CRYPTO_secure_allocated_fn *c_CRYPTO_secure_allocated;
-static OSSL_CRYPTO_mem_ctrl_fn *c_CRYPTO_mem_ctrl;
typedef struct fips_global_st {
const OSSL_PROVIDER *prov;
@@ -516,9 +515,6 @@ int OSSL_provider_init(const OSSL_PROVIDER *provider,
case OSSL_FUNC_CRYPTO_SECURE_ALLOCATED:
c_CRYPTO_secure_allocated = OSSL_get_CRYPTO_secure_allocated(in);
break;
- case OSSL_FUNC_CRYPTO_MEM_CTRL:
- c_CRYPTO_mem_ctrl = OSSL_get_CRYPTO_mem_ctrl(in);
- break;
case OSSL_FUNC_BIO_NEW_FILE:
selftest_params.bio_new_file_cb = OSSL_get_BIO_new_file(in);
break;
@@ -704,8 +700,3 @@ int CRYPTO_secure_allocated(const void *ptr)
{
return c_CRYPTO_secure_allocated(ptr);
}
-
-int CRYPTO_mem_ctrl(int mode)
-{
- return c_CRYPTO_mem_ctrl(mode);
-}
diff --git a/providers/fips/selftest.c b/providers/fips/selftest.c
index 369a6bab3b..5dcc0adf43 100644
--- a/providers/fips/selftest.c
+++ b/providers/fips/selftest.c
@@ -46,10 +46,7 @@ DEFINE_RUN_ONCE_STATIC(do_fips_self_test_init)
* platform then we just leak it deliberately. So we temporarily disable the
* mem leak checking while we allocate this.
*/
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_DISABLE);
self_test_lock = CRYPTO_THREAD_lock_new();
- CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ENABLE);
-
return self_test_lock != NULL;
}