Botan 3.5.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
12
14 if(m_client_hello) {
15 // Make sure that the updated Client Hello is compatible to the initial one.
17 m_client_hello->validate_updates(client_hello);
18 }
19
20 m_client_hello = std::move(client_hello);
21 return m_client_hello.value();
22}
23
25 m_client_hello_12 = std::move(client_hello);
26 return m_client_hello_12.value();
27}
28
30 m_server_hello = std::move(server_hello);
31 return m_server_hello.value();
32}
33
35 m_server_hello_12 = std::move(server_hello);
36 return m_server_hello_12.value();
37}
38
40 m_hello_retry_request = std::move(hello_retry_request);
41 return m_hello_retry_request.value();
42}
43
45 m_encrypted_extensions = std::move(encrypted_extensions);
46 return m_encrypted_extensions.value();
47}
48
50 m_certificate_request = std::move(certificate_request);
51 return m_certificate_request.value();
52}
53
55 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate : m_client_certificate;
56 target = std::move(certificate);
57 return target.value();
58}
59
61 auto& target =
62 ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate_verify : m_client_certificate_verify;
63 target = std::move(certificate_verify);
64 return target.value();
65}
66
67Finished_13& Handshake_State_13_Base::store(Finished_13 finished, const bool from_peer) {
68 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_finished : m_client_finished;
69 target = std::move(finished);
70 return target.value();
71}
72
73} // namespace Botan::TLS::Internal
#define BOTAN_STATE_CHECK(expr)
Definition assert.h:41
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