diff options
Diffstat (limited to 'crypto/rand/rand_lib.c')
-rw-r--r-- | crypto/rand/rand_lib.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/crypto/rand/rand_lib.c b/crypto/rand/rand_lib.c index caedbca204..3f04ec171e 100644 --- a/crypto/rand/rand_lib.c +++ b/crypto/rand/rand_lib.c @@ -18,6 +18,7 @@ #include "crypto/rand.h" #include "crypto/cryptlib.h" #include "rand_local.h" +#include "crypto/context.h" #ifndef FIPS_MODULE # include <stdio.h> @@ -434,7 +435,7 @@ typedef struct rand_global_st { * Initialize the OSSL_LIB_CTX global DRBGs on first use. * Returns the allocated global data on success or NULL on failure. */ -static void *rand_ossl_ctx_new(OSSL_LIB_CTX *libctx) +void *ossl_rand_ctx_new(OSSL_LIB_CTX *libctx) { RAND_GLOBAL *dgbl = OPENSSL_zalloc(sizeof(*dgbl)); @@ -469,7 +470,7 @@ static void *rand_ossl_ctx_new(OSSL_LIB_CTX *libctx) return NULL; } -static void rand_ossl_ctx_free(void *vdgbl) +void ossl_rand_ctx_free(void *vdgbl) { RAND_GLOBAL *dgbl = vdgbl; @@ -491,16 +492,9 @@ static void rand_ossl_ctx_free(void *vdgbl) OPENSSL_free(dgbl); } -static const OSSL_LIB_CTX_METHOD rand_drbg_ossl_ctx_method = { - OSSL_LIB_CTX_METHOD_PRIORITY_2, - rand_ossl_ctx_new, - rand_ossl_ctx_free, -}; - static RAND_GLOBAL *rand_get_global(OSSL_LIB_CTX *libctx) { - return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX, - &rand_drbg_ossl_ctx_method); + return ossl_lib_ctx_get_data(libctx, OSSL_LIB_CTX_DRBG_INDEX); } static void rand_delete_thread_state(void *arg) |