diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-08-06 17:06:23 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-08-06 17:06:23 -0400 |
commit | 2bbb5d7612d3f9f12acb02e15127e676ff35d669 (patch) | |
tree | 4f36e7314b8512591c528fb04670745a3d67eb2b /evutil_rand.c | |
parent | b8f59807ceb66ad0408182fd0b70a971137ad4ae (diff) | |
download | libevent-2bbb5d7612d3f9f12acb02e15127e676ff35d669.tar.gz |
Add evutil_secure_rng_set_urandom_device_file
This experimental function is needed for some seccomp2 hackery to
work, and should have no effect for systems that don't use it.
Diffstat (limited to 'evutil_rand.c')
-rw-r--r-- | evutil_rand.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/evutil_rand.c b/evutil_rand.c index 284e230e..3c2c81de 100644 --- a/evutil_rand.c +++ b/evutil_rand.c @@ -43,6 +43,12 @@ #include <stdlib.h> #include <string.h> int +evutil_secure_rng_set_urandom_device_file(char *fname) +{ + (void) fname; + return -1; +} +int evutil_secure_rng_init(void) { /* call arc4random() now to force it to self-initialize */ @@ -124,6 +130,17 @@ evutil_secure_rng_global_setup_locks_(const int enable_locks) #endif int +evutil_secure_rng_set_urandom_device_file(char *fname) +{ +#ifdef TRY_SEED_URANDOM + _ARC4_LOCK(); + arc4random_urandom_filename = fname; + _ARC4_UNLOCK(); +#endif + return 0; +} + +int evutil_secure_rng_init(void) { int val; |