From 2bbb5d7612d3f9f12acb02e15127e676ff35d669 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 6 Aug 2013 17:06:23 -0400 Subject: 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. --- evutil_rand.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'evutil_rand.c') 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 #include 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 */ @@ -123,6 +129,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) { -- cgit v1.2.1