| 1 |
/* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 |
* SPDX-License-Identifier: Apache-2.0 OR ISC |
| 3 |
*/ |
| 4 |
|
| 5 |
#ifndef HEADER_SSL_TRANSFER |
| 6 |
#define HEADER_SSL_TRANSFER |
| 7 |
|
| 8 |
#include <string> |
| 9 |
|
| 10 |
#include <openssl/ssl.h> |
| 11 |
|
| 12 |
#include "test_config.h" |
| 13 |
|
| 14 |
struct SSLTransfer { |
| 15 |
public: |
| 16 |
SSLTransfer(); |
| 17 |
|
| 18 |
// MarkTest generate a mark(err msg) if a test case of runner.go can be used to test |
| 19 |
// SSL transfer when |config->check_ssl_transfer| is true. |
| 20 |
void MarkTest(const TestConfig *config, const SSL *ssl); |
| 21 |
|
| 22 |
// ResetSSL resets |in| with a newly allocated SSL when |config->do_ssl_transfer| is true. |
| 23 |
// The newly allocated SSL has states transferred from the previous one hold by |in|. |
| 24 |
bool ResetSSL(const TestConfig *config, bssl::UniquePtr<SSL> *in); |
| 25 |
|
| 26 |
// MarkOrReset wraps |MarkTest| and |ResetSSL|. |
| 27 |
bool MarkOrReset(const TestConfig *config, bssl::UniquePtr<SSL> *in); |
| 28 |
|
| 29 |
// IsSupported returns true when |in| can be transferred. Otherwise, returns false. |
| 30 |
bool IsSupported(const SSL *in); |
| 31 |
}; |
| 32 |
|
| 33 |
#endif // HEADER_SSL_TRANSFER |