test_config.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. /*
  2. * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License 2.0 (the "License"). You may not use
  5. * this file except in compliance with the License. You can obtain a copy
  6. * in the file LICENSE in the source distribution or at
  7. * https://www.openssl.org/source/license.html
  8. */
  9. #ifndef HEADER_TEST_CONFIG
  10. #define HEADER_TEST_CONFIG
  11. #include <string>
  12. #include <vector>
  13. struct TestConfig {
  14. int port = 0;
  15. bool is_server = false;
  16. bool is_dtls = false;
  17. int resume_count = 0;
  18. bool fallback_scsv = false;
  19. std::string key_file;
  20. std::string cert_file;
  21. std::string expected_server_name;
  22. std::string expected_certificate_types;
  23. bool require_any_client_certificate = false;
  24. std::string advertise_npn;
  25. std::string expected_next_proto;
  26. std::string select_next_proto;
  27. bool async = false;
  28. bool write_different_record_sizes = false;
  29. bool partial_write = false;
  30. bool no_tls13 = false;
  31. bool no_tls12 = false;
  32. bool no_tls11 = false;
  33. bool no_tls1 = false;
  34. bool no_ssl3 = false;
  35. bool shim_writes_first = false;
  36. std::string host_name;
  37. std::string advertise_alpn;
  38. std::string expected_alpn;
  39. std::string expected_advertised_alpn;
  40. std::string select_alpn;
  41. bool decline_alpn = false;
  42. bool expect_session_miss = false;
  43. bool expect_extended_master_secret = false;
  44. std::string psk;
  45. std::string psk_identity;
  46. std::string srtp_profiles;
  47. int min_version = 0;
  48. int max_version = 0;
  49. int mtu = 0;
  50. bool implicit_handshake = false;
  51. std::string cipher;
  52. bool handshake_never_done = false;
  53. int export_keying_material = 0;
  54. std::string export_label;
  55. std::string export_context;
  56. bool use_export_context = false;
  57. bool expect_ticket_renewal = false;
  58. bool expect_no_session = false;
  59. bool use_ticket_callback = false;
  60. bool renew_ticket = false;
  61. bool enable_client_custom_extension = false;
  62. bool enable_server_custom_extension = false;
  63. bool custom_extension_skip = false;
  64. bool custom_extension_fail_add = false;
  65. bool check_close_notify = false;
  66. bool shim_shuts_down = false;
  67. bool verify_fail = false;
  68. bool verify_peer = false;
  69. bool expect_verify_result = false;
  70. int expect_total_renegotiations = 0;
  71. bool renegotiate_freely = false;
  72. bool p384_only = false;
  73. bool enable_all_curves = false;
  74. bool use_sparse_dh_prime = false;
  75. bool use_old_client_cert_callback = false;
  76. bool use_null_client_ca_list = false;
  77. bool peek_then_read = false;
  78. int max_cert_list = 0;
  79. };
  80. bool ParseConfig(int argc, char **argv, TestConfig *out_config);
  81. #endif // HEADER_TEST_CONFIG