mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-04-03 11:06:14 +02:00
In some scenarios, application or integration code knows that the random generator should be reseeded, but the reseed cannot or must not happen immediately and there is no way to report errors. In such scenarios, users can call the new function `psa_random_deplete()`, which just marks the DRBG as needing a reseed. This change requires DRBG modules to treat `reseed_counter == reseed_interval` as a condition that requires a reseed. Historically they reseeded when `reseed_counter > reseed_interval`, but that made it impossible to require a reseed when `reseed_interval == MAX_INT`. Note that this edge case is not tested. Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>