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 = 0, /* Default */
21 SSL_TEST_INTERNAL_ERROR
25 SSL_TEST_VERIFY_NONE = 0, /* Default */
26 SSL_TEST_VERIFY_ACCEPT_ALL,
27 SSL_TEST_VERIFY_REJECT_ALL
28 } ssl_verify_callback_t;
30 typedef struct ssl_test_ctx {
31 /* Test expectations. */
32 /* Defaults to SUCCESS. */
33 ssl_test_result_t expected_result;
34 /* Alerts. 0 if no expectation. */
35 /* See ssl.h for alert codes. */
36 /* Alert sent by the client / received by the server. */
38 /* Alert sent by the server / received by the client. */
40 /* Negotiated protocol version. 0 if no expectation. */
41 /* See ssl.h for protocol versions. */
43 /* One of a number of predefined custom callbacks. */
44 ssl_verify_callback_t client_verify_callback;
47 const char *ssl_test_result_name(ssl_test_result_t result);
48 const char *ssl_alert_name(int alert);
49 const char *ssl_protocol_name(int protocol);
50 const char *ssl_verify_callback_name(ssl_verify_callback_t verify_callback);
53 * Load the test case context from |conf|.
54 * See test/README.ssl_test for details on the conf file format.
56 SSL_TEST_CTX *SSL_TEST_CTX_create(const CONF *conf, const char *test_section);
58 SSL_TEST_CTX *SSL_TEST_CTX_new(void);
60 void SSL_TEST_CTX_free(SSL_TEST_CTX *ctx);
62 #endif /* HEADER_SSL_TEST_CTX_H */