diff options
| author | Paul Eggert | 2020-06-27 13:02:24 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-06-27 13:03:49 -0700 |
| commit | 5ce5cf643840cd6efd25d987bc5b6f12478c50a6 (patch) | |
| tree | 48a0f14e8162ee889475f54a21227356885cd330 /doc | |
| parent | 118c07e02e939c9f52688091509d4bff2a897032 (diff) | |
| download | emacs-5ce5cf643840cd6efd25d987bc5b6f12478c50a6.tar.gz emacs-5ce5cf643840cd6efd25d987bc5b6f12478c50a6.zip | |
Use getrandom syscall for nonces
* admin/merge-gnulib (GNULIB_MODULES): Add getrandom.
* doc/lispref/text.texi (Format of GnuTLS Cryptography Inputs):
Don’t say that iv-auto uses GNUTLS_RND_NONCE. Also, don’t say
that it returns the IV’s actual value, as it never has done that.
* src/fns.c, src/sysdep.c: Include sys/random.h, for getrandom.
* src/fns.c (Fsecure_hash_algorithms): Use getrandom so that this
function does not depend on HAVE_GNUTLS3.
* src/sysdep.c: Do not include <gnutls/crypto.h>.
(random_seed) [HAVE_LRAND48]: Can be long int now.
(init_random) [!WINDOWSNT]: Use getrandom syscall instead
of opening /dev/urandom, as this works even on GNU/Linux
hosts that lack /dev/urandom. Don’t bother with gnutls_rnd
as it’s not needed now that we have getrandom.
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/lispref/text.texi | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi index 10e8246a5fa..0c3813ff1d0 100644 --- a/doc/lispref/text.texi +++ b/doc/lispref/text.texi | |||
| @@ -4813,11 +4813,9 @@ When @var{noerror} is non-@code{nil}, this function silently uses | |||
| 4813 | @code{raw-text} coding instead. | 4813 | @code{raw-text} coding instead. |
| 4814 | 4814 | ||
| 4815 | @item (@code{iv-auto} @var{length}) | 4815 | @item (@code{iv-auto} @var{length}) |
| 4816 | This will generate an IV (Initialization Vector) of the specified | 4816 | This generates a random IV (Initialization Vector) of the specified |
| 4817 | length using the GnuTLS @code{GNUTLS_RND_NONCE} generator and pass it | 4817 | length and passes it to the function. This ensures that the IV is |
| 4818 | to the function. This ensures that the IV is unpredictable and | 4818 | unpredictable and unlikely to be reused in the same session. |
| 4819 | unlikely to be reused in the same session. The actual value of the IV | ||
| 4820 | is returned by the function as described below. | ||
| 4821 | 4819 | ||
| 4822 | @end table | 4820 | @end table |
| 4823 | 4821 | ||