s2n_tls13_handshake.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 "crypto/s2n_tls13_keys.h"
  17. #include "tls/s2n_connection.h"
  18. #include "tls/s2n_key_update.h"
  19. #include "utils/s2n_blob.h"
  20. #include "utils/s2n_safety.h"
  21. int s2n_tls13_mac_verify(struct s2n_tls13_keys *keys, struct s2n_blob *finished_verify, struct s2n_blob *wire_verify);
  22. #define s2n_get_hash_state(hash_state, alg, conn) \
  23. struct s2n_hash_state hash_state = { 0 }; \
  24. POSIX_GUARD(s2n_handshake_get_hash_state(conn, alg, &hash_state));
  25. /* Creates a reference to tls13_keys from connection */
  26. #define s2n_tls13_connection_keys(keys, conn) \
  27. DEFER_CLEANUP(struct s2n_tls13_keys keys = { 0 }, s2n_tls13_keys_free); \
  28. POSIX_GUARD(s2n_tls13_keys_from_conn(&keys, conn));
  29. int s2n_tls13_keys_from_conn(struct s2n_tls13_keys *keys, struct s2n_connection *conn);
  30. int s2n_tls13_compute_shared_secret(struct s2n_connection *conn, struct s2n_blob *shared_secret);
  31. int s2n_update_application_traffic_keys(struct s2n_connection *conn, s2n_mode mode, keyupdate_status status);
  32. int s2n_server_hello_retry_recreate_transcript(struct s2n_connection *conn);