diff options
author | Pauli <ppzgs1@gmail.com> | 2021-02-23 09:52:15 +1000 |
---|---|---|
committer | Pauli <ppzgs1@gmail.com> | 2021-02-26 18:08:41 +1000 |
commit | caa60428cd8f0aa60cd2fb7e6da4f5aa9664ae16 (patch) | |
tree | 7e20c51cc6003db212ae2e7228623e22e1feab29 /crypto | |
parent | 1c9eaf42510d0756ce0d219c5127dff2f1a0b83d (diff) |
evp: support modified gettable/settable ctx calls for RNGs
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/evp_rand.c | 32 |
1 files changed, 28 insertions, 4 deletions
diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index b27f4e11a0..bc8c24b3b5 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -428,18 +428,42 @@ const OSSL_PARAM *EVP_RAND_gettable_params(const EVP_RAND *rand) const OSSL_PARAM *EVP_RAND_gettable_ctx_params(const EVP_RAND *rand) { + void *provctx; + if (rand->gettable_ctx_params == NULL) return NULL; - return rand->gettable_ctx_params( - ossl_provider_ctx(EVP_RAND_provider(rand))); + provctx = ossl_provider_ctx(EVP_RAND_provider(rand)); + return rand->gettable_ctx_params(NULL, provctx); } const OSSL_PARAM *EVP_RAND_settable_ctx_params(const EVP_RAND *rand) { + void *provctx; + if (rand->settable_ctx_params == NULL) return NULL; - return rand->settable_ctx_params( - ossl_provider_ctx(EVP_RAND_provider(rand))); + provctx = ossl_provider_ctx(EVP_RAND_provider(rand)); + return rand->settable_ctx_params(NULL, provctx); +} + +const OSSL_PARAM *EVP_RAND_CTX_gettable_params(EVP_RAND_CTX *ctx) +{ + void *provctx; + + if (ctx->meth->gettable_ctx_params == NULL) + return NULL; + provctx = ossl_provider_ctx(EVP_RAND_provider(ctx->meth)); + return ctx->meth->gettable_ctx_params(ctx->data, provctx); +} + +const OSSL_PARAM *EVP_RAND_CTX_settable_params(EVP_RAND_CTX *ctx) +{ + void *provctx; + + if (ctx->meth->settable_ctx_params == NULL) + return NULL; + provctx = ossl_provider_ctx(EVP_RAND_provider(ctx->meth)); + return ctx->meth->settable_ctx_params(ctx->data, provctx); } void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx, |