Add handling for additional input in jitter rng

Fixes #25917

Reviewed-by: Saša Nedvědický <sashan@openssl.org>
Reviewed-by: Hugo Landau <hlandau@devever.net>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25966)
This commit is contained in:
jsondevers 2024-11-28 11:49:23 -05:00 committed by Tomas Mraz
parent 04812ed1de
commit 4d41cc9103

View File

@ -194,6 +194,14 @@ static int jitter_generate(void *vseed, unsigned char *out, size_t outlen,
return 0;
}
if (adin != NULL && adin_len > 0) {
if (!ossl_rand_pool_add(pool, adin, adin_len, 0)) {
ERR_raise(ERR_LIB_PROV, ERR_R_RAND_LIB);
ossl_rand_pool_free(pool);
return 0;
}
}
/* Get entropy from jitter entropy library. */
entropy_available = ossl_prov_acquire_entropy_from_jitter(s, pool);