• Paul Eggert's avatar
    Use getrandom syscall for nonces · 5ce5cf64
    Paul Eggert authored
    * 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.
    5ce5cf64
fns.c 162 KB