aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorEli Zaretskii2016-01-15 11:47:55 +0200
committerEli Zaretskii2016-01-15 11:47:55 +0200
commit3ffe81e245d854a694ae1734f1b6a995bdc5e724 (patch)
tree2d8fccecc5b404f8fb71e15fe0ea6477a09a1857 /doc
parentfee0526a189f43e8470d78e8374bd425890fbe6f (diff)
downloademacs-3ffe81e245d854a694ae1734f1b6a995bdc5e724.tar.gz
emacs-3ffe81e245d854a694ae1734f1b6a995bdc5e724.zip
Make 'random' seeds cryptographically secure if possible
* configure.ac: Check for "/dev/urandom". * src/sysdep.c (init_random) [HAVE_DEV_URANDOM]: Read the stream for the seed from "/dev/urandom". [WINDOWSNT]: Obtain the stream for the seed from w32 APIs. * src/fns.c (Frandom): Update the doc string to indicate that system entropy is used when available. * src/w32.c: Include wincrypt.h. (w32_init_crypt_random, w32_init_random): New functions, use the CryptGenRandom API. (globals_of_w32): Initialize w32_crypto_hprov handle to zero. * src/w32.h (w32_init_random): Add prototype. * doc/lispref/numbers.texi (Random Numbers): Document more details about 't' as the argument to 'random'. * etc/NEWS: Mention that '(random t)' now uses a cryptographically strong seed if possible. (Bug#22202)
Diffstat (limited to 'doc')
-rw-r--r--doc/lispref/numbers.texi4
1 files changed, 3 insertions, 1 deletions
diff --git a/doc/lispref/numbers.texi b/doc/lispref/numbers.texi
index 20d3c4290f3..3a9483af967 100644
--- a/doc/lispref/numbers.texi
+++ b/doc/lispref/numbers.texi
@@ -1252,7 +1252,9 @@ any integer representable in Lisp, i.e., an integer between
1252(@pxref{Integer Basics}). 1252(@pxref{Integer Basics}).
1253 1253
1254If @var{limit} is @code{t}, it means to choose a new seed as if Emacs 1254If @var{limit} is @code{t}, it means to choose a new seed as if Emacs
1255were restarting. 1255were restarting. The new seed will be set from the system entropy, if
1256that is available, or from the current time and Emacs process's PID
1257(@pxref{System Environment, emacs-pid}) if not.
1256 1258
1257If @var{limit} is a string, it means to choose a new seed based on the 1259If @var{limit} is a string, it means to choose a new seed based on the
1258string's contents. 1260string's contents.