Define HANDSHAKER_SUPPORTED in once place.

Change-Id: Ie5e41c55e36958af5aabd9e365eb2986a488069e
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/46525
Reviewed-by: Adam Langley <agl@google.com>
grpc-202302
David Benjamin 4 years ago committed by Adam Langley
parent b9b036340d
commit 953650cc7b
  1. 4
      ssl/test/bssl_shim.cc
  2. 6
      ssl/test/handshake_util.cc
  3. 7
      ssl/test/handshake_util.h

@ -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) {

@ -15,7 +15,7 @@
#include "handshake_util.h"
#include <assert.h>
#if defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID)
#if defined(HANDSHAKER_SUPPORTED)
#include <errno.h>
#include <fcntl.h>
#include <spawn.h>
@ -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> *ssl, SettingsWriter *writer,
return true;
}
#endif // defined(OPENSSL_LINUX) && !defined(OPENSSL_ANDROID)
#endif // defined(HANDSHAKER_SUPPORTED)

@ -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<int()> 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

Loading…
Cancel
Save