s2n_tls13.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /*
  2. * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. #pragma once
  16. #include "api/s2n.h"
  17. #include "tls/s2n_crypto.h"
  18. #include "utils/s2n_compiler.h"
  19. #ifdef __cplusplus
  20. extern "C" {
  21. #endif
  22. #if S2N_GCC_VERSION_AT_LEAST(4, 5, 0)
  23. S2N_API __attribute__((deprecated("The use of TLS1.3 is configured through security policies"))) int s2n_enable_tls13();
  24. #else
  25. S2N_API __attribute__((deprecated)) int s2n_enable_tls13();
  26. #endif
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. /* from RFC: https://tools.ietf.org/html/rfc8446#section-4.1.3*/
  31. extern uint8_t hello_retry_req_random[S2N_TLS_RANDOM_DATA_LEN];
  32. bool s2n_use_default_tls13_config();
  33. bool s2n_is_tls13_fully_supported();
  34. int s2n_get_highest_fully_supported_tls_version();
  35. int s2n_enable_tls13_in_test();
  36. int s2n_disable_tls13_in_test();
  37. int s2n_reset_tls13_in_test();
  38. bool s2n_is_valid_tls13_cipher(const uint8_t version[2]);
  39. S2N_RESULT s2n_connection_validate_tls13_support(struct s2n_connection *conn);
  40. bool s2n_connection_supports_tls13(struct s2n_connection *conn);
  41. bool s2n_is_middlebox_compat_enabled(struct s2n_connection *conn);
  42. bool s2n_is_hello_retry_handshake(struct s2n_connection *conn);
  43. bool s2n_is_hello_retry_message(struct s2n_connection *conn);
  44. int s2n_set_hello_retry_required(struct s2n_connection *conn);