Make sure that not all RNG state variables are initialized to a zero value.
This commit is contained in:
parent
d8f446832b
commit
7a40d62b06
@ -199,13 +199,17 @@ static uint32_t random_next(rand_state_t *const state)
|
|||||||
return (state->d += 0x000587C5) + state->v;
|
return (state->d += 0x000587C5) + state->v;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void random_seed(rand_state_t* const state, const uint64_t salt, const uint16_t pepper, const uint8_t *const passwd, const size_t passwd_len)
|
static void random_seed(rand_state_t *const state, uint64_t salt, const uint16_t pepper, const uint8_t *const passwd, const size_t passwd_len)
|
||||||
{
|
{
|
||||||
key_data_t key;
|
|
||||||
size_t i;
|
size_t i;
|
||||||
generate_key(&key, salt, pepper, passwd, passwd_len);
|
key_data_t key;
|
||||||
|
do
|
||||||
|
{
|
||||||
|
generate_key(&key, salt++, pepper, passwd, passwd_len);
|
||||||
random_init(state, &key);
|
random_init(state, &key);
|
||||||
slunkcrypt_bzero(&key, sizeof(key_data_t));
|
slunkcrypt_bzero(&key, sizeof(key_data_t));
|
||||||
|
}
|
||||||
|
while (!(state->x || state->y || state->z || state->w || state->v));
|
||||||
for (i = 0U; i < 97U; ++i)
|
for (i = 0U; i < 97U; ++i)
|
||||||
{
|
{
|
||||||
UNUSED volatile uint32_t q = random_next(state);
|
UNUSED volatile uint32_t q = random_next(state);
|
||||||
|
Loading…
Reference in New Issue
Block a user