From 9bf1634b93394385651858960309be05010015fe Mon Sep 17 00:00:00 2001 From: David Benjamin Date: Wed, 30 Sep 2020 15:24:18 -0400 Subject: [PATCH] Move Trusty workaround to the OPENSSL_LINUX define. See b/169780122. This CL should be a no-op (the only other OPENSSL_LINUX defines are in urandom/getrandom logic, which Trusty doesn't use), but should be easier to work for future code. Change-Id: I7676ce234a20ddaf54a881f2da1e1fcd680d1c78 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/43224 Reviewed-by: Adam Langley Commit-Queue: David Benjamin --- crypto/fipsmodule/rand/fork_detect.c | 2 +- include/openssl/base.h | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crypto/fipsmodule/rand/fork_detect.c b/crypto/fipsmodule/rand/fork_detect.c index 96cb595be..8dd2c9587 100644 --- a/crypto/fipsmodule/rand/fork_detect.c +++ b/crypto/fipsmodule/rand/fork_detect.c @@ -20,7 +20,7 @@ #include "fork_detect.h" -#if defined(OPENSSL_LINUX) && !defined(OPENSSL_TRUSTY) +#if defined(OPENSSL_LINUX) #include #include #include diff --git a/include/openssl/base.h b/include/openssl/base.h index d681bdf81..0bdb1db4d 100644 --- a/include/openssl/base.h +++ b/include/openssl/base.h @@ -138,7 +138,10 @@ extern "C" { #define OPENSSL_WINDOWS #endif -#if defined(__linux__) +// Trusty isn't Linux but currently defines __linux__. As a workaround, we +// exclude it here. +// TODO(b/169780122): Remove this workaround once Trusty no longer defines it. +#if defined(__linux__) && !defined(TRUSTY) #define OPENSSL_LINUX #endif