Botan 3.11.0
Crypto and TLS for C&
tls_handshake_state_13.cpp
Go to the documentation of this file.
1/*
2* TLS handshake state (machine) implementation for TLS 1.3
3* (C) 2022 Jack Lloyd
4* 2022 Hannes Rantzsch, René Meusel - neXenio GmbH
5*
6* Botan is released under the Simplified BSD License (see license.txt)
7*/
8
9#include <botan/internal/tls_handshake_state_13.h>
10
11#include <botan/assert.h>
12
14
16 if(m_client_hello) {
17 // Make sure that the updated Client Hello is compatible to the initial one.
19 m_client_hello->validate_updates(client_hello);
20 }
21
22 m_client_hello = std::move(client_hello);
23 return m_client_hello.value();
24}
25
27 m_client_hello_12 = std::move(client_hello);
28 return m_client_hello_12.value();
29}
30
32 m_server_hello = std::move(server_hello);
33 return m_server_hello.value();
34}
35
37 m_server_hello_12 = std::move(server_hello);
38 return m_server_hello_12.value();
39}
40
42 m_hello_retry_request = std::move(hello_retry_request);
43 return m_hello_retry_request.value();
44}
45
47 const bool /*from_peer*/) {
48 m_encrypted_extensions = std::move(encrypted_extensions);
49 return m_encrypted_extensions.value();
50}
51
53 const bool /*from_peer*/) {
54 m_certificate_request = std::move(certificate_request);
55 return m_certificate_request.value();
56}
57
59 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate : m_client_certificate;
60 target = std::move(certificate);
61 return target.value();
62}
63
65 auto& target =
66 ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate_verify : m_client_certificate_verify;
67 target = std::move(certificate_verify);
68 return target.value();
69}
71Finished_13& Handshake_State_13_Base::store(Finished_13 finished, const bool from_peer) {
72 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_finished : m_client_finished;
73 target = std::move(finished);
74 return target.value();
77} // namespace Botan::TLS::Internal
#define BOTAN_STATE_CHECK(expr)
Definition assert.h:49
Client_Hello_13 & store(Client_Hello_13 client_hello, bool from_peer)
const Hello_Retry_Request & hello_retry_request() const
const Certificate_Request_13 & certificate_request() const
const Encrypted_Extensions & encrypted_extensions() const