summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crypto/evp/mac_meth.c30
-rw-r--r--include/openssl/evp.h2
2 files changed, 30 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,
diff --git a/include/openssl/evp.h b/include/openssl/evp.h
index 015cb9f158..17250be90e 100644
--- a/include/openssl/evp.h
+++ b/include/openssl/evp.h
@@ -1149,6 +1149,8 @@ int EVP_MAC_final(EVP_MAC_CTX *ctx,
const OSSL_PARAM *EVP_MAC_gettable_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_gettable_ctx_params(const EVP_MAC *mac);
const OSSL_PARAM *EVP_MAC_settable_ctx_params(const EVP_MAC *mac);
+const OSSL_PARAM *EVP_MAC_CTX_gettable_params(EVP_MAC_CTX *ctx);
+const OSSL_PARAM *EVP_MAC_CTX_settable_params(EVP_MAC_CTX *ctx);
void EVP_MAC_do_all_provided(OSSL_LIB_CTX *libctx,
void (*fn)(EVP_MAC *mac, void *arg),