Make the DRBG seed propagation thread safe
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 23 Oct 2021 09:58:27 +0000 (11:58 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 9 Jul 2022 11:17:18 +0000 (13:17 +0200)
commit17098c116d68b3a01fcb688487dccdc0c10b8f63
tree82a522d9663d3bc1f7392be705ded5a7aa2959ce
parenta937806043bda5775091844050e8c632a41922ac
Make the DRBG seed propagation thread safe

Currently there is a race possible because the reseed_counter
of the master drbg may be incremented after the get_entropy call.
Therefore access the parent's reseed_counter while still holding
the rand_drbg_lock.

This improves commit 958fec77928a28350f6af252ac5e8d0e6e081faa

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16900)
crypto/rand/drbg_lib.c
crypto/rand/rand_lib.c