blob: fb479d10da66c08c308f19944a0b8cc7b27f01a9 [file] [log] [blame]
Adam Langleyd9e397b2015-01-22 14:27:53 -08001/* 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>
David Benjaminc895d6b2016-08-11 13:26:41 -040019#include <vector>
Adam Langleyd9e397b2015-01-22 14:27:53 -080020
21
22struct TestConfig {
Adam Langleye9ada862015-05-11 17:20:37 -070023 int port = 0;
24 bool is_server = false;
25 bool is_dtls = false;
David Benjaminf0c4a6c2016-08-11 13:26:41 -040026 int resume_count = 0;
Robert Sloanf6200e72017-07-10 08:09:18 -070027 std::string write_settings;
Adam Langleye9ada862015-05-11 17:20:37 -070028 bool fallback_scsv = false;
David Benjaminc895d6b2016-08-11 13:26:41 -040029 std::vector<int> signing_prefs;
Robert Sloan572a4e22017-04-17 10:52:19 -070030 std::vector<int> verify_prefs;
Adam Langleyd9e397b2015-01-22 14:27:53 -080031 std::string key_file;
32 std::string cert_file;
33 std::string expected_server_name;
34 std::string expected_certificate_types;
Adam Langleye9ada862015-05-11 17:20:37 -070035 bool require_any_client_certificate = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080036 std::string advertise_npn;
37 std::string expected_next_proto;
Adam Langleye9ada862015-05-11 17:20:37 -070038 bool false_start = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080039 std::string select_next_proto;
Adam Langleye9ada862015-05-11 17:20:37 -070040 bool async = false;
41 bool write_different_record_sizes = false;
42 bool cbc_record_splitting = false;
43 bool partial_write = false;
David Benjamind316cba2016-06-02 16:17:39 -040044 bool no_tls13 = false;
Adam Langleye9ada862015-05-11 17:20:37 -070045 bool no_tls12 = false;
46 bool no_tls11 = false;
47 bool no_tls1 = false;
48 bool no_ssl3 = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080049 std::string expected_channel_id;
David Benjaminc895d6b2016-08-11 13:26:41 -040050 bool enable_channel_id = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080051 std::string send_channel_id;
Robert Sloan978112c2018-01-22 12:53:01 -080052 int expected_token_binding_param = -1;
53 std::string send_token_binding_params;
Adam Langleye9ada862015-05-11 17:20:37 -070054 bool shim_writes_first = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080055 std::string host_name;
56 std::string advertise_alpn;
57 std::string expected_alpn;
Robert Sloane56da3e2017-06-26 08:26:42 -070058 std::string expected_late_alpn;
Adam Langleyd9e397b2015-01-22 14:27:53 -080059 std::string expected_advertised_alpn;
60 std::string select_alpn;
David Benjamin4969cc92016-04-22 15:02:23 -040061 bool decline_alpn = false;
Robert Sloan8542c082018-02-05 09:07:34 -080062 std::string quic_transport_params;
63 std::string expected_quic_transport_params;
Adam Langleye9ada862015-05-11 17:20:37 -070064 bool expect_session_miss = false;
65 bool expect_extended_master_secret = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080066 std::string psk;
67 std::string psk_identity;
Adam Langleyd9e397b2015-01-22 14:27:53 -080068 std::string srtp_profiles;
Adam Langleye9ada862015-05-11 17:20:37 -070069 bool enable_ocsp_stapling = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080070 std::string expected_ocsp_response;
Adam Langleye9ada862015-05-11 17:20:37 -070071 bool enable_signed_cert_timestamps = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -080072 std::string expected_signed_cert_timestamps;
Adam Langleye9ada862015-05-11 17:20:37 -070073 int min_version = 0;
74 int max_version = 0;
Robert Sloanf6200e72017-07-10 08:09:18 -070075 int expect_version = 0;
Adam Langleye9ada862015-05-11 17:20:37 -070076 int mtu = 0;
77 bool implicit_handshake = false;
78 bool use_early_callback = false;
79 bool fail_early_callback = false;
80 bool install_ddos_callback = false;
81 bool fail_ddos_callback = false;
82 bool fail_second_ddos_callback = false;
Steven Valdez909b19f2016-11-21 15:35:44 -050083 bool fail_cert_callback = false;
Adam Langleye9ada862015-05-11 17:20:37 -070084 std::string cipher;
85 bool handshake_never_done = false;
Robert Sloan55818102017-12-18 11:26:17 -080086 int export_early_keying_material = 0;
Adam Langleye9ada862015-05-11 17:20:37 -070087 int export_keying_material = 0;
88 std::string export_label;
89 std::string export_context;
90 bool use_export_context = false;
Adam Langleyf4e42722015-06-04 17:45:09 -070091 bool tls_unique = false;
Kenny Rootb8494592015-09-25 02:29:14 +000092 bool expect_ticket_renewal = false;
93 bool expect_no_session = false;
Robert Sloanb1b54b82017-11-06 13:50:02 -080094 bool expect_ticket_supports_early_data = false;
Robert Sloan6d0d00e2017-03-27 07:13:07 -070095 bool expect_accept_early_data = false;
96 bool expect_reject_early_data = false;
Robert Sloan29c1d2c2017-10-30 14:10:28 -070097 bool expect_no_offer_early_data = false;
Kenny Rootb8494592015-09-25 02:29:14 +000098 bool use_ticket_callback = false;
99 bool renew_ticket = false;
Robert Sloan69939df2017-01-09 10:53:07 -0800100 bool enable_early_data = false;
Robert Sloana12bf462017-07-17 07:08:26 -0700101 int tls13_variant = 0;
Kenny Rootb8494592015-09-25 02:29:14 +0000102 bool enable_client_custom_extension = false;
103 bool enable_server_custom_extension = false;
104 bool custom_extension_skip = false;
105 bool custom_extension_fail_add = false;
106 std::string ocsp_response;
107 bool check_close_notify = false;
108 bool shim_shuts_down = false;
Kenny Rootb8494592015-09-25 02:29:14 +0000109 bool verify_fail = false;
110 bool verify_peer = false;
Robert Sloanf6200e72017-07-10 08:09:18 -0700111 bool verify_peer_if_no_obc = false;
Kenny Rootb8494592015-09-25 02:29:14 +0000112 bool expect_verify_result = false;
113 std::string signed_cert_timestamps;
Kenny Roote99801b2015-11-06 15:31:15 -0800114 int expect_total_renegotiations = 0;
115 bool renegotiate_once = false;
116 bool renegotiate_freely = false;
Adam Langleyfad63272015-11-12 12:15:39 -0800117 bool renegotiate_ignore = false;
David Benjaminc895d6b2016-08-11 13:26:41 -0400118 int expect_peer_signature_algorithm = 0;
Adam Langley4139edb2016-01-13 15:00:54 -0800119 bool p384_only = false;
120 bool enable_all_curves = false;
David Benjaminc895d6b2016-08-11 13:26:41 -0400121 int expect_curve_id = 0;
David Benjamin4969cc92016-04-22 15:02:23 -0400122 bool use_old_client_cert_callback = false;
David Benjamind316cba2016-06-02 16:17:39 -0400123 int initial_timeout_duration_ms = 0;
Robert Sloan7d422bc2017-03-06 10:04:29 -0800124 std::string use_client_ca_list;
125 std::string expected_client_ca_list;
David Benjaminc895d6b2016-08-11 13:26:41 -0400126 bool send_alert = false;
Steven Valdezbb1ceac2016-10-07 10:34:51 -0400127 bool peek_then_read = false;
128 bool enable_grease = false;
129 int max_cert_list = 0;
Steven Valdez909b19f2016-11-21 15:35:44 -0500130 std::string ticket_key;
131 bool use_exporter_between_reads = false;
132 int expect_cipher_aes = 0;
133 int expect_cipher_no_aes = 0;
134 std::string expect_peer_cert_file;
135 int resumption_delay = 0;
Robert Sloan8f860b12017-08-28 07:37:06 -0700136 bool retain_only_sha256_client_cert = false;
137 bool expect_sha256_client_cert = false;
Robert Sloan69939df2017-01-09 10:53:07 -0800138 bool read_with_unfinished_write = false;
Steven Valdezb0b45c62017-01-17 16:23:54 -0500139 bool expect_secure_renegotiation = false;
140 bool expect_no_secure_renegotiation = false;
141 int max_send_fragment = 0;
142 int read_size = 0;
Robert Sloan4d1ac502017-02-06 08:36:14 -0800143 bool expect_session_id = false;
144 bool expect_no_session_id = false;
Robert Sloan1c9db532017-03-13 08:03:59 -0700145 int expect_ticket_age_skew = 0;
Robert Sloan6f79a502017-04-03 09:16:40 -0700146 bool no_op_extra_handshake = false;
147 bool handshake_twice = false;
Robert Sloan572a4e22017-04-17 10:52:19 -0700148 bool allow_unknown_alpn_protos = false;
149 bool enable_ed25519 = false;
Robert Sloanb6d070c2017-07-24 08:40:01 -0700150 bool use_custom_verify_callback = false;
Robert Sloanfe7cd212017-08-07 09:03:39 -0700151 std::string expect_msg_callback;
Robert Sloancd79cde2017-12-11 09:06:12 -0800152 bool allow_false_start_without_alpn = false;
Robert Sloan0da43952018-01-03 15:13:14 -0800153 bool expect_draft_downgrade = false;
Robert Sloan0db7f542018-01-16 15:48:33 -0800154 int dummy_pq_padding_len = 0;
Robert Sloan8542c082018-02-05 09:07:34 -0800155 bool handoff = false;
Robert Sloanab8b8882018-03-26 11:39:51 -0700156 bool expect_dummy_pq_padding = false;
Adam Langleyd9e397b2015-01-22 14:27:53 -0800157};
158
Robert Sloane56da3e2017-06-26 08:26:42 -0700159bool ParseConfig(int argc, char **argv, TestConfig *out_initial,
160 TestConfig *out_resume, TestConfig *out_retry);
Adam Langleyd9e397b2015-01-22 14:27:53 -0800161
162
163#endif // HEADER_TEST_CONFIG