test_config.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Copyright 1995-2020 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 OSSL_TEST_SHIM_TEST_CONFIG_H
  10. #define OSSL_TEST_SHIM_TEST_CONFIG_H
  11. #include <string>
  12. #include <vector>
  13. #include <openssl/configuration.h>
  14. struct TestConfig {
  15. int port = 0;
  16. bool is_server = false;
  17. bool is_dtls = false;
  18. int resume_count = 0;
  19. bool fallback_scsv = false;
  20. std::string key_file;
  21. std::string cert_file;
  22. std::string expected_server_name;
  23. std::string expected_certificate_types;
  24. bool require_any_client_certificate = false;
  25. std::string advertise_npn;
  26. std::string expected_next_proto;
  27. std::string select_next_proto;
  28. bool async = false;
  29. bool write_different_record_sizes = false;
  30. bool partial_write = false;
  31. bool no_tls13 = false;
  32. bool no_tls12 = false;
  33. bool no_tls11 = false;
  34. bool no_tls1 = false;
  35. bool no_ssl3 = false;
  36. bool shim_writes_first = false;
  37. std::string host_name;
  38. std::string advertise_alpn;
  39. std::string expected_alpn;
  40. std::string expected_advertised_alpn;
  41. std::string select_alpn;
  42. bool decline_alpn = false;
  43. bool expect_session_miss = false;
  44. bool expect_extended_master_secret = false;
  45. std::string psk;
  46. std::string psk_identity;
  47. std::string srtp_profiles;
  48. int min_version = 0;
  49. int max_version = 0;
  50. int mtu = 0;
  51. bool implicit_handshake = false;
  52. std::string cipher;
  53. bool handshake_never_done = false;
  54. int export_keying_material = 0;
  55. std::string export_label;
  56. std::string export_context;
  57. bool use_export_context = false;
  58. bool expect_ticket_renewal = false;
  59. bool expect_no_session = false;
  60. bool use_ticket_callback = false;
  61. bool renew_ticket = false;
  62. bool enable_client_custom_extension = false;
  63. bool enable_server_custom_extension = false;
  64. bool custom_extension_skip = false;
  65. bool custom_extension_fail_add = false;
  66. bool check_close_notify = false;
  67. bool shim_shuts_down = false;
  68. bool verify_fail = false;
  69. bool verify_peer = false;
  70. bool expect_verify_result = false;
  71. int expect_total_renegotiations = 0;
  72. bool renegotiate_freely = false;
  73. bool p384_only = false;
  74. bool enable_all_curves = false;
  75. bool use_sparse_dh_prime = false;
  76. bool use_old_client_cert_callback = false;
  77. bool use_null_client_ca_list = false;
  78. bool peek_then_read = false;
  79. int max_cert_list = 0;
  80. };
  81. bool ParseConfig(int argc, char **argv, TestConfig *out_config);
  82. #endif // OSSL_TEST_SHIM_TEST_CONFIG_H