From 13fd627449cefbae7576d4b145cb24fac303fc7d Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Fri, 28 Sep 2018 10:12:35 -0500 Subject: [PATCH] Disable RandTest.Fork on iOS. iOS doesn't support fork. Bug: chromium:890115 Change-Id: Idac6c0e180bbc1088ca5c562b8c1e646bff00b25 Reviewed-on: https://boringssl-review.googlesource.com/32164 Reviewed-by: Steven Valdez --- crypto/rand_extra/rand_test.cc | 6 ++++-- include/openssl/base.h | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crypto/rand_extra/rand_test.cc b/crypto/rand_extra/rand_test.cc index 183c4f77..d0a7e40e 100644 --- a/crypto/rand_extra/rand_test.cc +++ b/crypto/rand_extra/rand_test.cc @@ -50,7 +50,8 @@ TEST(RandTest, NotObviouslyBroken) { EXPECT_NE(Bytes(buf2), Bytes(kZeros)); } -#if !defined(OPENSSL_WINDOWS) && !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) +#if !defined(OPENSSL_WINDOWS) && !defined(OPENSSL_IOS) && \ + !defined(BORINGSSL_UNSAFE_DETERMINISTIC_MODE) static bool ForkAndRand(bssl::Span out) { int pipefds[2]; if (pipe(pipefds) < 0) { @@ -144,7 +145,8 @@ TEST(RandTest, Fork) { EXPECT_NE(Bytes(buf2), Bytes(kZeros)); EXPECT_NE(Bytes(buf3), Bytes(kZeros)); } -#endif // !OPENSSL_WINDOWS && !BORINGSSL_UNSAFE_DETERMINISTIC_MODE +#endif // !OPENSSL_WINDOWS && !OPENSSL_IOS && + // !BORINGSSL_UNSAFE_DETERMINISTIC_MODE #if defined(OPENSSL_THREADS) static void RunConcurrentRands(size_t num_threads) { diff --git a/include/openssl/base.h b/include/openssl/base.h index e287de73..c0d7a8c5 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -120,6 +120,9 @@ extern "C" { #if defined(__APPLE__) #define OPENSSL_APPLE +#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE +#define OPENSSL_IOS +#endif #endif #if defined(_WIN32)