Skip to content

Commit

Permalink
Ensure array length assumption agree
Browse files Browse the repository at this point in the history
  • Loading branch information
torben-hansen committed Oct 13, 2023
1 parent 8772d19 commit fa3e14b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions crypto/fipsmodule/rand/rand.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,12 @@ static int rdrand(uint8_t *buf, size_t len) {
#if defined(BORINGSSL_FIPS)

#if defined(FIPS_ENTROPY_SOURCE_PASSIVE)

// Currently, we assume that the length of externally loaded entropy has the
// same length as the seed used in the ctr-drbg.
OPENSSL_STATIC_ASSERT(CTR_DRBG_ENTROPY_LEN == PASSIVE_ENTROPY_LOAD_LENGTH,
passive_entropy_load_length_different_from_ctr_drbg_seed_length)

void RAND_load_entropy(uint8_t out_entropy[CTR_DRBG_ENTROPY_LEN],
uint8_t entropy[PASSIVE_ENTROPY_LOAD_LENGTH]) {
OPENSSL_memcpy(out_entropy, entropy, CTR_DRBG_ENTROPY_LEN);
Expand Down

0 comments on commit fa3e14b

Please sign in to comment.