Skip to content

Commit

Permalink
Handle edge case for remaining bytes in nwipe_aes_ctr_prng_read using…
Browse files Browse the repository at this point in the history
… memset.
  • Loading branch information
Knogle committed Apr 10, 2024
1 parent ce2db63 commit adcd442
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/prng.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ int nwipe_aes_ctr_prng_read( NWIPE_PRNG_READ_SIGNATURE )
{
// Temporary buffer for the last block of random data.
unsigned char temp_output[32];
memset( temp_output, 0, sizeof( temp_output ) );

// Generate one more block of random data.
aes_ctr_prng_genrand_uint256_to_buf( (aes_ctr_state_t*) *state, temp_output );
Expand Down

0 comments on commit adcd442

Please sign in to comment.