diff --git a/crypto/fipsmodule/rand/entropy/entropy_sources.c b/crypto/fipsmodule/rand/entropy/entropy_sources.c index 651adcfac5..a97bd6b581 100644 --- a/crypto/fipsmodule/rand/entropy/entropy_sources.c +++ b/crypto/fipsmodule/rand/entropy/entropy_sources.c @@ -20,6 +20,13 @@ static int entropy_get_prediction_resistance( return 1; } +static int entropy_get_personalization_string( + const struct entropy_source_t *entropy_source, + uint8_t personalization_string[CTR_DRBG_ENTROPY_LEN]) { + CRYPTO_sysrand(personalization_string, CTR_DRBG_ENTROPY_LEN); + return 1; +} + // - Tree DRBG with Jitter Entropy as root for seeding. // - OS as personalization string source. // - If run-time is on an Intel CPU and it supports rdrand, use it as a source @@ -29,7 +36,7 @@ DEFINE_LOCAL_DATA(struct entropy_source_methods, tree_jitter_entropy_source_meth out->zeroize_thread = tree_jitter_zeroize_thread_drbg; out->free_thread = tree_jitter_free_thread_drbg; out->get_seed = tree_jitter_get_seed; - out->get_personalization_string = NULL; + out->get_personalization_string = entropy_get_personalization_string; if (have_fast_rdrand() == 1) { out->get_prediction_resistance = entropy_get_prediction_resistance; } else {