Botan 3.14.1
Crypto and TLS for C&
tls_connection_state_12.cpp
Go to the documentation of this file.
1/*
2* (C) 2026 Jack Lloyd
3*
4* Botan is released under the Simplified BSD License (see license.txt)
5*/
6
7#include <botan/internal/tls_connection_state_12.h>
8
9#include <botan/tls_messages_12.h>
10#include <botan/internal/tls_handshake_io.h>
11#include <botan/internal/tls_handshake_state.h>
12
13namespace Botan::TLS {
14
18
20 m_version(state.version()),
21 m_ciphersuite_code(state.server_hello().ciphersuite()),
22 m_application_protocol(std::move(application_protocol)),
23 m_peer_certs(state.peer_cert_chain()),
24 m_client_random(state.client_hello().random()),
25 m_psk_identity(state.psk_identity()),
26 m_server_random(state.server_hello().random()),
27 m_session_id(state.server_hello().session_id()),
28 m_master_secret(state.session_keys().master_secret()),
29 m_prf_algo(state.ciphersuite().prf_algo()),
30 m_client_supports_secure_renegotiation(state.client_hello().secure_renegotiation()),
31 m_server_supports_secure_renegotiation(state.server_hello().secure_renegotiation()),
32 m_client_finished_verify_data(state.client_finished().verify_data()),
33 m_server_finished_verify_data(state.server_finished().verify_data()),
34 m_supports_extended_master_secret(state.server_hello().supports_extended_master_secret()),
35 m_encrypt_then_mac_used(state.server_hello().supports_encrypt_then_mac()) {}
36
38 std::string application_protocol,
39 std::unique_ptr<Handshake_IO> io) :
41 BOTAN_ASSERT_NOMSG(m_version.is_datagram_protocol());
42 auto* dtls_io = dynamic_cast<Datagram_Handshake_IO*>(io.get());
43 BOTAN_ASSERT_NOMSG(dtls_io != nullptr);
44 m_dtls_handshake_io.reset(dtls_io);
45 io.release(); // NOLINT(*-unused-return-value)
46}
47
48} // namespace Botan::TLS
#define BOTAN_ASSERT_NOMSG(expr)
Definition assert.h:82
Active_Connection_State_12(Active_Connection_State_12 &&) noexcept
const std::optional< std::string > & psk_identity() const
const std::string & application_protocol() const
const secure_vector< uint8_t > & master_secret() const