diff --git a/ssl/test/bssl_shim.cc b/ssl/test/bssl_shim.cc index 6df8d6008..6a5fca389 100644 --- a/ssl/test/bssl_shim.cc +++ b/ssl/test/bssl_shim.cc @@ -66,10 +66,6 @@ OPENSSL_MSVC_PRAGMA(comment(lib, "Ws2_32.lib")) #include "test_config.h" #include "test_state.h" -#if defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID) -#define HANDSHAKER_SUPPORTED -#endif - #if !defined(OPENSSL_WINDOWS) static int closesocket(int sock) { diff --git a/ssl/test/handshake_util.cc b/ssl/test/handshake_util.cc index a94fbaf21..7fa0fb5a9 100644 --- a/ssl/test/handshake_util.cc +++ b/ssl/test/handshake_util.cc @@ -15,7 +15,7 @@ #include "handshake_util.h" #include -#if defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID) +#if defined(HANDSHAKER_SUPPORTED) #include #include #include @@ -136,7 +136,7 @@ int CheckIdempotentError(const char *name, SSL *ssl, return ret; } -#if defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID) +#if defined(HANDSHAKER_SUPPORTED) // MoveBIOs moves the |BIO|s of |src| to |dst|. It is used for handoff. static void MoveBIOs(SSL *dest, SSL *src) { @@ -543,4 +543,4 @@ bool DoSplitHandshake(UniquePtr *ssl, SettingsWriter *writer, return true; } -#endif // defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID) +#endif // defined(HANDSHAKER_SUPPORTED) diff --git a/ssl/test/handshake_util.h b/ssl/test/handshake_util.h index 4fb46dbff..fa365a401 100644 --- a/ssl/test/handshake_util.h +++ b/ssl/test/handshake_util.h @@ -21,6 +21,11 @@ #include "settings_writer.h" + +#if defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID) +#define HANDSHAKER_SUPPORTED +#endif + // RetryAsync is called after a failed operation on |ssl| with return code // |ret|. If the operation should be retried, it simulates one asynchronous // event and returns true. Otherwise it returns false. @@ -30,6 +35,7 @@ bool RetryAsync(SSL *ssl, int ret); // errors are idempotent. int CheckIdempotentError(const char *name, SSL *ssl, std::function func); +#if defined(HANDSHAKER_SUPPORTED) // DoSplitHandshake delegates the SSL handshake to a separate process, called // the handshaker. This process proxies I/O between the handshaker and the // client, using the |BIO| from |ssl|. After a successful handshake, |ssl| is @@ -49,5 +55,6 @@ constexpr char kControlMsgError = 'E'; // Handshaker hit an error constexpr int kFdControl = 3; // Bi-directional dgram socket. constexpr int kFdProxyToHandshaker = 4; // Uni-directional pipe. constexpr int kFdHandshakerToProxy = 5; // Uni-directional pipe. +#endif // HANDSHAKER_SUPPORTED #endif // HEADER_TEST_HANDSHAKE