Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/patches-2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Aug 13, 2013
2 parents 6171e1c + bb52471 commit c149a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,9 @@ arc4_seed_urandom(void)
return arc4_seed_urandom_helper_(arc4random_urandom_filename);

for (i = 0; filenames[i]; ++i) {
if (arc4_seed_urandom_helper_(filenames[i]) == 0)
if (arc4_seed_urandom_helper_(filenames[i]) == 0) {
return 0;
}
}

return -1;
Expand All @@ -351,7 +352,8 @@ arc4_seed(void)
ok = 1;
#endif
#ifdef TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID
if (0 == arc4_seed_proc_sys_kernel_random_uuid())
if (arc4random_urandom_filename == NULL &&
0 == arc4_seed_proc_sys_kernel_random_uuid())
ok = 1;
#endif
#ifdef TRY_SEED_SYSCTL_LINUX
Expand Down
3 changes: 2 additions & 1 deletion include/event2/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,8 @@ int evutil_secure_rng_init(void);
* Set a filename to use in place of /dev/urandom for seeding the secure
* PRNG. Return 0 on success, -1 on failure.
*
* Call this function BEFORE calling any other initialization or .
* Call this function BEFORE calling any other initialization or RNG
* functions.
*
* (This string will _NOT_ be copied internally. Do not free it while any
* user of the secure RNG might be running. Don't pass anything other than a
Expand Down

0 comments on commit c149a1a

Please sign in to comment.