Rebase shim against latest boringssl code
[oweals/openssl.git] / test / ossl_shim / test_config.h
1 /* Copyright (c) 2014, Google Inc.
2  *
3  * Permission to use, copy, modify, and/or distribute this software for any
4  * purpose with or without fee is hereby granted, provided that the above
5  * copyright notice and this permission notice appear in all copies.
6  *
7  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
10  * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
12  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
13  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */
14
15 #ifndef HEADER_TEST_CONFIG
16 #define HEADER_TEST_CONFIG
17
18 #include <string>
19 #include <vector>
20
21
22 struct TestConfig {
23   int port = 0;
24   bool is_server = false;
25   bool is_dtls = false;
26   int resume_count = 0;
27   bool fallback_scsv = false;
28   std::string digest_prefs;
29   std::vector<int> signing_prefs;
30   std::string key_file;
31   std::string cert_file;
32   std::string expected_server_name;
33   std::string expected_certificate_types;
34   bool require_any_client_certificate = false;
35   std::string advertise_npn;
36   std::string expected_next_proto;
37   bool false_start = false;
38   std::string select_next_proto;
39   bool async = false;
40   bool write_different_record_sizes = false;
41   bool cbc_record_splitting = false;
42   bool partial_write = false;
43   bool no_tls13 = false;
44   bool no_tls12 = false;
45   bool no_tls11 = false;
46   bool no_tls1 = false;
47   bool no_ssl3 = false;
48   std::string expected_channel_id;
49   bool enable_channel_id = false;
50   std::string send_channel_id;
51   bool shim_writes_first = false;
52   std::string host_name;
53   std::string advertise_alpn;
54   std::string expected_alpn;
55   std::string expected_advertised_alpn;
56   std::string select_alpn;
57   bool decline_alpn = false;
58   bool expect_session_miss = false;
59   bool expect_extended_master_secret = false;
60   std::string psk;
61   std::string psk_identity;
62   std::string srtp_profiles;
63   bool enable_ocsp_stapling = false;
64   std::string expected_ocsp_response;
65   bool enable_signed_cert_timestamps = false;
66   std::string expected_signed_cert_timestamps;
67   int min_version = 0;
68   int max_version = 0;
69   int mtu = 0;
70   bool implicit_handshake = false;
71   bool use_early_callback = false;
72   bool fail_early_callback = false;
73   bool install_ddos_callback = false;
74   bool fail_ddos_callback = false;
75   bool fail_second_ddos_callback = false;
76   std::string cipher;
77   std::string cipher_tls10;
78   std::string cipher_tls11;
79   bool handshake_never_done = false;
80   int export_keying_material = 0;
81   std::string export_label;
82   std::string export_context;
83   bool use_export_context = false;
84   bool tls_unique = false;
85   bool expect_ticket_renewal = false;
86   bool expect_no_session = false;
87   bool use_ticket_callback = false;
88   bool renew_ticket = false;
89   bool enable_client_custom_extension = false;
90   bool enable_server_custom_extension = false;
91   bool custom_extension_skip = false;
92   bool custom_extension_fail_add = false;
93   std::string ocsp_response;
94   bool check_close_notify = false;
95   bool shim_shuts_down = false;
96   bool verify_fail = false;
97   bool verify_peer = false;
98   bool expect_verify_result = false;
99   std::string signed_cert_timestamps;
100   int expect_total_renegotiations = 0;
101   bool renegotiate_once = false;
102   bool renegotiate_freely = false;
103   bool renegotiate_ignore = false;
104   bool disable_npn = false;
105   int expect_peer_signature_algorithm = 0;
106   bool p384_only = false;
107   bool enable_all_curves = false;
108   bool use_sparse_dh_prime = false;
109   int expect_curve_id = 0;
110   int expect_dhe_group_size = 0;
111   bool use_old_client_cert_callback = false;
112   int initial_timeout_duration_ms = 0;
113   bool use_null_client_ca_list = false;
114   bool send_alert = false;
115   bool peek_then_read = false;
116   bool enable_grease = false;
117   int max_cert_list = 0;
118 };
119
120 bool ParseConfig(int argc, char **argv, TestConfig *out_config);
121
122
123 #endif  // HEADER_TEST_CONFIG