Skip to content

Commit

Permalink
Rename to RAND_assert_entropy_cpu_jitter
Browse files Browse the repository at this point in the history
  • Loading branch information
justsmth committed Dec 31, 2024
1 parent 82a6e9a commit 7e45b2b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions crypto/crypto_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
8 changes: 4 additions & 4 deletions crypto/fipsmodule/rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions include/openssl/rand.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7e45b2b

Please sign in to comment.