2 * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the OpenSSL licenses, (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 * https://www.openssl.org/source/license.html
8 * or in the file LICENSE in the source distribution.
11 #ifndef HEADER_SSL_TEST_CTX_H
12 #define HEADER_SSL_TEST_CTX_H
14 #include <openssl/conf.h>
15 #include <openssl/ssl.h>
18 SSL_TEST_SUCCESS, /* Default */
21 SSL_TEST_INTERNAL_ERROR
24 typedef struct ssl_test_ctx {
25 /* Test expectations. */
26 /* Defaults to SUCCESS. */
27 ssl_test_result_t expected_result;
28 /* Alerts. 0 if no expectation. */
29 /* See ssl.h for alert codes. */
30 /* Alert sent by the client / received by the server. */
32 /* Alert sent by the server / received by the client. */
34 /* Negotiated protocol version. 0 if no expectation. */
35 /* See ssl.h for protocol versions. */
39 const char *ssl_test_result_t_name(ssl_test_result_t result);
40 const char *ssl_alert_name(int alert);
41 const char *ssl_protocol_name(int protocol);
44 * Load the test case context from |conf|.
45 * See test/README.ssl_test for details on the conf file format.
47 SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section);
49 SSL_TEST_CTX *SSL_TEST_CTX_new(void);
51 void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx);
53 #endif /* HEADER_SSL_TEST_CTX_H */