Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

122 linhas
3.9 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. bool resume = false;
  23. bool fallback_scsv = false;
  24. std::string digest_prefs;
  25. std::vector<int> signing_prefs;
  26. std::string key_file;
  27. std::string cert_file;
  28. std::string expected_server_name;
  29. std::string expected_certificate_types;
  30. bool require_any_client_certificate = false;
  31. std::string advertise_npn;
  32. std::string expected_next_proto;
  33. bool false_start = false;
  34. std::string select_next_proto;
  35. bool async = false;
  36. bool write_different_record_sizes = false;
  37. bool cbc_record_splitting = false;
  38. bool partial_write = false;
  39. bool no_tls13 = false;
  40. bool no_tls12 = false;
  41. bool no_tls11 = false;
  42. bool no_tls1 = false;
  43. bool no_ssl3 = false;
  44. std::string expected_channel_id;
  45. bool enable_channel_id = false;
  46. std::string send_channel_id;
  47. bool shim_writes_first = false;
  48. std::string host_name;
  49. std::string advertise_alpn;
  50. std::string expected_alpn;
  51. std::string expected_advertised_alpn;
  52. std::string select_alpn;
  53. bool decline_alpn = false;
  54. bool expect_session_miss = false;
  55. bool expect_extended_master_secret = false;
  56. std::string psk;
  57. std::string psk_identity;
  58. std::string srtp_profiles;
  59. bool enable_ocsp_stapling = false;
  60. std::string expected_ocsp_response;
  61. bool enable_signed_cert_timestamps = false;
  62. std::string expected_signed_cert_timestamps;
  63. int min_version = 0;
  64. int max_version = 0;
  65. int fallback_version = 0;
  66. int mtu = 0;
  67. bool implicit_handshake = false;
  68. bool use_early_callback = false;
  69. bool fail_early_callback = false;
  70. bool install_ddos_callback = false;
  71. bool fail_ddos_callback = false;
  72. bool fail_second_ddos_callback = false;
  73. std::string cipher;
  74. std::string cipher_tls10;
  75. std::string cipher_tls11;
  76. bool handshake_never_done = false;
  77. int export_keying_material = 0;
  78. std::string export_label;
  79. std::string export_context;
  80. bool use_export_context = false;
  81. bool tls_unique = false;
  82. bool expect_ticket_renewal = false;
  83. bool expect_no_session = false;
  84. bool use_ticket_callback = false;
  85. bool renew_ticket = false;
  86. bool enable_client_custom_extension = false;
  87. bool enable_server_custom_extension = false;
  88. bool custom_extension_skip = false;
  89. bool custom_extension_fail_add = false;
  90. std::string ocsp_response;
  91. bool check_close_notify = false;
  92. bool shim_shuts_down = false;
  93. bool verify_fail = false;
  94. bool verify_peer = false;
  95. bool expect_verify_result = false;
  96. std::string signed_cert_timestamps;
  97. int expect_total_renegotiations = 0;
  98. bool renegotiate_once = false;
  99. bool renegotiate_freely = false;
  100. bool renegotiate_ignore = false;
  101. bool disable_npn = false;
  102. int expect_peer_signature_algorithm = 0;
  103. bool p384_only = false;
  104. bool enable_all_curves = false;
  105. bool use_sparse_dh_prime = false;
  106. int expect_curve_id = 0;
  107. int expect_dhe_group_size = 0;
  108. bool use_old_client_cert_callback = false;
  109. int initial_timeout_duration_ms = 0;
  110. bool use_null_client_ca_list = false;
  111. bool send_alert = false;
  112. };
  113. bool ParseConfig(int argc, char **argv, TestConfig *out_config);
  114. #endif // HEADER_TEST_CONFIG