openssl/crypto/rand
Matt Caswell f5a50c2a07 Enable locking on the primary DRBG when we create it
The primary DRBG may be shared across multiple threads and therefore
we must use locking to access it. Previously we were enabling that locking
lazily when we attempted to obtain one of the child DRBGs. Part of the
process of enabling the lock, is to create the lock. But if we create the
lock lazily then it is too late - we may race with other threads where each
thread is independently attempting to enable the locking. This results
in multiple locks being created - only one of which "sticks" and the rest
are leaked.

Instead we enable locking on the primary when we first create it. This is
already locked and therefore we cannot race.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13660)
2021-01-14 17:30:46 +00:00
..
build.info rand: move the entropy source out of the FIPS provider 2020-11-20 08:24:21 +10:00
prov_seed.c rand: move the entropy source out of the FIPS provider 2020-11-20 08:24:21 +10:00
rand_deprecated.c evp_rand: documentation 2020-06-24 20:07:46 +10:00
rand_egd.c Use OPENSSL_SYS_TANDEM instead of OPENSSL_SYSNAME_TANDEM 2020-09-24 08:06:50 +02:00
rand_err.c ERR: Rebuild all generated error headers and source files 2020-11-24 15:22:33 +01:00
rand_lib.c Enable locking on the primary DRBG when we create it 2021-01-14 17:30:46 +00:00
rand_local.h rand_drbg: remove RAND_DRBG. 2020-08-07 14:16:47 +10:00
rand_meth.c rand_drbg: remove RAND_DRBG. 2020-08-07 14:16:47 +10:00
rand_pool.c rand: move the entropy source out of the FIPS provider 2020-11-20 08:24:21 +10:00
randfile.c CRYPTO: refactor ERR_raise()+ERR_add_error_data() to ERR_raise_data() 2020-11-13 09:35:31 +01:00