boringssl/crypto/rand
David Benjamin de24aadc5b Add RAND_set_urandom_fd.
Chromium uses a zygote process and a sandbox on Linux. In order for RAND_bytes
to be functional and guaranteed fork-safe inside the renderers, /dev/urandom
must be prewarmed. Calling RAND_bytes initializes a thread-local ChaCha20 key
when rdrand is available. So that key is fork-safe and to avoid tempting any
dragons by touching pthreads APIs before a non-exec fork, add a
RAND_set_urandom_fd API. It allows the consumer to supply the /dev/urandom fd
and promises to be fork-safe, both in initializing key material and use of
pthreads.

This doesn't affect any current shipping versions of Chrome.

BUG=462040

Change-Id: I1037e21e525918971380e4ea1371703c8237a0b0
Reviewed-on: https://boringssl-review.googlesource.com/5302
Reviewed-by: Adam Langley <agl@google.com>
2015-06-30 21:41:42 +00:00
..
asm Add missing comma in .type pragma for rdrand code. 2015-06-23 15:01:45 -07:00
CMakeLists.txt rand: new-style locking and support rdrand. 2015-04-14 20:13:42 +00:00
hwrand.c Handle RDRAND failures. 2015-06-23 20:56:33 +00:00
internal.h Handle RDRAND failures. 2015-06-23 20:56:33 +00:00
rand.c RAND_set_rand_method takes a const parameter. 2015-06-24 17:02:15 -07:00
urandom.c Add RAND_set_urandom_fd. 2015-06-30 21:41:42 +00:00
windows.c Use the correct case for Windows headers. 2015-06-09 21:38:04 +00:00