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 /include/event2/util.h | |
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 'include/event2/util.h')
-rw-r--r-- | include/event2/util.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/event2/util.h b/include/event2/util.h index 52d58ddc..18cbd806 100644 --- a/include/event2/util.h +++ b/include/event2/util.h @@ -675,6 +675,20 @@ void evutil_secure_rng_get_bytes(void *buf, size_t n); */ 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 . + * + * (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 + * real /dev/...random device file here, or you might lose security.) + * + * This API is unstable, and might change in a future libevent version. + */ +int evutil_secure_rng_set_urandom_device_file(char *fname); + /** Seed the random number generator with extra random bytes. You should almost never need to call this function; it should be |