Logan oos Even
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
src/random_numbers.c
|
@ -98,9 +98,9 @@ uint64_t n2n_seed (void) { |
|
|
|
|
|
|
|
|
uint64_t seed = 0; /* this could even go uninitialized */ |
|
|
uint64_t seed = 0; /* this could even go uninitialized */ |
|
|
uint64_t ret = 0; /* this could even go uninitialized */ |
|
|
uint64_t ret = 0; /* this could even go uninitialized */ |
|
|
|
|
|
size_t i = 0; |
|
|
|
|
|
|
|
|
#ifdef SYS_getrandom |
|
|
#ifdef SYS_getrandom |
|
|
size_t i; |
|
|
|
|
|
int rc = -1; |
|
|
int rc = -1; |
|
|
for(i = 0; (i < RND_RETRIES) && (rc != sizeof(seed)); i++) { |
|
|
for(i = 0; (i < RND_RETRIES) && (rc != sizeof(seed)); i++) { |
|
|
rc = syscall (SYS_getrandom, &seed, sizeof(seed), GRND_NONBLOCK); |
|
|
rc = syscall (SYS_getrandom, &seed, sizeof(seed), GRND_NONBLOCK); |
|
|