blob: 76ee3126dacebd9429f9841fa44d0eb12480bba2 [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>
19
20
21struct TestConfig {
David Benjamin0d4db502015-03-23 18:46:05 -040022 int port = 0;
23 bool is_server = false;
24 bool is_dtls = false;
25 bool resume = false;
26 bool fallback_scsv = false;
David Benjamin5a593af2014-08-11 19:51:50 -040027 std::string key_file;
28 std::string cert_file;
29 std::string expected_server_name;
30 std::string expected_certificate_types;
David Benjamin0d4db502015-03-23 18:46:05 -040031 bool require_any_client_certificate = false;
David Benjamin5a593af2014-08-11 19:51:50 -040032 std::string advertise_npn;
33 std::string expected_next_proto;
David Benjamin0d4db502015-03-23 18:46:05 -040034 bool false_start = false;
David Benjamin5a593af2014-08-11 19:51:50 -040035 std::string select_next_proto;
David Benjamin0d4db502015-03-23 18:46:05 -040036 bool async = false;
37 bool write_different_record_sizes = false;
38 bool cbc_record_splitting = false;
39 bool partial_write = false;
40 bool no_tls12 = false;
41 bool no_tls11 = false;
42 bool no_tls1 = false;
43 bool no_ssl3 = false;
David Benjamina08e49d2014-08-24 01:46:07 -040044 std::string expected_channel_id;
45 std::string send_channel_id;
David Benjamin0d4db502015-03-23 18:46:05 -040046 bool shim_writes_first = false;
47 bool tls_d5_bug = false;
David Benjamine78bfde2014-09-06 12:45:15 -040048 std::string host_name;
David Benjaminae2888f2014-09-06 12:58:58 -040049 std::string advertise_alpn;
50 std::string expected_alpn;
51 std::string expected_advertised_alpn;
52 std::string select_alpn;
David Benjamin0d4db502015-03-23 18:46:05 -040053 bool expect_session_miss = false;
54 bool expect_extended_master_secret = false;
David Benjamin48cae082014-10-27 01:06:24 -040055 std::string psk;
56 std::string psk_identity;
David Benjaminca6c8262014-11-15 19:06:08 -050057 std::string srtp_profiles;
David Benjamin0d4db502015-03-23 18:46:05 -040058 bool enable_ocsp_stapling = false;
David Benjamin61f95272014-11-25 01:55:35 -050059 std::string expected_ocsp_response;
David Benjamin0d4db502015-03-23 18:46:05 -040060 bool enable_signed_cert_timestamps = false;
David Benjamin61f95272014-11-25 01:55:35 -050061 std::string expected_signed_cert_timestamps;
David Benjamin0d4db502015-03-23 18:46:05 -040062 int min_version = 0;
63 int max_version = 0;
64 int mtu = 0;
65 bool implicit_handshake = false;
66 bool use_early_callback = false;
67 bool fail_early_callback = false;
68 bool install_ddos_callback = false;
69 bool fail_ddos_callback = false;
70 bool fail_second_ddos_callback = false;
David Benjamin67d1fb52015-03-16 15:16:23 -040071 std::string cipher;
Adam Langleycef75832015-09-03 14:51:12 -070072 std::string cipher_tls10;
73 std::string cipher_tls11;
David Benjamin87e4acd2015-04-02 19:57:35 -040074 bool handshake_never_done = false;
David Benjaminc565ebb2015-04-03 04:06:36 -040075 int export_keying_material = 0;
76 std::string export_label;
77 std::string export_context;
78 bool use_export_context = false;
David Benjaminb16346b2015-04-08 19:16:58 -040079 bool reject_peer_renegotiations = false;
David Benjamincff0b902015-05-15 23:09:47 -040080 bool no_legacy_server_connect = false;
Adam Langleyaf0e32c2015-06-03 09:57:23 -070081 bool tls_unique = false;
David Benjaminb4d65fd2015-05-29 17:11:21 -040082 bool use_async_private_key = false;
David Benjaminba4594a2015-06-18 18:36:15 -040083 bool expect_ticket_renewal = false;
84 bool expect_no_session = false;
David Benjamind98452d2015-06-16 14:16:23 -040085 bool use_ticket_callback = false;
86 bool renew_ticket = false;
Adam Langley09505632015-07-30 18:10:13 -070087 bool enable_client_custom_extension = false;
88 bool enable_server_custom_extension = false;
89 bool custom_extension_skip = false;
90 bool custom_extension_fail_add = false;
Paul Lietaraeeff2c2015-08-12 11:47:11 +010091 std::string ocsp_response;
David Benjamin30789da2015-08-29 22:56:45 -040092 bool check_close_notify = false;
93 bool shim_shuts_down = false;
David Benjamin2c99d282015-09-01 10:23:00 -040094 bool microsoft_big_sslv3_buffer = 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 Benjamin5a593af2014-08-11 19:51:50 -040099};
100
101bool ParseConfig(int argc, char **argv, TestConfig *out_config);
102
103
104#endif // HEADER_TEST_CONFIG