Skip to content

Commit

Permalink
Add handling for additional input in jitter rng
Browse files Browse the repository at this point in the history
Fixes openssl#25917

Reviewed-by: Saša Nedvědický <[email protected]>
Reviewed-by: Hugo Landau <[email protected]>
Reviewed-by: Tomas Mraz <[email protected]>
(Merged from openssl#25966)
  • Loading branch information
jsondevers authored and t8m committed Dec 3, 2024
1 parent 04812ed commit 4d41cc9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions providers/implementations/rands/seed_src_jitter.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 4d41cc9

Please sign in to comment.