Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.
 
 
 
 
 
 

165 строки
5.5 KiB

  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. #ifndef HEADER_TEST_CONFIG
  15. #define HEADER_TEST_CONFIG
  16. #include <string>
  17. #include <vector>
  18. struct TestConfig {
  19. int port = 0;
  20. bool is_server = false;
  21. bool is_dtls = false;
  22. int resume_count = 0;
  23. std::string write_settings;
  24. bool fallback_scsv = false;
  25. std::vector<int> signing_prefs;
  26. std::vector<int> verify_prefs;
  27. std::string key_file;
  28. std::string cert_file;
  29. std::string expected_server_name;
  30. std::string expected_certificate_types;
  31. bool require_any_client_certificate = false;
  32. std::string advertise_npn;
  33. std::string expected_next_proto;
  34. bool false_start = false;
  35. std::string select_next_proto;
  36. bool async = false;
  37. bool write_different_record_sizes = false;
  38. bool cbc_record_splitting = false;
  39. bool partial_write = false;
  40. bool no_tls13 = false;
  41. bool no_tls12 = false;
  42. bool no_tls11 = false;
  43. bool no_tls1 = false;
  44. bool no_ssl3 = false;
  45. std::string expected_channel_id;
  46. bool enable_channel_id = false;
  47. std::string send_channel_id;
  48. int expected_token_binding_param = -1;
  49. std::string send_token_binding_params;
  50. bool shim_writes_first = false;
  51. std::string host_name;
  52. std::string advertise_alpn;
  53. std::string expected_alpn;
  54. std::string expected_late_alpn;
  55. std::string expected_advertised_alpn;
  56. std::string select_alpn;
  57. bool decline_alpn = false;
  58. std::string quic_transport_params;
  59. std::string expected_quic_transport_params;
  60. bool expect_session_miss = false;
  61. bool expect_extended_master_secret = false;
  62. std::string psk;
  63. std::string psk_identity;
  64. std::string srtp_profiles;
  65. bool enable_ocsp_stapling = false;
  66. std::string expected_ocsp_response;
  67. bool enable_signed_cert_timestamps = false;
  68. std::string expected_signed_cert_timestamps;
  69. int min_version = 0;
  70. int max_version = 0;
  71. int expect_version = 0;
  72. int mtu = 0;
  73. bool implicit_handshake = false;
  74. bool use_early_callback = false;
  75. bool fail_early_callback = false;
  76. bool install_ddos_callback = false;
  77. bool fail_ddos_callback = false;
  78. bool fail_second_ddos_callback = false;
  79. bool fail_cert_callback = false;
  80. std::string cipher;
  81. bool handshake_never_done = false;
  82. int export_early_keying_material = 0;
  83. int export_keying_material = 0;
  84. std::string export_label;
  85. std::string export_context;
  86. bool use_export_context = false;
  87. bool tls_unique = false;
  88. bool expect_ticket_renewal = false;
  89. bool expect_no_session = false;
  90. bool expect_ticket_supports_early_data = false;
  91. bool expect_accept_early_data = false;
  92. bool expect_reject_early_data = false;
  93. bool expect_no_offer_early_data = false;
  94. bool use_ticket_callback = false;
  95. bool renew_ticket = false;
  96. bool enable_early_data = false;
  97. int tls13_variant = 0;
  98. bool enable_client_custom_extension = false;
  99. bool enable_server_custom_extension = false;
  100. bool custom_extension_skip = false;
  101. bool custom_extension_fail_add = false;
  102. std::string ocsp_response;
  103. bool check_close_notify = false;
  104. bool shim_shuts_down = false;
  105. bool verify_fail = false;
  106. bool verify_peer = false;
  107. bool verify_peer_if_no_obc = false;
  108. bool expect_verify_result = false;
  109. std::string signed_cert_timestamps;
  110. int expect_total_renegotiations = 0;
  111. bool renegotiate_once = false;
  112. bool renegotiate_freely = false;
  113. bool renegotiate_ignore = false;
  114. int expect_peer_signature_algorithm = 0;
  115. bool p384_only = false;
  116. bool enable_all_curves = false;
  117. int expect_curve_id = 0;
  118. bool use_old_client_cert_callback = false;
  119. int initial_timeout_duration_ms = 0;
  120. std::string use_client_ca_list;
  121. std::string expected_client_ca_list;
  122. bool send_alert = false;
  123. bool peek_then_read = false;
  124. bool enable_grease = false;
  125. int max_cert_list = 0;
  126. std::string ticket_key;
  127. bool use_exporter_between_reads = false;
  128. int expect_cipher_aes = 0;
  129. int expect_cipher_no_aes = 0;
  130. std::string expect_peer_cert_file;
  131. int resumption_delay = 0;
  132. bool retain_only_sha256_client_cert = false;
  133. bool expect_sha256_client_cert = false;
  134. bool read_with_unfinished_write = false;
  135. bool expect_secure_renegotiation = false;
  136. bool expect_no_secure_renegotiation = false;
  137. int max_send_fragment = 0;
  138. int read_size = 0;
  139. bool expect_session_id = false;
  140. bool expect_no_session_id = false;
  141. int expect_ticket_age_skew = 0;
  142. bool no_op_extra_handshake = false;
  143. bool handshake_twice = false;
  144. bool allow_unknown_alpn_protos = false;
  145. bool enable_ed25519 = false;
  146. bool use_custom_verify_callback = false;
  147. std::string expect_msg_callback;
  148. bool allow_false_start_without_alpn = false;
  149. bool expect_draft_downgrade = false;
  150. int dummy_pq_padding_len = 0;
  151. bool handoff = false;
  152. bool expect_dummy_pq_padding = false;
  153. bool no_rsa_pss_rsae_certs = false;
  154. };
  155. bool ParseConfig(int argc, char **argv, TestConfig *out_initial,
  156. TestConfig *out_resume, TestConfig *out_retry);
  157. #endif // HEADER_TEST_CONFIG