Skip to content

Commit

Permalink
Lower-case internal function names and correct env variable (#2243)
Browse files Browse the repository at this point in the history
Use lower-case for internal function names and set env variables to the env variable field.
  • Loading branch information
torben-hansen authored Mar 5, 2025
1 parent 28f46b8 commit 1b0a250
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions crypto/fipsmodule/rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ static void rand_state_initialize(struct rand_thread_local_state *state) {
// |RAND_USE_USER_PRED_RESISTANCE| or |RAND_NO_USER_PRED_RESISTANCE|. The former
// cause the content of |user_pred_resistance| to be mixed in as prediction
// resistance. The latter ensures that |user_pred_resistance| is not used.
static void RAND_bytes_core(
static void rand_bytes_core(
struct rand_thread_local_state *state,
uint8_t *out, size_t out_len,
const uint8_t user_pred_resistance[RAND_PRED_RESISTANCE_LEN],
Expand Down Expand Up @@ -464,7 +464,7 @@ static void RAND_bytes_core(
CRYPTO_MUTEX_unlock_read(&state->state_clear_lock);
}

static void RAND_bytes_private(uint8_t *out, size_t out_len,
static void rand_bytes_private(uint8_t *out, size_t out_len,
const uint8_t user_pred_resistance[RAND_PRED_RESISTANCE_LEN],
int use_user_pred_resistance) {

Expand All @@ -491,7 +491,7 @@ static void RAND_bytes_private(uint8_t *out, size_t out_len,
thread_local_list_add_node(state);
}

RAND_bytes_core(state, out, out_len, user_pred_resistance,
rand_bytes_core(state, out, out_len, user_pred_resistance,
use_user_pred_resistance);

FIPS_service_indicator_unlock_state();
Expand All @@ -501,15 +501,15 @@ static void RAND_bytes_private(uint8_t *out, size_t out_len,
int RAND_bytes_with_user_prediction_resistance(uint8_t *out, size_t out_len,
const uint8_t user_pred_resistance[RAND_PRED_RESISTANCE_LEN]) {

RAND_bytes_private(out, out_len, user_pred_resistance,
rand_bytes_private(out, out_len, user_pred_resistance,
RAND_USE_USER_PRED_RESISTANCE);
return 1;
}

int RAND_bytes(uint8_t *out, size_t out_len) {

static const uint8_t kZeroPredResistance[RAND_PRED_RESISTANCE_LEN] = {0};
RAND_bytes_private(out, out_len, kZeroPredResistance,
rand_bytes_private(out, out_len, kZeroPredResistance,
RAND_NO_USER_PRED_RESISTANCE);
return 1;
}
Expand Down
3 changes: 2 additions & 1 deletion util/all_tests.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
},
{
"comment": "Run RAND test suite without fork detection",
"cmd": ["crypto/crypto_test", "BORINGSSL_IGNORE_FORK_DETECTION=1", "--gtest_filter=RandTest.*:-RandTest.Fork"],
"cmd": ["crypto/crypto_test", "--gtest_filter=RandTest.*:-RandTest.Fork"],
"env": ["BORINGSSL_IGNORE_FORK_DETECTION=1"],
"skip_valgrind": true
},
{
Expand Down

0 comments on commit 1b0a250

Please sign in to comment.