openssl/crypto/rand
Dr. Matthias St. Pierre 849529257c drbg: ensure fork-safety without using a pthread_atfork handler
When the new OpenSSL CSPRNG was introduced in version 1.1.1,
it was announced in the release notes that it would be fork-safe,
which the old CSPRNG hadn't been.

The fork-safety was implemented using a fork count, which was
incremented by a pthread_atfork handler. Initially, this handler
was enabled by default. Unfortunately, the default behaviour
had to be changed for other reasons in commit b5319bdbd0, so
the new OpenSSL CSPRNG failed to keep its promise.

This commit restores the fork-safety using a different approach.
It replaces the fork count by a fork id, which coincides with
the process id on UNIX-like operating systems and is zero on other
operating systems. It is used to detect when an automatic reseed
after a fork is necessary.

To prevent a future regression, it also adds a test to verify that
the child reseeds after fork.

CVE-2019-1549

Reviewed-by: Paul Dale <paul.dale@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9832)
2019-09-11 11:22:18 +02:00
..
build.info Make the RAND code available from inside the FIPS module 2019-06-28 10:22:21 +01:00
drbg_ctr.c New function EVP_CIPHER_free() 2019-09-04 10:38:13 +02:00
drbg_hash.c New function EVP_MD_free() 2019-09-04 10:38:13 +02:00
drbg_hmac.c New function EVP_MD_free() 2019-09-04 10:38:13 +02:00
drbg_lib.c drbg: ensure fork-safety without using a pthread_atfork handler 2019-09-11 11:22:18 +02:00
rand_crng_test.c New function EVP_MD_free() 2019-09-04 10:38: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 drbg: ensure fork-safety without using a pthread_atfork handler 2019-09-11 11:22:18 +02:00
rand_lib.c drbg: ensure fork-safety without using a pthread_atfork handler 2019-09-11 11:22:18 +02:00
rand_unix.c Fix a strict warnings error in rand_pool_acquire_entropy 2019-09-10 09:57:20 +01: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 Fix build with VS2008 2019-09-09 16:43:52 +02:00
randfile.c Circumvent a problem of lacking GetEnvironmentVariable() in WindowsCE. 2019-03-29 09:51:24 +00:00