openssl/crypto/include/internal
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
..
__DECC_INCLUDE_EPILOGUE.H Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
__DECC_INCLUDE_PROLOGUE.H Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
aria.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
asn1_dsa.h Convert asn1_dsa.c to use the WPACKET API instead 2019-07-12 06:26:46 +10:00
asn1_int.h Add evp_keymgmt_export_to_provider(), for key transfer between providers 2019-07-22 06:18:58 +02:00
async.h Convert thread stop handling into a publish/subscribe model 2019-06-17 15:32:54 +01:00
bn_conf.h.in Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
bn_dh.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
bn_int.h Make the EC code available from inside the FIPS provider 2019-08-06 11:19:07 +01:00
bn_srp.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
chacha.h Remove tab characters from C source files. 2019-07-16 20:24:10 +10:00
ciphermode_platform.h Remove extern declarations of OPENSSL_ia32cap_P 2019-09-01 15:41:58 +02:00
cms_int.h CAdES : lowercase name for now internal methods. 2019-07-31 19:14:12 +10:00
cryptlib_int.h prevent endless recursion when trace API is used within OPENSSL_init_crypto() 2019-08-20 11:16:41 +08:00
ctype.h Add missing EBCDIC strings 2019-08-14 10:41:41 +01:00
dso_conf.h.in Rework DSO API conditions and configuration option 2019-04-01 06:14:50 +02:00
ec_int.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
engine.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
err_int.h Convert thread stop handling into a publish/subscribe model 2019-06-17 15:32:54 +01:00
ess_int.h CAdES : lowercase name for now internal methods. 2019-07-31 19:14:12 +10:00
evp_int.h Move EVP_PKEY algorithm implementations into a union 2019-09-09 14:00:00 +01:00
lhash.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
md32_common.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
modes_int.h Adapt diverse code to provider based MACs. 2019-08-15 22:12:25 +02:00
objects.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
poly1305.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
rand_int.h drbg: ensure fork-safety without using a pthread_atfork handler 2019-09-11 11:22:18 +02:00
sha.h Move digests to providers 2019-06-04 12:09:50 +10:00
siphash.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
siv_int.h Add Common shared code needed to move aes ciphers to providers 2019-07-16 09:46:14 +10:00
sm2.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
sm2err.h Regenerate mkerr files 2019-07-16 05:26:28 +02:00
sm4.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
sparse_array.h Add sparse array of const pointer type 2019-06-01 17:55:33 +10:00
store_int.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
store.h Following the license change, modify the boilerplates in include/ and crypto/include/ 2018-12-06 15:57:31 +01:00
x509_int.h Rename X509_STORE ptr stored in opaque struct X509_STORE_CTX 2019-07-31 20:56:34 +10:00