diff options
Diffstat (limited to 'crypto/evp/evp_rand.c')
-rw-r--r-- | crypto/evp/evp_rand.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crypto/evp/evp_rand.c b/crypto/evp/evp_rand.c index aea9d72..131550b 100644 --- a/crypto/evp/evp_rand.c +++ b/crypto/evp/evp_rand.c @@ -28,6 +28,7 @@ struct evp_rand_st { OSSL_PROVIDER *prov; int name_id; + const char *description; CRYPTO_REF_COUNT refcnt; CRYPTO_RWLOCK *refcnt_lock; @@ -112,10 +113,11 @@ static void evp_rand_unlock(EVP_RAND_CTX *rand) rand->meth->unlock(rand->data); } -static void *evp_rand_from_dispatch(int name_id, - const OSSL_DISPATCH *fns, - OSSL_PROVIDER *prov) +static void *evp_rand_from_algorithm(int name_id, + const OSSL_ALGORITHM *algodef, + OSSL_PROVIDER *prov) { + const OSSL_DISPATCH *fns = algodef->implementation; EVP_RAND *rand = NULL; int fnrandcnt = 0, fnctxcnt = 0, fnlockcnt = 0, fnenablelockcnt = 0; #ifdef FIPS_MODULE @@ -127,6 +129,7 @@ static void *evp_rand_from_dispatch(int name_id, return NULL; } rand->name_id = name_id; + rand->description = algodef->algorithm_description; rand->dispatch = fns; for (; fns->function_id != 0; fns++) { switch (fns->function_id) { @@ -268,7 +271,7 @@ EVP_RAND *EVP_RAND_fetch(OSSL_LIB_CTX *libctx, const char *algorithm, const char *properties) { return evp_generic_fetch(libctx, OSSL_OP_RAND, algorithm, properties, - evp_rand_from_dispatch, evp_rand_up_ref, + evp_rand_from_algorithm, evp_rand_up_ref, evp_rand_free); } @@ -472,7 +475,7 @@ void EVP_RAND_do_all_provided(OSSL_LIB_CTX *libctx, { evp_generic_do_all(libctx, OSSL_OP_RAND, (void (*)(void *, void *))fn, arg, - evp_rand_from_dispatch, evp_rand_free); + evp_rand_from_algorithm, evp_rand_free); } int EVP_RAND_names_do_all(const EVP_RAND *rand, |