openssl/providers/implementations
Matthias St. Pierre 7998e7dc07 rand: fix seeding from a weak entropy source
The 'rand_generate' method is not well suited for being used with
weak entropy sources in the 'get_entropy' callback, because the
caller needs to provide a preallocated buffer without knowing
how much bytes are actually needed to collect the required entropy.

Instead we use the 'rand_get_seed' and 'rand_clear_seed' methods
which were exactly designed for this purpose: it's the callee who
allocates and fills the buffer, and finally cleans it up again.

The 'rand_get_seed' and 'rand_clear_seed' methods are currently
optional for a provided random generator. We could fall back to
using 'rand_generate' if those methods are not implemented.
However, imo it would be better to simply make them an officially
documented requirement for seed sources.

Fixes #22332

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/22394)
2023-10-24 11:14:11 +01:00
..
asymciphers Copyright year updates 2023-09-07 09:59:15 +01:00
ciphers Avoid another copy of key schedule pointer in PROV_GCM_CTX 2023-10-16 12:12:36 +02:00
digests Fix coverity alert on use of uninitialised data 2023-10-05 19:07:55 +02:00
encode_decode Restore the meaning of EVP_PKEY_print_private() 2023-10-04 08:10:55 +02:00
exchange Copyright year updates 2023-09-07 09:59:15 +01:00
include/prov Avoid another copy of key schedule pointer in PROV_GCM_CTX 2023-10-16 12:12:36 +02:00
kdfs Remove use of _Static_assert 2023-09-15 09:20:05 +10:00
kem Copyright year updates 2023-09-07 09:59:15 +01:00
keymgmt DH_check_pub_key() should not fail when setting result code 2023-10-11 16:22:27 +02:00
macs Avoid divide-by-zero in kmac_prov.c's bytepad() 2023-10-09 12:02:59 +02:00
rands rand: fix seeding from a weak entropy source 2023-10-24 11:14:11 +01:00
signature Copyright year updates 2023-09-07 09:59:15 +01:00
storemgmt Copyright year updates 2023-09-07 09:59:15 +01:00
build.info