diff options
Diffstat (limited to 'src/crypto/random.c')
-rw-r--r-- | src/crypto/random.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/crypto/random.c b/src/crypto/random.c index 3a86a93a46a8b..c278d9cb9de94 100644 --- a/src/crypto/random.c +++ b/src/crypto/random.c @@ -54,7 +54,6 @@ static int random_fd = -1; static unsigned int own_pool_ready = 0; #define RANDOM_ENTROPY_SIZE 20 static char *random_entropy_file = NULL; -static int random_entropy_file_read = 0; #define MIN_COLLECT_ENTROPY 1000 static unsigned int entropy = 0; @@ -66,6 +65,9 @@ static void random_write_entropy(void); static u32 __ROL32(u32 x, u32 y) { + if (y == 0) + return x; + return (x << (y & 31)) | (x >> (32 - (y & 31))); } @@ -354,7 +356,6 @@ static void random_read_entropy(void) own_pool_ready = (u8) buf[0]; random_add_randomness(buf + 1, RANDOM_ENTROPY_SIZE); - random_entropy_file_read = 1; os_free(buf); wpa_printf(MSG_DEBUG, "random: Added entropy from %s " "(own_pool_ready=%u)", |