openssl/include/crypto
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
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
aes_platform.h * Enable extra Arm64 optimization on Windows for GHASH, RAND and AES 2023-10-10 15:37:41 +02:00
aria.h
asn1_dsa.h
asn1.h Copyright year updates 2023-09-28 14:23:29 +01:00
asn1err.h
async.h
asyncerr.h
bioerr.h
bn_conf.h.in
bn_dh.h
bn_srp.h
bn.h Copyright year updates 2023-09-07 09:59:15 +01:00
bnerr.h
buffererr.h
chacha.h
cmll_platform.h
cmperr.h CMP client: fix error response on -csr without private key, also in docs 2023-05-12 10:46:27 +02:00
cmserr.h
comperr.h
conferr.h
context.h Copyright year updates 2023-09-28 14:23:29 +01:00
crmferr.h
cryptlib.h
cryptoerr.h
cterr.h
ctype.h
decoder.h Copyright year updates 2023-09-07 09:59:15 +01:00
decodererr.h
des_platform.h
dh.h
dherr.h
dsa.h Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
dsaerr.h Fix infinite loops in DSA sign code. 2023-03-01 09:20:49 +11:00
dso_conf.h.in
ec.h Implement deterministic ECDSA sign (RFC6979) 2022-11-30 07:31:53 +00:00
ecerr.h Fix potential infinite loops in ECDSA signing. 2023-03-01 09:20:49 +11:00
ecx.h Copyright year updates 2023-09-07 09:59:15 +01:00
encoder.h
encodererr.h
engine.h
engineerr.h
err.h
ess.h
esserr.h
evp.h rand: fix seeding from a weak entropy source 2023-10-24 11:14:11 +01:00
evperr.h
httperr.h
lhash.h
md32_common.h
modes.h providers: Add SM4 XTS implementation 2022-11-29 16:17:30 +01:00
objects.h
objectserr.h
ocsperr.h
pem.h
pemerr.h
pkcs7.h
pkcs7err.h
pkcs12err.h
poly1305.h
ppc_arch.h
punycode.h Copyright year updates 2023-09-07 09:59:15 +01:00
rand_pool.h
rand.h rand: add callbacks to cleanup the user entropy resp. nonce 2023-10-20 09:48:34 +01:00
randerr.h rand: add extra error code 2023-09-27 17:22:54 +01:00
riscv_arch.def
riscv_arch.h Copyright year updates 2023-09-07 09:59:15 +01:00
rsa.h Copyright year updates 2023-09-07 09:59:15 +01:00
rsaerr.h
security_bits.h
sha.h Copyright year updates 2023-09-07 09:59:15 +01:00
siphash.h
siv.h
sm2.h
sm2err.h
sm4_platform.h * Enable extra Arm64 optimization on Windows for GHASH, RAND and AES 2023-10-10 15:37:41 +02:00
sm4.h
sparc_arch.h Split bignum code out of the sparcv9cap.c 2021-07-15 09:33:04 +02:00
sparse_array.h
store.h
storeerr.h
tserr.h
types.h Copyright year updates 2023-09-07 09:59:15 +01:00
uierr.h
x509.h Fix decoders so that they use the passed in propq. 2023-08-16 18:02:51 +02:00
x509err.h
x509v3err.h