Merge remote-tracking branch 'origin/patches-2.0'

This commit is contained in:
Nick Mathewson 2013-08-13 11:14:11 -04:00
commit c149a1a5e7
2 changed files with 6 additions and 3 deletions

View File

@ -327,8 +327,9 @@ arc4_seed_urandom(void)
return arc4_seed_urandom_helper_(arc4random_urandom_filename); return arc4_seed_urandom_helper_(arc4random_urandom_filename);
for (i = 0; filenames[i]; ++i) { 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 0;
}
} }
return -1; return -1;
@ -351,7 +352,8 @@ arc4_seed(void)
ok = 1; ok = 1;
#endif #endif
#ifdef TRY_SEED_PROC_SYS_KERNEL_RANDOM_UUID #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; ok = 1;
#endif #endif
#ifdef TRY_SEED_SYSCTL_LINUX #ifdef TRY_SEED_SYSCTL_LINUX

View File

@ -708,7 +708,8 @@ int evutil_secure_rng_init(void);
* Set a filename to use in place of /dev/urandom for seeding the secure * Set a filename to use in place of /dev/urandom for seeding the secure
* PRNG. Return 0 on success, -1 on failure. * 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 * (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 * user of the secure RNG might be running. Don't pass anything other than a