Fix seeding from random device w/o getrandom syscall
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Thu, 14 Feb 2019 23:03:50 +0000 (00:03 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 1 Mar 2019 17:28:11 +0000 (18:28 +0100)
commit38023b87f037f4b832c236dfce2a76272be08763
treee661710e8dfc8b7ff5b1cef8861216737dce6762
parented86f884ba10c93a0beb53492c5db463e31a6884
Fix seeding from random device w/o getrandom syscall

Use select to wait for /dev/random in readable state,
but do not actually read anything from /dev/random,
use /dev/urandom first.

Use linux define __NR_getrandom instead of the
glibc define SYS_getrandom, in case the kernel headers
are more current than the glibc headers.

Fixes #8215

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
(Merged from https://github.com/openssl/openssl/pull/8251)
crypto/rand/rand_unix.c
e_os.h