1/*
2 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the OpenSSL license (the "License").  You may not use
5 * this file except in compliance with the License.  You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#ifndef OSSL_TEST_SHIM_TEST_CONFIG_H
11#define OSSL_TEST_SHIM_TEST_CONFIG_H
12
13#include <string>
14#include <vector>
15
16
17struct TestConfig {
18  int port = 0;
19  bool is_server = false;
20  bool is_dtls = false;
21  int resume_count = 0;
22  bool fallback_scsv = false;
23  std::string key_file;
24  std::string cert_file;
25  std::string expected_server_name;
26  std::string expected_certificate_types;
27  bool require_any_client_certificate = false;
28  std::string advertise_npn;
29  std::string expected_next_proto;
30  std::string select_next_proto;
31  bool async = false;
32  bool write_different_record_sizes = false;
33  bool partial_write = false;
34  bool no_tls13 = false;
35  bool no_tls12 = false;
36  bool no_tls11 = false;
37  bool no_tls1 = false;
38  bool no_ssl3 = false;
39  bool shim_writes_first = false;
40  std::string host_name;
41  std::string advertise_alpn;
42  std::string expected_alpn;
43  std::string expected_advertised_alpn;
44  std::string select_alpn;
45  bool decline_alpn = false;
46  bool expect_session_miss = false;
47  bool expect_extended_master_secret = false;
48  std::string psk;
49  std::string psk_identity;
50  std::string srtp_profiles;
51  int min_version = 0;
52  int max_version = 0;
53  int mtu = 0;
54  bool implicit_handshake = false;
55  std::string cipher;
56  bool handshake_never_done = false;
57  int export_keying_material = 0;
58  std::string export_label;
59  std::string export_context;
60  bool use_export_context = false;
61  bool expect_ticket_renewal = false;
62  bool expect_no_session = false;
63  bool use_ticket_callback = false;
64  bool renew_ticket = false;
65  bool enable_client_custom_extension = false;
66  bool enable_server_custom_extension = false;
67  bool custom_extension_skip = false;
68  bool custom_extension_fail_add = false;
69  bool check_close_notify = false;
70  bool shim_shuts_down = false;
71  bool verify_fail = false;
72  bool verify_peer = false;
73  bool expect_verify_result = false;
74  int expect_total_renegotiations = 0;
75  bool renegotiate_freely = false;
76  bool p384_only = false;
77  bool enable_all_curves = false;
78  bool use_sparse_dh_prime = false;
79  bool use_old_client_cert_callback = false;
80  bool use_null_client_ca_list = false;
81  bool peek_then_read = false;
82  int max_cert_list = 0;
83};
84
85bool ParseConfig(int argc, char **argv, TestConfig *out_config);
86
87
88#endif  // OSSL_TEST_SHIM_TEST_CONFIG_H
89