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 std::string write_settings; 28 bool fallback_scsv = false; 29 std::vector<int> signing_prefs; 30 std::vector<int> verify_prefs; 31 std::string key_file; 32 std::string cert_file; 33 std::string expected_server_name; 34 std::string expected_certificate_types; 35 bool require_any_client_certificate = false; 36 std::string advertise_npn; 37 std::string expected_next_proto; 38 bool false_start = false; 39 std::string select_next_proto; 40 bool async = false; 41 bool write_different_record_sizes = false; 42 bool cbc_record_splitting = false; 43 bool partial_write = false; 44 bool no_tls13 = false; 45 bool no_tls12 = false; 46 bool no_tls11 = false; 47 bool no_tls1 = false; 48 bool no_ssl3 = false; 49 std::string expected_channel_id; 50 bool enable_channel_id = false; 51 std::string send_channel_id; 52 int expected_token_binding_param = -1; 53 std::string send_token_binding_params; 54 bool shim_writes_first = false; 55 std::string host_name; 56 std::string advertise_alpn; 57 std::string expected_alpn; 58 std::string expected_late_alpn; 59 std::string expected_advertised_alpn; 60 std::string select_alpn; 61 bool decline_alpn = false; 62 std::string quic_transport_params; 63 std::string expected_quic_transport_params; 64 bool expect_session_miss = false; 65 bool expect_extended_master_secret = false; 66 std::string psk; 67 std::string psk_identity; 68 std::string srtp_profiles; 69 bool enable_ocsp_stapling = false; 70 std::string expected_ocsp_response; 71 bool enable_signed_cert_timestamps = false; 72 std::string expected_signed_cert_timestamps; 73 int min_version = 0; 74 int max_version = 0; 75 int expect_version = 0; 76 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; 83 bool fail_cert_callback = false; 84 std::string cipher; 85 bool handshake_never_done = false; 86 int export_early_keying_material = 0; 87 int export_keying_material = 0; 88 std::string export_label; 89 std::string export_context; 90 bool use_export_context = false; 91 bool tls_unique = false; 92 bool expect_ticket_renewal = false; 93 bool expect_no_session = false; 94 bool expect_ticket_supports_early_data = false; 95 bool expect_accept_early_data = false; 96 bool expect_reject_early_data = false; 97 bool expect_no_offer_early_data = false; 98 bool use_ticket_callback = false; 99 bool renew_ticket = false; 100 bool enable_early_data = false; 101 int tls13_variant = 0; 102 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; 109 bool verify_fail = false; 110 bool verify_peer = false; 111 bool verify_peer_if_no_obc = false; 112 bool expect_verify_result = false; 113 std::string signed_cert_timestamps; 114 int expect_total_renegotiations = 0; 115 bool renegotiate_once = false; 116 bool renegotiate_freely = false; 117 bool renegotiate_ignore = false; 118 int expect_peer_signature_algorithm = 0; 119 bool p384_only = false; 120 bool enable_all_curves = false; 121 int expect_curve_id = 0; 122 bool use_old_client_cert_callback = false; 123 int initial_timeout_duration_ms = 0; 124 std::string use_client_ca_list; 125 std::string expected_client_ca_list; 126 bool send_alert = false; 127 bool peek_then_read = false; 128 bool enable_grease = false; 129 int max_cert_list = 0; 130 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; 136 bool retain_only_sha256_client_cert = false; 137 bool expect_sha256_client_cert = false; 138 bool read_with_unfinished_write = false; 139 bool expect_secure_renegotiation = false; 140 bool expect_no_secure_renegotiation = false; 141 int max_send_fragment = 0; 142 int read_size = 0; 143 bool expect_session_id = false; 144 bool expect_no_session_id = false; 145 int expect_ticket_age_skew = 0; 146 bool no_op_extra_handshake = false; 147 bool handshake_twice = false; 148 bool allow_unknown_alpn_protos = false; 149 bool enable_ed25519 = false; 150 bool use_custom_verify_callback = false; 151 std::string expect_msg_callback; 152 bool allow_false_start_without_alpn = false; 153 bool expect_draft_downgrade = false; 154 int dummy_pq_padding_len = 0; 155 bool handoff = false; 156 }; 157 158 bool ParseConfig(int argc, char **argv, TestConfig *out_initial, 159 TestConfig *out_resume, TestConfig *out_retry); 160 161 162 #endif // HEADER_TEST_CONFIG 163