From: Pauli Date: Wed, 12 Jan 2022 04:01:17 +0000 (+1100) Subject: drbg: add handling for cases where TSAN isn't available X-Git-Tag: openssl-3.2.0-alpha1~3079 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ff861dcee38a41ce93374753e8c462e4b9012e2;p=thirdparty%2Fopenssl.git 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 (Merged from https://github.com/openssl/openssl/pull/17479) --- diff --git a/providers/implementations/rands/drbg.c b/providers/implementations/rands/drbg.c index 8b899b99b17..16d382dced8 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: