Botan 3.13.0
Crypto and TLS for C&
Botan::TLS::Active_Connection_State_12 Class Referencefinal

#include <tls_connection_state_12.h>

Public Member Functions

 Active_Connection_State_12 (Active_Connection_State_12 &&) noexcept
 Active_Connection_State_12 (const Active_Connection_State_12 &)=delete
 Active_Connection_State_12 (const Handshake_State &state, std::string application_protocol)
 Active_Connection_State_12 (const Handshake_State &state, std::string application_protocol, std::unique_ptr< Handshake_IO > io)
const std::string & application_protocol () const
uint16_t ciphersuite_code () const
const std::vector< uint8_t > & client_finished_verify_data () const
const std::vector< uint8_t > & client_random () const
bool client_supports_secure_renegotiation () const
Datagram_Handshake_IOdtls_handshake_io ()
const secure_vector< uint8_t > & master_secret () const
Active_Connection_State_12operator= (Active_Connection_State_12 &&) noexcept
Active_Connection_State_12operator= (const Active_Connection_State_12 &)=delete
const std::vector< X509_Certificate > & peer_certs () const
const std::string & prf_algo () const
const std::optional< std::string > & psk_identity () const
const std::vector< uint8_t > & server_finished_verify_data () const
const std::vector< uint8_t > & server_random () const
bool server_supports_secure_renegotiation () const
const Session_IDsession_id () const
bool supports_extended_master_secret () const
Protocol_Version version () const
 ~Active_Connection_State_12 ()

Detailed Description

Captures the state of a completed TLS 1.2 handshake that is needed for the lifetime of an active connection.

Definition at line 30 of file tls_connection_state_12.h.

Constructor & Destructor Documentation

◆ ~Active_Connection_State_12()

Botan::TLS::Active_Connection_State_12::~Active_Connection_State_12 ( )
default

◆ Active_Connection_State_12() [1/4]

Botan::TLS::Active_Connection_State_12::Active_Connection_State_12 ( Active_Connection_State_12 && )
defaultnoexcept

◆ Active_Connection_State_12() [2/4]

Botan::TLS::Active_Connection_State_12::Active_Connection_State_12 ( const Active_Connection_State_12 & )
delete

◆ Active_Connection_State_12() [3/4]

Botan::TLS::Active_Connection_State_12::Active_Connection_State_12 ( const Handshake_State & state,
std::string application_protocol )

Definition at line 19 of file tls_connection_state_12.cpp.

19 :
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()) {}
const std::string & application_protocol() const

References Active_Connection_State_12(), application_protocol(), master_secret(), prf_algo(), psk_identity(), session_id(), supports_extended_master_secret(), and version().

◆ Active_Connection_State_12() [4/4]

Botan::TLS::Active_Connection_State_12::Active_Connection_State_12 ( const Handshake_State & state,
std::string application_protocol,
std::unique_ptr< Handshake_IO > io )

Definition at line 36 of file tls_connection_state_12.cpp.

38 :
40 BOTAN_ASSERT_NOMSG(m_version.is_datagram_protocol());
41 auto* dtls_io = dynamic_cast<Datagram_Handshake_IO*>(io.get());
42 BOTAN_ASSERT_NOMSG(dtls_io != nullptr);
43 m_dtls_handshake_io.reset(dtls_io);
44 io.release(); // NOLINT(*-unused-return-value)
45}
#define BOTAN_ASSERT_NOMSG(expr)
Definition assert.h:75
Active_Connection_State_12(Active_Connection_State_12 &&) noexcept

References Active_Connection_State_12(), application_protocol(), and BOTAN_ASSERT_NOMSG.

Member Function Documentation

◆ application_protocol()

const std::string & Botan::TLS::Active_Connection_State_12::application_protocol ( ) const
inline

Definition at line 52 of file tls_connection_state_12.h.

52{ return m_application_protocol; }

Referenced by Active_Connection_State_12(), Active_Connection_State_12(), and operator=().

◆ ciphersuite_code()

uint16_t Botan::TLS::Active_Connection_State_12::ciphersuite_code ( ) const
inline

Definition at line 50 of file tls_connection_state_12.h.

50{ return m_ciphersuite_code; }

◆ client_finished_verify_data()

const std::vector< uint8_t > & Botan::TLS::Active_Connection_State_12::client_finished_verify_data ( ) const
inline

Definition at line 72 of file tls_connection_state_12.h.

72{ return m_client_finished_verify_data; }

◆ client_random()

const std::vector< uint8_t > & Botan::TLS::Active_Connection_State_12::client_random ( ) const
inline

Definition at line 56 of file tls_connection_state_12.h.

56{ return m_client_random; }

◆ client_supports_secure_renegotiation()

bool Botan::TLS::Active_Connection_State_12::client_supports_secure_renegotiation ( ) const
inline

Definition at line 68 of file tls_connection_state_12.h.

68{ return m_client_supports_secure_renegotiation; }

◆ dtls_handshake_io()

Datagram_Handshake_IO * Botan::TLS::Active_Connection_State_12::dtls_handshake_io ( )
inline

For DTLS: the handshake IO from the completed handshake, needed to validate retransmissions and, for the terminal-flight sender, replay the final flight. Null for stream TLS.

Definition at line 83 of file tls_connection_state_12.h.

83{ return m_dtls_handshake_io.get(); }

◆ master_secret()

const secure_vector< uint8_t > & Botan::TLS::Active_Connection_State_12::master_secret ( ) const
inline

Definition at line 64 of file tls_connection_state_12.h.

64{ return m_master_secret; }

Referenced by Active_Connection_State_12().

◆ operator=() [1/2]

Active_Connection_State_12 & Botan::TLS::Active_Connection_State_12::operator= ( Active_Connection_State_12 && )
defaultnoexcept

◆ operator=() [2/2]

Active_Connection_State_12 & Botan::TLS::Active_Connection_State_12::operator= ( const Active_Connection_State_12 & )
delete

◆ peer_certs()

const std::vector< X509_Certificate > & Botan::TLS::Active_Connection_State_12::peer_certs ( ) const
inline

Definition at line 54 of file tls_connection_state_12.h.

54{ return m_peer_certs; }

◆ prf_algo()

const std::string & Botan::TLS::Active_Connection_State_12::prf_algo ( ) const
inline

Definition at line 66 of file tls_connection_state_12.h.

66{ return m_prf_algo; }

Referenced by Active_Connection_State_12().

◆ psk_identity()

const std::optional< std::string > & Botan::TLS::Active_Connection_State_12::psk_identity ( ) const
inline

Definition at line 58 of file tls_connection_state_12.h.

58{ return m_psk_identity; }

Referenced by Active_Connection_State_12().

◆ server_finished_verify_data()

const std::vector< uint8_t > & Botan::TLS::Active_Connection_State_12::server_finished_verify_data ( ) const
inline

Definition at line 74 of file tls_connection_state_12.h.

74{ return m_server_finished_verify_data; }

◆ server_random()

const std::vector< uint8_t > & Botan::TLS::Active_Connection_State_12::server_random ( ) const
inline

Definition at line 60 of file tls_connection_state_12.h.

60{ return m_server_random; }

◆ server_supports_secure_renegotiation()

bool Botan::TLS::Active_Connection_State_12::server_supports_secure_renegotiation ( ) const
inline

Definition at line 70 of file tls_connection_state_12.h.

70{ return m_server_supports_secure_renegotiation; }

◆ session_id()

const Session_ID & Botan::TLS::Active_Connection_State_12::session_id ( ) const
inline

Definition at line 62 of file tls_connection_state_12.h.

62{ return m_session_id; }

Referenced by Active_Connection_State_12().

◆ supports_extended_master_secret()

bool Botan::TLS::Active_Connection_State_12::supports_extended_master_secret ( ) const
inline

Definition at line 76 of file tls_connection_state_12.h.

76{ return m_supports_extended_master_secret; }

Referenced by Active_Connection_State_12().

◆ version()

Protocol_Version Botan::TLS::Active_Connection_State_12::version ( ) const
inline

Definition at line 48 of file tls_connection_state_12.h.

48{ return m_version; }

References version().

Referenced by Active_Connection_State_12(), and version().


The documentation for this class was generated from the following files: