Skip to content

Commit

Permalink
drbg: add handling for cases where TSAN isn't available
Browse files Browse the repository at this point in the history
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 #17479)
  • Loading branch information
paulidale committed Jan 13, 2022
1 parent d1a488e commit 589e0ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions providers/implementations/rands/drbg.c
Expand Up @@ -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:
Expand Down

0 comments on commit 589e0ab

Please sign in to comment.