From 6b8d7f8f74136932e52222c57b637f532a306076 Mon Sep 17 00:00:00 2001 From: Justin Smith Date: Tue, 31 Dec 2024 11:10:23 -0500 Subject: [PATCH] Rename to RAND_assert_entropy_cpu_jitter --- crypto/crypto_test.cc | 4 ++-- crypto/fipsmodule/rand/rand.c | 8 ++++---- include/openssl/rand.h | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/crypto/crypto_test.cc b/crypto/crypto_test.cc index 63d34d3626..ca020ef778 100644 --- a/crypto/crypto_test.cc +++ b/crypto/crypto_test.cc @@ -76,9 +76,9 @@ TEST(CryptoTest, Strndup) { TEST(CryptoTest, aws_lc_assert_entropy_cpu_jitter) { #if defined(FIPS_ENTROPY_SOURCE_JITTER_CPU) - ASSERT_EQ(1, aws_lc_assert_entropy_cpu_jitter()); + ASSERT_EQ(1, RAND_assert_entropy_cpu_jitter()); #else - ASSERT_DEATH_IF_SUPPORTED( { aws_lc_assert_entropy_cpu_jitter(); } , ""); + ASSERT_DEATH_IF_SUPPORTED( { RAND_assert_entropy_cpu_jitter(); } , ""); #endif } diff --git a/crypto/fipsmodule/rand/rand.c b/crypto/fipsmodule/rand/rand.c index 8bae955e28..0a1e55957c 100644 --- a/crypto/fipsmodule/rand/rand.c +++ b/crypto/fipsmodule/rand/rand.c @@ -74,13 +74,13 @@ #if defined(FIPS_ENTROPY_SOURCE_JITTER_CPU) static const unsigned kReseedInterval = 16777216; -int aws_lc_assert_entropy_cpu_jitter(void) { +int RAND_assert_entropy_cpu_jitter(void) { return 1; } #elif defined(FIPS_ENTROPY_SOURCE_PASSIVE) static const unsigned kReseedInterval = 4096; -int aws_lc_assert_entropy_cpu_jitter(void) { - abort(); +int RAND_assert_entropy_cpu_jitter(void) { + BORINGSSL_FIPS_abort(); } #else #error "A FIPS entropy source must be explicitly defined" @@ -92,7 +92,7 @@ int aws_lc_assert_entropy_cpu_jitter(void) { #error "A FIPS entropy source must not be defined for non-FIPS build" #endif static const unsigned kReseedInterval = 4096; -int aws_lc_assert_entropy_cpu_jitter(void) { +int RAND_assert_entropy_cpu_jitter(void) { abort(); } #endif // defined(BORINGSSL_FIPS) diff --git a/include/openssl/rand.h b/include/openssl/rand.h index d0c6de05bc..3d7073e701 100644 --- a/include/openssl/rand.h +++ b/include/openssl/rand.h @@ -140,9 +140,9 @@ OPENSSL_EXPORT const RAND_METHOD *RAND_get_rand_method(void); // RAND_set_rand_method returns one. OPENSSL_EXPORT int RAND_set_rand_method(const RAND_METHOD *); -// aws_lc_assert_entropy_cpu_jitter will abort the process if CPU jitter entropy +// RAND_assert_entropy_cpu_jitter will abort the process if CPU jitter entropy // was not enabled for the build. -OPENSSL_EXPORT int aws_lc_assert_entropy_cpu_jitter(void); +OPENSSL_EXPORT int RAND_assert_entropy_cpu_jitter(void); // RAND_keep_random_devices_open does nothing. OPENSSL_EXPORT OPENSSL_DEPRECATED void RAND_keep_random_devices_open(int a);