blob: 4ee717ee21b4e9614d106cd9f170ddc9caff7276 [file] [log] [blame]
David Benjamin5a593af2014-08-11 19:51:50 -04001/* 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 Benjaminca3d5452016-07-14 12:51:01 -040019#include <vector>
David Benjamin5a593af2014-08-11 19:51:50 -040020
21
22struct TestConfig {
David Benjamin0d4db502015-03-23 18:46:05 -040023 int port = 0;
24 bool is_server = false;
25 bool is_dtls = false;
26 bool resume = false;
27 bool fallback_scsv = false;
Steven Valdez0d62f262015-09-04 12:41:04 -040028 std::string digest_prefs;
David Benjaminca3d5452016-07-14 12:51:01 -040029 std::vector<int> signing_prefs;
David Benjamin5a593af2014-08-11 19:51:50 -040030 std::string key_file;
31 std::string cert_file;
32 std::string expected_server_name;
33 std::string expected_certificate_types;
David Benjamin0d4db502015-03-23 18:46:05 -040034 bool require_any_client_certificate = false;
David Benjamin5a593af2014-08-11 19:51:50 -040035 std::string advertise_npn;
36 std::string expected_next_proto;
David Benjamin0d4db502015-03-23 18:46:05 -040037 bool false_start = false;
David Benjamin5a593af2014-08-11 19:51:50 -040038 std::string select_next_proto;
David Benjamin0d4db502015-03-23 18:46:05 -040039 bool async = false;
40 bool write_different_record_sizes = false;
41 bool cbc_record_splitting = false;
42 bool partial_write = false;
Steven Valdez4f94b1c2016-05-24 12:31:07 -040043 bool no_tls13 = false;
David Benjamin0d4db502015-03-23 18:46:05 -040044 bool no_tls12 = false;
45 bool no_tls11 = false;
46 bool no_tls1 = false;
47 bool no_ssl3 = false;
David Benjamina08e49d2014-08-24 01:46:07 -040048 std::string expected_channel_id;
49 std::string send_channel_id;
David Benjamin0d4db502015-03-23 18:46:05 -040050 bool shim_writes_first = false;
David Benjamine78bfde2014-09-06 12:45:15 -040051 std::string host_name;
David Benjaminae2888f2014-09-06 12:58:58 -040052 std::string advertise_alpn;
53 std::string expected_alpn;
54 std::string expected_advertised_alpn;
55 std::string select_alpn;
David Benjamin594e7d22016-03-17 17:49:56 -040056 bool decline_alpn = false;
David Benjamin0d4db502015-03-23 18:46:05 -040057 bool expect_session_miss = false;
58 bool expect_extended_master_secret = false;
David Benjamin48cae082014-10-27 01:06:24 -040059 std::string psk;
60 std::string psk_identity;
David Benjaminca6c8262014-11-15 19:06:08 -050061 std::string srtp_profiles;
David Benjamin0d4db502015-03-23 18:46:05 -040062 bool enable_ocsp_stapling = false;
David Benjamin61f95272014-11-25 01:55:35 -050063 std::string expected_ocsp_response;
David Benjamin0d4db502015-03-23 18:46:05 -040064 bool enable_signed_cert_timestamps = false;
David Benjamin61f95272014-11-25 01:55:35 -050065 std::string expected_signed_cert_timestamps;
David Benjamin0d4db502015-03-23 18:46:05 -040066 int min_version = 0;
67 int max_version = 0;
68 int mtu = 0;
69 bool implicit_handshake = false;
70 bool use_early_callback = false;
71 bool fail_early_callback = false;
72 bool install_ddos_callback = false;
73 bool fail_ddos_callback = false;
74 bool fail_second_ddos_callback = false;
David Benjamin67d1fb52015-03-16 15:16:23 -040075 std::string cipher;
Adam Langleycef75832015-09-03 14:51:12 -070076 std::string cipher_tls10;
77 std::string cipher_tls11;
David Benjamin87e4acd2015-04-02 19:57:35 -040078 bool handshake_never_done = false;
David Benjaminc565ebb2015-04-03 04:06:36 -040079 int export_keying_material = 0;
80 std::string export_label;
81 std::string export_context;
82 bool use_export_context = false;
Adam Langleyaf0e32c2015-06-03 09:57:23 -070083 bool tls_unique = false;
David Benjaminba4594a2015-06-18 18:36:15 -040084 bool expect_ticket_renewal = false;
85 bool expect_no_session = false;
David Benjamind98452d2015-06-16 14:16:23 -040086 bool use_ticket_callback = false;
87 bool renew_ticket = false;
Adam Langley09505632015-07-30 18:10:13 -070088 bool enable_client_custom_extension = false;
89 bool enable_server_custom_extension = false;
90 bool custom_extension_skip = false;
91 bool custom_extension_fail_add = false;
Paul Lietaraeeff2c2015-08-12 11:47:11 +010092 std::string ocsp_response;
David Benjamin30789da2015-08-29 22:56:45 -040093 bool check_close_notify = false;
94 bool shim_shuts_down = false;
Paul Lietar8f1c2682015-08-18 12:21:54 +010095 bool verify_fail = false;
96 bool verify_peer = false;
97 bool expect_verify_result = false;
Paul Lietar4fac72e2015-09-09 13:44:55 +010098 std::string signed_cert_timestamps;
David Benjamin324dce42015-10-12 19:49:00 -040099 int expect_total_renegotiations = 0;
David Benjamin1d5ef3b2015-10-12 19:54:18 -0400100 bool renegotiate_once = false;
101 bool renegotiate_freely = false;
Adam Langley27a0d082015-11-03 13:34:10 -0800102 bool renegotiate_ignore = false;
David Benjamin091c4b92015-10-26 13:33:21 -0400103 bool disable_npn = false;
Nick Harper60edffd2016-06-21 15:19:24 -0700104 int expect_peer_signature_algorithm = 0;
David Benjamin99fdfb92015-11-02 12:11:35 -0500105 bool p384_only = false;
David Benjamin8c2b3bf2015-12-18 20:55:44 -0500106 bool enable_all_curves = false;
Adam Langleyc4f25ce2015-11-26 16:39:08 -0800107 bool use_sparse_dh_prime = false;
David Benjamin9e68f192016-06-30 14:55:33 -0400108 int expect_curve_id = 0;
109 int expect_dhe_group_size = 0;
David Benjaminacb6dcc2016-03-10 09:15:01 -0500110 bool use_old_client_cert_callback = false;
Taylor Brandstetter376a0fe2016-05-10 19:30:28 -0700111 int initial_timeout_duration_ms = 0;
David Benjamin2f8935d2016-07-13 19:47:39 -0400112 bool use_null_client_ca_list = false;
David Benjamin5a593af2014-08-11 19:51:50 -0400113};
114
115bool ParseConfig(int argc, char **argv, TestConfig *out_config);
116
David Benjamin5a593af2014-08-11 19:51:50 -0400117
118#endif // HEADER_TEST_CONFIG