From ee79a9303ff7fc82dc15c9042417553a61095a77 Mon Sep 17 00:00:00 2001 From: Bob Beck Date: Fri, 31 May 2024 21:37:00 +0000 Subject: [PATCH] Move fork detection support out of bcm This moves fork detection itself back into libcrypto. BCM itself retains only the API to access the generation number to know if stiring in more entropy is needed because a fork happened. Bug: 723 Change-Id: I9b38440e7243119de97f9c4653f0e91d71107501 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/68967 Reviewed-by: David Benjamin Commit-Queue: David Benjamin --- build.json | 6 +- crypto/bcm_support.h | 40 +++++++++++ crypto/crypto.c | 1 - crypto/fipsmodule/bcm.c | 1 - crypto/fipsmodule/rand/fork_detect.h | 68 ------------------- crypto/fipsmodule/rsa/rsa_impl.c | 2 +- .../rand => rand_extra}/fork_detect.c | 54 +++++++-------- .../rand => rand_extra}/fork_detect_test.cc | 2 +- crypto/rand_extra/rand_test.cc | 2 +- gen/sources.bzl | 6 +- gen/sources.cmake | 6 +- gen/sources.gni | 6 +- gen/sources.json | 6 +- 13 files changed, 84 insertions(+), 116 deletions(-) delete mode 100644 crypto/fipsmodule/rand/fork_detect.h rename crypto/{fipsmodule/rand => rand_extra}/fork_detect.c (81%) rename crypto/{fipsmodule/rand => rand_extra}/fork_detect_test.cc (99%) diff --git a/build.json b/build.json index 6f6271af2..c1dc1ae08 100644 --- a/build.json +++ b/build.json @@ -78,7 +78,6 @@ "crypto/fipsmodule/modes/ofb.c", "crypto/fipsmodule/modes/polyval.c", "crypto/fipsmodule/rand/ctrdrbg.c", - "crypto/fipsmodule/rand/fork_detect.c", "crypto/fipsmodule/rand/rand.c", "crypto/fipsmodule/rsa/blinding.c", "crypto/fipsmodule/rsa/padding.c", @@ -291,6 +290,7 @@ "crypto/poly1305/poly1305_vec.c", "crypto/pool/pool.c", "crypto/rand_extra/deterministic.c", + "crypto/rand_extra/fork_detect.c", "crypto/rand_extra/forkunsafe.c", "crypto/rand_extra/getentropy.c", "crypto/rand_extra/ios.c", @@ -512,7 +512,6 @@ "crypto/fipsmodule/ecdsa/internal.h", "crypto/fipsmodule/md5/internal.h", "crypto/fipsmodule/modes/internal.h", - "crypto/fipsmodule/rand/fork_detect.h", "crypto/fipsmodule/rand/internal.h", "crypto/fipsmodule/rsa/internal.h", "crypto/fipsmodule/service_indicator/internal.h", @@ -831,7 +830,6 @@ "crypto/fipsmodule/md5/md5_test.cc", "crypto/fipsmodule/modes/gcm_test.cc", "crypto/fipsmodule/rand/ctrdrbg_test.cc", - "crypto/fipsmodule/rand/fork_detect_test.cc", "crypto/fipsmodule/service_indicator/service_indicator_test.cc", "crypto/fipsmodule/sha/sha_test.cc", "crypto/hmac_extra/hmac_test.cc", @@ -850,8 +848,10 @@ "crypto/pkcs8/pkcs8_test.cc", "crypto/poly1305/poly1305_test.cc", "crypto/pool/pool_test.cc", + "crypto/rand_extra/fork_detect_test.cc", "crypto/rand_extra/getentropy_test.cc", "crypto/rand_extra/rand_test.cc", + "crypto/rand_extra/rand_test.cc", "crypto/refcount_test.cc", "crypto/rsa_extra/rsa_test.cc", "crypto/self_test.cc", diff --git a/crypto/bcm_support.h b/crypto/bcm_support.h index a6f005baf..c91bcb028 100644 --- a/crypto/bcm_support.h +++ b/crypto/bcm_support.h @@ -23,6 +23,24 @@ extern "C" { #endif +#if defined(OPENSSL_LINUX) +// On linux we use MADVISE instead of pthread_atfork(), due +// to concerns about clone() being used for address space +// duplication. +#define OPENSSL_FORK_DETECTION +#define OPENSSL_FORK_DETECTION_MADVISE +#elif defined(OPENSSL_MACOS) || defined(OPENSSL_IOS) || \ + defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD) +// These platforms may detect address space duplication with pthread_atfork. +// iOS doesn't normally allow fork in apps, but it's there. +#define OPENSSL_FORK_DETECTION +#define OPENSSL_FORK_DETECTION_PTHREAD_ATFORK +#elif defined(OPENSSL_WINDOWS) || defined(OPENSSL_TRUSTY) || \ + defined(__ZEPHYR__) || defined(CROS_EC) +// These platforms do not fork. +#define OPENSSL_DOES_NOT_FORK +#endif + #if defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) #define OPENSSL_RAND_DETERMINISTIC #elif defined(OPENSSL_TRUSTY) @@ -66,6 +84,28 @@ void CRYPTO_sysrand_for_seed(uint8_t *buf, size_t len); // has run out of entropy. void RAND_need_entropy(size_t bytes_needed); +// crypto_get_fork_generation returns the fork generation number for the current +// process, or zero if not supported on the platform. The fork generation number +// is a non-zero, strictly-monotonic counter with the property that, if queried +// in an address space and then again in a subsequently forked copy, the forked +// address space will observe a greater value. +// +// This function may be used to clear cached values across a fork. When +// initializing a cache, record the fork generation. Before using the cache, +// check if the fork generation has changed. If so, drop the cache and update +// the save fork generation. Note this logic transparently handles platforms +// which always return zero. +// +// This is not reliably supported on all platforms which implement |fork|, so it +// should only be used as a hardening measure. +OPENSSL_EXPORT uint64_t CRYPTO_get_fork_generation(void); + +// CRYPTO_fork_detect_force_madv_wipeonfork_for_testing is an internal detail +// used for testing purposes. +OPENSSL_EXPORT void CRYPTO_fork_detect_force_madv_wipeonfork_for_testing( + int on); + + #if defined(__cplusplus) } // extern C #endif diff --git a/crypto/crypto.c b/crypto/crypto.c index ddf4038a8..155e7b4ae 100644 --- a/crypto/crypto.c +++ b/crypto/crypto.c @@ -16,7 +16,6 @@ #include -#include "fipsmodule/rand/fork_detect.h" #include "fipsmodule/rand/internal.h" #include "bcm_support.h" #include "internal.h" diff --git a/crypto/fipsmodule/bcm.c b/crypto/fipsmodule/bcm.c index d9cc6c360..4ec382bf3 100644 --- a/crypto/fipsmodule/bcm.c +++ b/crypto/fipsmodule/bcm.c @@ -93,7 +93,6 @@ #include "modes/ofb.c" #include "modes/polyval.c" #include "rand/ctrdrbg.c" -#include "rand/fork_detect.c" #include "rand/rand.c" #include "rsa/blinding.c" #include "rsa/padding.c" diff --git a/crypto/fipsmodule/rand/fork_detect.h b/crypto/fipsmodule/rand/fork_detect.h deleted file mode 100644 index 0fb275cf8..000000000 --- a/crypto/fipsmodule/rand/fork_detect.h +++ /dev/null @@ -1,68 +0,0 @@ -/* Copyright (c) 2020, Google Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY - * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION - * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN - * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ - -#ifndef OPENSSL_HEADER_CRYPTO_FORK_DETECT_H -#define OPENSSL_HEADER_CRYPTO_FORK_DETECT_H - -#include - -#if defined(OPENSSL_LINUX) -// On linux we use MADVISE instead of pthread_atfork(), due -// to concerns about clone() being used for address space -// duplication. -#define OPENSSL_FORK_DETECTION -#define OPENSSL_FORK_DETECTION_MADVISE -#elif defined(OPENSSL_MACOS) || defined(OPENSSL_IOS) || \ - defined(OPENSSL_OPENBSD) || defined(OPENSSL_FREEBSD) -// These platforms may detect address space duplication with pthread_atfork. -// iOS doesn't normally allow fork in apps, but it's there. -#define OPENSSL_FORK_DETECTION -#define OPENSSL_FORK_DETECTION_PTHREAD_ATFORK -#elif defined(OPENSSL_WINDOWS) || defined(OPENSSL_TRUSTY) || \ - defined(__ZEPHYR__) || defined(CROS_EC) -// These platforms do not fork. -#define OPENSSL_DOES_NOT_FORK -#endif - -#if defined(__cplusplus) -extern "C" { -#endif - - -// crypto_get_fork_generation returns the fork generation number for the current -// process, or zero if not supported on the platform. The fork generation number -// is a non-zero, strictly-monotonic counter with the property that, if queried -// in an address space and then again in a subsequently forked copy, the forked -// address space will observe a greater value. -// -// This function may be used to clear cached values across a fork. When -// initializing a cache, record the fork generation. Before using the cache, -// check if the fork generation has changed. If so, drop the cache and update -// the save fork generation. Note this logic transparently handles platforms -// which always return zero. -// -// This is not reliably supported on all platforms which implement |fork|, so it -// should only be used as a hardening measure. -OPENSSL_EXPORT uint64_t CRYPTO_get_fork_generation(void); - -// CRYPTO_fork_detect_force_madv_wipeonfork_for_testing is an internal detail -// used for testing purposes. -OPENSSL_EXPORT void CRYPTO_fork_detect_force_madv_wipeonfork_for_testing( - int on); - -#if defined(__cplusplus) -} // extern C -#endif - -#endif // OPENSSL_HEADER_CRYPTO_FORK_DETECT_H diff --git a/crypto/fipsmodule/rsa/rsa_impl.c b/crypto/fipsmodule/rsa/rsa_impl.c index b8fbbdcfe..2f1d76ba4 100644 --- a/crypto/fipsmodule/rsa/rsa_impl.c +++ b/crypto/fipsmodule/rsa/rsa_impl.c @@ -65,10 +65,10 @@ #include #include +#include "../../bcm_support.h" #include "../../internal.h" #include "../bn/internal.h" #include "../delocate.h" -#include "../rand/fork_detect.h" #include "../service_indicator/internal.h" #include "internal.h" diff --git a/crypto/fipsmodule/rand/fork_detect.c b/crypto/rand_extra/fork_detect.c similarity index 81% rename from crypto/fipsmodule/rand/fork_detect.c rename to crypto/rand_extra/fork_detect.c index a2cf3a05a..99be497aa 100644 --- a/crypto/fipsmodule/rand/fork_detect.c +++ b/crypto/rand_extra/fork_detect.c @@ -16,8 +16,7 @@ #define _GNU_SOURCE // needed for madvise() and MAP_ANONYMOUS on Linux. #endif -#include -#include "fork_detect.h" +#include "../bcm_support.h" #if defined(OPENSSL_FORK_DETECTION_MADVISE) #include @@ -35,19 +34,18 @@ static_assert(MADV_WIPEONFORK == 18, "MADV_WIPEONFORK is not 18"); #include #endif // OPENSSL_FORK_DETECTION_MADVISE -#include "../delocate.h" -#include "../../internal.h" +#include "../internal.h" #if defined(OPENSSL_FORK_DETECTION_MADVISE) -DEFINE_BSS_GET(int, g_force_madv_wipeonfork); -DEFINE_BSS_GET(int, g_force_madv_wipeonfork_enabled); -DEFINE_STATIC_ONCE(g_fork_detect_once); -DEFINE_STATIC_MUTEX(g_fork_detect_lock); -DEFINE_BSS_GET(CRYPTO_atomic_u32 *, g_fork_detect_addr); -DEFINE_BSS_GET(uint64_t, g_fork_generation); +static int g_force_madv_wipeonfork; +static int g_force_madv_wipeonfork_enabled; +static CRYPTO_once_t g_fork_detect_once = CRYPTO_ONCE_INIT; +static CRYPTO_MUTEX g_fork_detect_lock = CRYPTO_MUTEX_INIT; +static CRYPTO_atomic_u32 * g_fork_detect_addr; +static uint64_t g_fork_generation; static void init_fork_detect(void) { - if (*g_force_madv_wipeonfork_bss_get()) { + if (g_force_madv_wipeonfork) { return; } @@ -74,13 +72,13 @@ static void init_fork_detect(void) { } CRYPTO_atomic_store_u32(addr, 1); - *g_fork_detect_addr_bss_get() = addr; - *g_fork_generation_bss_get() = 1; + g_fork_detect_addr = addr; + g_fork_generation = 1; } uint64_t CRYPTO_get_fork_generation(void) { - CRYPTO_once(g_fork_detect_once_bss_get(), init_fork_detect); + CRYPTO_once(&g_fork_detect_once, init_fork_detect); // In a single-threaded process, there are obviously no races because there's // only a single mutator in the address space. @@ -93,12 +91,12 @@ uint64_t CRYPTO_get_fork_generation(void) { // child process is single-threaded, the child may become multi-threaded // before it observes this. Therefore, we must synchronize the logic below. - CRYPTO_atomic_u32 *const flag_ptr = *g_fork_detect_addr_bss_get(); + CRYPTO_atomic_u32 *const flag_ptr = g_fork_detect_addr; if (flag_ptr == NULL) { // Our kernel is too old to support |MADV_WIPEONFORK| or // |g_force_madv_wipeonfork| is set. - if (*g_force_madv_wipeonfork_bss_get() && - *g_force_madv_wipeonfork_enabled_bss_get()) { + if (g_force_madv_wipeonfork && + g_force_madv_wipeonfork_enabled) { // A constant generation number to simulate support, even if the kernel // doesn't support it. return 42; @@ -114,7 +112,7 @@ uint64_t CRYPTO_get_fork_generation(void) { // In the common case, try to observe the flag without taking a lock. This // avoids cacheline contention in the PRNG. - uint64_t *const generation_ptr = g_fork_generation_bss_get(); + uint64_t *const generation_ptr = &g_fork_generation; if (CRYPTO_atomic_load_u32(flag_ptr) != 0) { // If we observe a non-zero flag, it is safe to read |generation_ptr| // without a lock. The flag and generation number are fixed for this copy of @@ -125,7 +123,7 @@ uint64_t CRYPTO_get_fork_generation(void) { // The flag was zero. The generation number must be incremented, but other // threads may have concurrently observed the zero, so take a lock before // incrementing. - CRYPTO_MUTEX *const lock = g_fork_detect_lock_bss_get(); + CRYPTO_MUTEX *const lock = &g_fork_detect_lock; CRYPTO_MUTEX_lock_write(lock); uint64_t current_generation = *generation_ptr; if (CRYPTO_atomic_load_u32(flag_ptr) == 0) { @@ -147,35 +145,35 @@ uint64_t CRYPTO_get_fork_generation(void) { } void CRYPTO_fork_detect_force_madv_wipeonfork_for_testing(int on) { - *g_force_madv_wipeonfork_bss_get() = 1; - *g_force_madv_wipeonfork_enabled_bss_get() = on; + g_force_madv_wipeonfork = 1; + g_force_madv_wipeonfork_enabled = on; } #elif defined(OPENSSL_FORK_DETECTION_PTHREAD_ATFORK) -DEFINE_STATIC_ONCE(g_pthread_fork_detection_once); -DEFINE_BSS_GET(uint64_t, g_atfork_fork_generation); +static CRYPTO_once_t g_pthread_fork_detection_once = CRYPTO_ONCE_INIT; +static uint64_t g_atfork_fork_generation; static void we_are_forked(void) { // Immediately after a fork, the process must be single-threaded. - uint64_t value = *g_atfork_fork_generation_bss_get() + 1; + uint64_t value = g_atfork_fork_generation + 1; if (value == 0) { value = 1; } - *g_atfork_fork_generation_bss_get() = value; + g_atfork_fork_generation = value; } static void init_pthread_fork_detection(void) { if (pthread_atfork(NULL, NULL, we_are_forked) != 0) { abort(); } - *g_atfork_fork_generation_bss_get() = 1; + g_atfork_fork_generation = 1; } uint64_t CRYPTO_get_fork_generation(void) { - CRYPTO_once(g_pthread_fork_detection_once_bss_get(), init_pthread_fork_detection); + CRYPTO_once(&g_pthread_fork_detection_once, init_pthread_fork_detection); - return *g_atfork_fork_generation_bss_get(); + return g_atfork_fork_generation; } #elif defined(OPENSSL_DOES_NOT_FORK) diff --git a/crypto/fipsmodule/rand/fork_detect_test.cc b/crypto/rand_extra/fork_detect_test.cc similarity index 99% rename from crypto/fipsmodule/rand/fork_detect_test.cc rename to crypto/rand_extra/fork_detect_test.cc index f9cde28ba..2e30456aa 100644 --- a/crypto/fipsmodule/rand/fork_detect_test.cc +++ b/crypto/rand_extra/fork_detect_test.cc @@ -14,7 +14,7 @@ #include -#include "fork_detect.h" +#include "../bcm_support.h" // TSAN cannot cope with this test and complains that "starting new threads // after multi-threaded fork is not supported". diff --git a/crypto/rand_extra/rand_test.cc b/crypto/rand_extra/rand_test.cc index 1af28b04a..6a8b2c738 100644 --- a/crypto/rand_extra/rand_test.cc +++ b/crypto/rand_extra/rand_test.cc @@ -20,7 +20,7 @@ #include -#include "../fipsmodule/rand/fork_detect.h" +#include "../bcm_support.h" #include "../fipsmodule/rand/internal.h" #include "../test/abi_test.h" #include "../test/test_util.h" diff --git a/gen/sources.bzl b/gen/sources.bzl index 156605169..dcb77761f 100644 --- a/gen/sources.bzl +++ b/gen/sources.bzl @@ -81,7 +81,6 @@ bcm_internal_headers = [ "crypto/fipsmodule/modes/ofb.c", "crypto/fipsmodule/modes/polyval.c", "crypto/fipsmodule/rand/ctrdrbg.c", - "crypto/fipsmodule/rand/fork_detect.c", "crypto/fipsmodule/rand/rand.c", "crypto/fipsmodule/rsa/blinding.c", "crypto/fipsmodule/rsa/padding.c", @@ -390,6 +389,7 @@ crypto_sources = [ "crypto/poly1305/poly1305_vec.c", "crypto/pool/pool.c", "crypto/rand_extra/deterministic.c", + "crypto/rand_extra/fork_detect.c", "crypto/rand_extra/forkunsafe.c", "crypto/rand_extra/getentropy.c", "crypto/rand_extra/ios.c", @@ -615,7 +615,6 @@ crypto_internal_headers = [ "crypto/fipsmodule/ecdsa/internal.h", "crypto/fipsmodule/md5/internal.h", "crypto/fipsmodule/modes/internal.h", - "crypto/fipsmodule/rand/fork_detect.h", "crypto/fipsmodule/rand/internal.h", "crypto/fipsmodule/rsa/internal.h", "crypto/fipsmodule/service_indicator/internal.h", @@ -725,7 +724,6 @@ crypto_test_sources = [ "crypto/fipsmodule/md5/md5_test.cc", "crypto/fipsmodule/modes/gcm_test.cc", "crypto/fipsmodule/rand/ctrdrbg_test.cc", - "crypto/fipsmodule/rand/fork_detect_test.cc", "crypto/fipsmodule/service_indicator/service_indicator_test.cc", "crypto/fipsmodule/sha/sha_test.cc", "crypto/hmac_extra/hmac_test.cc", @@ -744,8 +742,10 @@ crypto_test_sources = [ "crypto/pkcs8/pkcs8_test.cc", "crypto/poly1305/poly1305_test.cc", "crypto/pool/pool_test.cc", + "crypto/rand_extra/fork_detect_test.cc", "crypto/rand_extra/getentropy_test.cc", "crypto/rand_extra/rand_test.cc", + "crypto/rand_extra/rand_test.cc", "crypto/refcount_test.cc", "crypto/rsa_extra/rsa_test.cc", "crypto/self_test.cc", diff --git a/gen/sources.cmake b/gen/sources.cmake index 5956a7c85..5d730713c 100644 --- a/gen/sources.cmake +++ b/gen/sources.cmake @@ -85,7 +85,6 @@ set( crypto/fipsmodule/modes/ofb.c crypto/fipsmodule/modes/polyval.c crypto/fipsmodule/rand/ctrdrbg.c - crypto/fipsmodule/rand/fork_detect.c crypto/fipsmodule/rand/rand.c crypto/fipsmodule/rsa/blinding.c crypto/fipsmodule/rsa/padding.c @@ -404,6 +403,7 @@ set( crypto/poly1305/poly1305_vec.c crypto/pool/pool.c crypto/rand_extra/deterministic.c + crypto/rand_extra/fork_detect.c crypto/rand_extra/forkunsafe.c crypto/rand_extra/getentropy.c crypto/rand_extra/ios.c @@ -633,7 +633,6 @@ set( crypto/fipsmodule/ecdsa/internal.h crypto/fipsmodule/md5/internal.h crypto/fipsmodule/modes/internal.h - crypto/fipsmodule/rand/fork_detect.h crypto/fipsmodule/rand/internal.h crypto/fipsmodule/rsa/internal.h crypto/fipsmodule/service_indicator/internal.h @@ -749,7 +748,6 @@ set( crypto/fipsmodule/md5/md5_test.cc crypto/fipsmodule/modes/gcm_test.cc crypto/fipsmodule/rand/ctrdrbg_test.cc - crypto/fipsmodule/rand/fork_detect_test.cc crypto/fipsmodule/service_indicator/service_indicator_test.cc crypto/fipsmodule/sha/sha_test.cc crypto/hmac_extra/hmac_test.cc @@ -768,8 +766,10 @@ set( crypto/pkcs8/pkcs8_test.cc crypto/poly1305/poly1305_test.cc crypto/pool/pool_test.cc + crypto/rand_extra/fork_detect_test.cc crypto/rand_extra/getentropy_test.cc crypto/rand_extra/rand_test.cc + crypto/rand_extra/rand_test.cc crypto/refcount_test.cc crypto/rsa_extra/rsa_test.cc crypto/self_test.cc diff --git a/gen/sources.gni b/gen/sources.gni index 55574c3f0..19601f860 100644 --- a/gen/sources.gni +++ b/gen/sources.gni @@ -81,7 +81,6 @@ bcm_internal_headers = [ "crypto/fipsmodule/modes/ofb.c", "crypto/fipsmodule/modes/polyval.c", "crypto/fipsmodule/rand/ctrdrbg.c", - "crypto/fipsmodule/rand/fork_detect.c", "crypto/fipsmodule/rand/rand.c", "crypto/fipsmodule/rsa/blinding.c", "crypto/fipsmodule/rsa/padding.c", @@ -390,6 +389,7 @@ crypto_sources = [ "crypto/poly1305/poly1305_vec.c", "crypto/pool/pool.c", "crypto/rand_extra/deterministic.c", + "crypto/rand_extra/fork_detect.c", "crypto/rand_extra/forkunsafe.c", "crypto/rand_extra/getentropy.c", "crypto/rand_extra/ios.c", @@ -615,7 +615,6 @@ crypto_internal_headers = [ "crypto/fipsmodule/ecdsa/internal.h", "crypto/fipsmodule/md5/internal.h", "crypto/fipsmodule/modes/internal.h", - "crypto/fipsmodule/rand/fork_detect.h", "crypto/fipsmodule/rand/internal.h", "crypto/fipsmodule/rsa/internal.h", "crypto/fipsmodule/service_indicator/internal.h", @@ -725,7 +724,6 @@ crypto_test_sources = [ "crypto/fipsmodule/md5/md5_test.cc", "crypto/fipsmodule/modes/gcm_test.cc", "crypto/fipsmodule/rand/ctrdrbg_test.cc", - "crypto/fipsmodule/rand/fork_detect_test.cc", "crypto/fipsmodule/service_indicator/service_indicator_test.cc", "crypto/fipsmodule/sha/sha_test.cc", "crypto/hmac_extra/hmac_test.cc", @@ -744,8 +742,10 @@ crypto_test_sources = [ "crypto/pkcs8/pkcs8_test.cc", "crypto/poly1305/poly1305_test.cc", "crypto/pool/pool_test.cc", + "crypto/rand_extra/fork_detect_test.cc", "crypto/rand_extra/getentropy_test.cc", "crypto/rand_extra/rand_test.cc", + "crypto/rand_extra/rand_test.cc", "crypto/refcount_test.cc", "crypto/rsa_extra/rsa_test.cc", "crypto/self_test.cc", diff --git a/gen/sources.json b/gen/sources.json index d6ef92d4f..1870eccd9 100644 --- a/gen/sources.json +++ b/gen/sources.json @@ -66,7 +66,6 @@ "crypto/fipsmodule/modes/ofb.c", "crypto/fipsmodule/modes/polyval.c", "crypto/fipsmodule/rand/ctrdrbg.c", - "crypto/fipsmodule/rand/fork_detect.c", "crypto/fipsmodule/rand/rand.c", "crypto/fipsmodule/rsa/blinding.c", "crypto/fipsmodule/rsa/padding.c", @@ -374,6 +373,7 @@ "crypto/poly1305/poly1305_vec.c", "crypto/pool/pool.c", "crypto/rand_extra/deterministic.c", + "crypto/rand_extra/fork_detect.c", "crypto/rand_extra/forkunsafe.c", "crypto/rand_extra/getentropy.c", "crypto/rand_extra/ios.c", @@ -597,7 +597,6 @@ "crypto/fipsmodule/ecdsa/internal.h", "crypto/fipsmodule/md5/internal.h", "crypto/fipsmodule/modes/internal.h", - "crypto/fipsmodule/rand/fork_detect.h", "crypto/fipsmodule/rand/internal.h", "crypto/fipsmodule/rsa/internal.h", "crypto/fipsmodule/service_indicator/internal.h", @@ -706,7 +705,6 @@ "crypto/fipsmodule/md5/md5_test.cc", "crypto/fipsmodule/modes/gcm_test.cc", "crypto/fipsmodule/rand/ctrdrbg_test.cc", - "crypto/fipsmodule/rand/fork_detect_test.cc", "crypto/fipsmodule/service_indicator/service_indicator_test.cc", "crypto/fipsmodule/sha/sha_test.cc", "crypto/hmac_extra/hmac_test.cc", @@ -725,8 +723,10 @@ "crypto/pkcs8/pkcs8_test.cc", "crypto/poly1305/poly1305_test.cc", "crypto/pool/pool_test.cc", + "crypto/rand_extra/fork_detect_test.cc", "crypto/rand_extra/getentropy_test.cc", "crypto/rand_extra/rand_test.cc", + "crypto/rand_extra/rand_test.cc", "crypto/refcount_test.cc", "crypto/rsa_extra/rsa_test.cc", "crypto/self_test.cc",