summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-02-23 11:03:49 +1000
committerPauli <ppzgs1@gmail.com>2021-02-26 18:08:41 +1000
commit35c76a528bb14611d7ff2c77762b16cf28c1fef3 (patch)
treea401989ceaa5c9cf71ed15105ea1dbc3c9221d12 /crypto
parent8dd233bb07607239bea31f33224df2ac37eddb57 (diff)
evp: support modified gettable/settable ctx calls for MACs
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14240)
Diffstat (limited to 'crypto')
-rw-r--r--crypto/evp/mac_meth.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c
index edf08389e9..85f87e4c61 100644
--- a/crypto/evp/mac_meth.c
+++ b/crypto/evp/mac_meth.c
@@ -181,16 +181,42 @@ const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac)
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac)
{
+ void *alg;
+
if (mac->gettable_ctx_params == NULL)
return NULL;
- return mac->gettable_ctx_params(ossl_provider_ctx(EVP_MAC_provider(mac)));
+ alg = ossl_provider_ctx(EVP_MAC_provider(mac));
+ return mac->gettable_ctx_params(NULL, alg);
}
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac)
{
+ void *alg;
+
if (mac->settable_ctx_params == NULL)
return NULL;
- return mac->settable_ctx_params(ossl_provider_ctx(EVP_MAC_provider(mac)));
+ alg = ossl_provider_ctx(EVP_MAC_provider(mac));
+ return mac->settable_ctx_params(NULL, alg);
+}
+
+const OSSL_PARAM *EVP_MAC_CTX_gettable_params(EVP_MAC_CTX *ctx)
+{
+ void *alg;
+
+ if (ctx->meth->gettable_ctx_params == NULL)
+ return NULL;
+ alg = ossl_provider_ctx(EVP_MAC_provider(ctx->meth));
+ return ctx->meth->gettable_ctx_params(ctx->data, alg);
+}
+
+const OSSL_PARAM *EVP_MAC_CTX_settable_params(EVP_MAC_CTX *ctx)
+{
+ void *alg;
+
+ if (ctx->meth->settable_ctx_params == NULL)
+ return NULL;
+ alg = ossl_provider_ctx(EVP_MAC_provider(ctx->meth));
+ return ctx->meth->settable_ctx_params(ctx->data, alg);
}
void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,