X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Frand%2Fdrbg_rand.c;h=8b30cd8a0dc414617c5fd21f2f10c73f48fedcae;hp=77d59ec8136ddbf11612302ea5f96f5994b6f2e8;hb=8389ec4b4950b9474e72a959eb0b0a6ce77ac1e8;hpb=0d7903f83f84bba1d29225efd999c633a0c5ba01;ds=inline diff --git a/crypto/rand/drbg_rand.c b/crypto/rand/drbg_rand.c index 77d59ec813..8b30cd8a0d 100644 --- a/crypto/rand/drbg_rand.c +++ b/crypto/rand/drbg_rand.c @@ -29,8 +29,12 @@ static CRYPTO_ONCE ossl_drbg_init = CRYPTO_ONCE_STATIC_INIT; DEFINE_RUN_ONCE_STATIC(do_ossl_drbg_init) { + int st = 1; + ossl_drbg.lock = CRYPTO_THREAD_lock_new(); - return ossl_drbg.lock != NULL; + st &= ossl_drbg.lock != NULL; + st &= RAND_DRBG_set(&ossl_drbg, NID_aes_128_ctr, 0) == 1; + return st; } void rand_drbg_cleanup(void)