summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arc4random.c6
-rw-r--r--include/event2/util.h3
2 files changed, 6 insertions, 3 deletions
diff --git a/arc4random.c b/arc4random.c
index 016cae66..02c892f9 100644
--- a/arc4random.c
+++ b/arc4random.c
@@ -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;
@@ -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
diff --git a/include/event2/util.h b/include/event2/util.h
index 2a24566c..8ffc4a2e 100644
--- a/include/event2/util.h
+++ b/include/event2/util.h
@@ -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