Botan 3.9.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 const bool /*from_peer*/) {
46 m_encrypted_extensions = std::move(encrypted_extensions);
47 return m_encrypted_extensions.value();
48}
49
51 const bool /*from_peer*/) {
52 m_certificate_request = std::move(certificate_request);
53 return m_certificate_request.value();
54}
55
57 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate : m_client_certificate;
58 target = std::move(certificate);
59 return target.value();
60}
61
63 auto& target =
64 ((m_side == Connection_Side::Client) == from_peer) ? m_server_certificate_verify : m_client_certificate_verify;
65 target = std::move(certificate_verify);
66 return target.value();
67}
68
69Finished_13& Handshake_State_13_Base::store(Finished_13 finished, const bool from_peer) {
70 auto& target = ((m_side == Connection_Side::Client) == from_peer) ? m_server_finished : m_client_finished;
71 target = std::move(finished);
72 return target.value();
75} // 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