diff options
author | Pauli <ppzgs1@gmail.com> | 2021-02-23 11:03:49 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-26 18:08:41 +1000 |
commit | 35c76a528bb14611d7ff2c77762b16cf28c1fef3 (patch) | |
tree | a401989ceaa5c9cf71ed15105ea1dbc3c9221d12 /crypto/evp/mac_meth.c | |
parent | 8dd233bb07607239bea31f33224df2ac37eddb57 (diff) | |
download | openssl-35c76a528bb14611d7ff2c77762b16cf28c1fef3.zip openssl-35c76a528bb14611d7ff2c77762b16cf28c1fef3.tar.gz openssl-35c76a528bb14611d7ff2c77762b16cf28c1fef3.tar.bz2 |
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/evp/mac_meth.c')
-rw-r--r-- | crypto/evp/mac_meth.c | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/crypto/evp/mac_meth.c b/crypto/evp/mac_meth.c index edf0838..85f87e4 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, |