summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2019-09-03 17:47:13 +0200
committerRichard Levitte <levitte@openssl.org>2019-09-04 10:38:13 +0200
commit3fd7026276475d72a3b5bbbe42cd1f5ff6b0e736 (patch)
treeff3ecbeaebf4ee6fbe3db1b842e4e6797d9c2580 /providers
parent8648a50a2704307fa4633b3d11724dfdae11f125 (diff)
New function EVP_MD_free()
This function re-implements EVP_MD_meth_free(), but has a name that isn't encumbered by legacy EVP_MD construction functionality. We also refactor most of EVP_MD_meth_new() into an internal evp_md_new() that's used when creating fetched methods. EVP_MD_meth_new() and EVP_MD_meth_free() are rewritten in terms of evp_md_new() and EVP_MD_free(). This means that at any time, we can deprecate all the EVP_MD_meth_ functions with no harmful consequence. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/9758)
Diffstat (limited to 'providers')
-rw-r--r--providers/common/macs/hmac_prov.c4
-rw-r--r--providers/common/macs/kmac_prov.c4
-rw-r--r--providers/fips/fipsprov.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/providers/common/macs/hmac_prov.c b/providers/common/macs/hmac_prov.c
index e9be9802e6..d5f6db79de 100644
--- a/providers/common/macs/hmac_prov.c
+++ b/providers/common/macs/hmac_prov.c
@@ -79,7 +79,7 @@ static void hmac_free(void *vmacctx)
if (macctx != NULL) {
HMAC_CTX_free(macctx->ctx);
- EVP_MD_meth_free(macctx->alloc_md);
+ EVP_MD_free(macctx->alloc_md);
OPENSSL_free(macctx);
}
}
@@ -222,7 +222,7 @@ static int hmac_set_ctx_params(void *vmacctx, const OSSL_PARAM params[])
propquery = p->data;
}
- EVP_MD_meth_free(macctx->alloc_md);
+ EVP_MD_free(macctx->alloc_md);
macctx->tmpmd = macctx->alloc_md =
EVP_MD_fetch(PROV_LIBRARY_CONTEXT_OF(macctx->provctx),
diff --git a/providers/common/macs/kmac_prov.c b/providers/common/macs/kmac_prov.c
index b1e852ac77..9ffdbd5249 100644
--- a/providers/common/macs/kmac_prov.c
+++ b/providers/common/macs/kmac_prov.c
@@ -150,7 +150,7 @@ static void kmac_free(void *vmacctx)
if (kctx != NULL) {
EVP_MD_CTX_free(kctx->ctx);
- EVP_MD_meth_free(kctx->alloc_md);
+ EVP_MD_free(kctx->alloc_md);
OPENSSL_cleanse(kctx->key, kctx->key_len);
OPENSSL_cleanse(kctx->custom, kctx->custom_len);
OPENSSL_free(kctx);
@@ -197,7 +197,7 @@ static void *kmac_fetch_new(void *provctx, const char *mdname)
ret = kmac_new(provctx, fetched_md, md);
if (ret == NULL)
- EVP_MD_meth_free(fetched_md);
+ EVP_MD_free(fetched_md);
return ret;
}
diff --git a/providers/fips/fipsprov.c b/providers/fips/fipsprov.c
index f8f0a90c24..000bf73672 100644
--- a/providers/fips/fipsprov.c
+++ b/providers/fips/fipsprov.c
@@ -186,7 +186,7 @@ static int dummy_evp_call(void *provctx)
BN_CTX_free(bnctx);
EVP_MD_CTX_free(ctx);
- EVP_MD_meth_free(sha256);
+ EVP_MD_free(sha256);
#ifndef OPENSSL_NO_EC
EC_KEY_free(key);