openssl/crypto/rand
Pauli 3a5777501a Start up DEVRANDOM entropy improvement for older Linux devices.
Improve handling of low entropy at start up from /dev/urandom by waiting for
a read(2) call on /dev/random to succeed.  Once one such call has succeeded,
a shared memory segment is created and persisted as an indicator to other
processes that /dev/urandom is properly seeded.

This does not fully prevent against attacks weakening the entropy source.
An attacker who has control of the machine early in its boot sequence
could create the shared memory segment preventing detection of low entropy
conditions.  However, this is no worse than the current situation.

An attacker would also be capable of removing the shared memory segment
and causing seeding to reoccur resulting in a denial of service attack.
This is partially mitigated by keeping the shared memory alive for the
duration of the process's existence.  Thus, an attacker would not only need
to have called call shmctl(2) with the IPC_RMID command but the system
must subsequently enter a state where no instances of libcrypto exist in
any process.  Even one long running process will prevent this attack.

The System V shared memory calls used here go back at least as far as
Linux kernel 2.0.  Linux kernels 4.8 and later, don't have a reliable way
to detect that /dev/urandom has been properly seeded, so a failure is raised
for this case (i.e. the getentropy(2) call has already failed).

Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/9595)
2019-08-20 16:10:49 +10:00
..
build.info Make the RAND code available from inside the FIPS module 2019-06-28 10:22:21 +01:00
drbg_ctr.c Make the RAND code available from inside the FIPS module 2019-06-28 10:22:21 +01:00
drbg_hash.c Change the DRBG HASH implementation to lookup all allowed algorithm names 2019-06-28 10:22:21 +01:00
drbg_hmac.c Change the DRBG HMAC implementation to lookup allowed digest names 2019-06-28 10:22:21 +01:00
drbg_lib.c Allocate DRBG additional data pool from non-secure memory 2019-07-22 13:37:13 +02:00
rand_crng_test.c Allocate DRBG additional data pool from non-secure memory 2019-07-22 13:37:13 +02:00
rand_egd.c Remove NextStep support 2019-07-01 13:32:46 -04:00
rand_err.c Regenerate mkerr files 2019-07-16 05:26:28 +02:00
rand_lcl.h Add missing EBCDIC strings 2019-08-14 10:41:41 +01:00
rand_lib.c Make rand_pool buffers more dynamic in their sizing. 2019-07-23 18:07:19 +10:00
rand_unix.c Start up DEVRANDOM entropy improvement for older Linux devices. 2019-08-20 16:10:49 +10:00
rand_vms.c Clear seed source structures. 2019-03-29 20:11:41 +10:00
rand_vxworks.c Use vxRandLib for VxWorks7 2019-05-02 23:32:44 +02:00
rand_win.c Make the RAND code available from inside the FIPS module 2019-06-28 10:22:21 +01:00
randfile.c Circumvent a problem of lacking GetEnvironmentVariable() in WindowsCE. 2019-03-29 09:51:24 +00:00