From 4d41cc910306868285b89bd4b95d79bac693a630 Mon Sep 17 00:00:00 2001 From: jsondevers Date: Thu, 28 Nov 2024 11:49:23 -0500 Subject: [PATCH] Add handling for additional input in jitter rng MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes #25917 Reviewed-by: Saša Nedvědický Reviewed-by: Hugo Landau Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/25966) --- providers/implementations/rands/seed_src_jitter.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/providers/implementations/rands/seed_src_jitter.c b/providers/implementations/rands/seed_src_jitter.c index 1a1919d823008..f6f0ed54a18b1 100644 --- a/providers/implementations/rands/seed_src_jitter.c +++ b/providers/implementations/rands/seed_src_jitter.c @@ -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);