openssl/providers/implementations/rands
Dimitri John Ledkov 3b7bd871c1 drbg: provide requested amount of entropy, rather than self-strength
Parent DRBG can be seed source (os or jitter) and thus able to provide
unlimited entropy.

get_entropy is documented to provide at least the request amount of
entropy. If requested amount of entropy is same as, or less than
drbg->strength, everything is compliant. However, if requested entropy
is more than drbg->strength (unlikely, but possible), the returned
amount of entropy will be insufficient and additional repeated calls
to get_entropy will be required.

Reading history of refactors, it seems to me that this function call
previouslly had assumptions and usecases that couldn't ever request or
require more than strength amount of entropy.

If entropy is set, request that amount, otherwise request
drbg->strength amount.

Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
(Merged from https://github.com/openssl/openssl/pull/25850)
2025-01-14 12:12:02 +01:00
..
seeding providers: stop probing for getentropy(3) on recent FreeBSD 2024-12-03 10:35:49 +01:00
build.info jitter: support an internal jitter entropy source in the FIPS provider 2024-10-09 13:53:10 +11:00
drbg.c drbg: provide requested amount of entropy, rather than self-strength 2025-01-14 12:12:02 +01:00
drbg_ctr.c Change all existing FIPS configurable checks to use FIPS indicators. 2024-07-11 08:29:43 +10:00
drbg_hash.c Change all existing FIPS configurable checks to use FIPS indicators. 2024-07-11 08:29:43 +10:00
drbg_hmac.c Change all existing FIPS configurable checks to use FIPS indicators. 2024-07-11 08:29:43 +10:00
drbg_local.h rand: remove unused field in DRBG structure 2024-09-19 08:43:58 +10:00
fips_crng_test.c fips: fix locking issues 2024-10-09 13:53:10 +11:00
seed_src.c Fix leak of a RAND_POOL in error condition 2024-12-13 08:30:18 +01:00
seed_src_jitter.c Fix leak of a RAND_POOL in error condition 2024-12-13 08:30:18 +01:00
test_rng.c Add utility function ossl_param_is_empty() 2024-10-09 11:13:46 +02:00