summaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorPauli <ppzgs1@gmail.com>2021-02-23 10:46:08 +1000
committerPauli <ppzgs1@gmail.com>2021-02-26 18:08:41 +1000
commita5120afda32e67435624cef1fe0d49bf699e4ca5 (patch)
tree539bca0cdb918c5dacc33ac2a5e2ed7476cdc0e0 /crypto
parent530cacb56fbe02da8aca436c4c1ae8000200e69c (diff)
evp: support modified gettable/settable ctx calls for KDFs
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/kdf_meth.c30
1 files changed, 28 insertions, 2 deletions
diff --git a/crypto/evp/kdf_meth.c b/crypto/evp/kdf_meth.c
index 40e71e8cd8..659788a58d 100644
--- a/crypto/evp/kdf_meth.c
+++ b/crypto/evp/kdf_meth.c
@@ -174,16 +174,42 @@ const OSSL_PARAM *EVP_KDF_gettable_params(const EVP_KDF *kdf)
const OSSL_PARAM *EVP_KDF_gettable_ctx_params(const EVP_KDF *kdf)
{
+ void *alg;
+
if (kdf->gettable_ctx_params == NULL)
return NULL;
- return kdf->gettable_ctx_params(ossl_provider_ctx(EVP_KDF_provider(kdf)));
+ alg = ossl_provider_ctx(EVP_KDF_provider(kdf));
+ return kdf->gettable_ctx_params(NULL, alg);
}
const OSSL_PARAM *EVP_KDF_settable_ctx_params(const EVP_KDF *kdf)
{
+ void *alg;
+
if (kdf->settable_ctx_params == NULL)
return NULL;
- return kdf->settable_ctx_params(ossl_provider_ctx(EVP_KDF_provider(kdf)));
+ alg = ossl_provider_ctx(EVP_KDF_provider(kdf));
+ return kdf->settable_ctx_params(NULL, alg);
+}
+
+const OSSL_PARAM *EVP_KDF_CTX_gettable_params(EVP_KDF_CTX *ctx)
+{
+ void *alg;
+
+ if (ctx->meth->gettable_ctx_params == NULL)
+ return NULL;
+ alg = ossl_provider_ctx(EVP_KDF_provider(ctx->meth));
+ return ctx->meth->gettable_ctx_params(ctx->data, alg);
+}
+
+const OSSL_PARAM *EVP_KDF_CTX_settable_params(EVP_KDF_CTX *ctx)
+{
+ void *alg;
+
+ if (ctx->meth->settable_ctx_params == NULL)
+ return NULL;
+ alg = ossl_provider_ctx(EVP_KDF_provider(ctx->meth));
+ return ctx->meth->settable_ctx_params(ctx->data, alg);
}
void EVP_KDF_do_all_provided(OSSL_LIB_CTX *libctx,