diff options
author | Pauli <pauli@openssl.org> | 2022-01-12 15:01:17 +1100 |
---|---|---|
committer | Pauli <pauli@openssl.org> | 2022-01-13 21:53:32 +1100 |
commit | 589e0ab4ebf35e1e73d826ad08160b9e6060e616 (patch) | |
tree | 4d0126aba2be3481bfd98016d3ecf23b229e0ce8 /providers | |
parent | d1a488e944275a1b5db50ce02c1593aedb37c1f9 (diff) |
drbg: add handling for cases where TSAN isn't available
Most of the DRGB code is run under lock from the EVP layer. This is relied
on to make the majority of TSAN operations safe. However, it is still necessary
to enable locking for all DRBGs created.
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/17479)
Diffstat (limited to 'providers')
-rw-r--r-- | providers/implementations/rands/drbg.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/providers/implementations/rands/drbg.c b/providers/implementations/rands/drbg.c index 8b899b99b1..16d382dced 100644 --- a/providers/implementations/rands/drbg.c +++ b/providers/implementations/rands/drbg.c @@ -837,6 +837,10 @@ PROV_DRBG *ossl_rand_drbg_new goto err; } } +#ifdef TSAN_REQUIRES_LOCKING + if (!ossl_drbg_enable_locking(drbg)) + goto err; +#endif return drbg; err: |