Botan 3.5.0
Crypto and TLS for C&
Botan::TLS::Channel_Impl_13::AggregatedHandshakeMessages Class Reference

#include <tls_channel_impl_13.h>

Inheritance diagram for Botan::TLS::Channel_Impl_13::AggregatedHandshakeMessages:
Botan::TLS::Channel_Impl_13::AggregatedMessages

Public Member Functions

AggregatedHandshakeMessagesadd (Handshake_Message_13_Ref message)
 
 AggregatedHandshakeMessages (Channel_Impl_13 &channel, Handshake_Layer &handshake_layer, Transcript_Hash_State &transcript_hash)
 
bool contains_messages () const
 
std::vector< uint8_t > send ()
 

Protected Attributes

Channel_Impl_13m_channel
 
Handshake_Layerm_handshake_layer
 
std::vector< uint8_t > m_message_buffer
 

Detailed Description

Aggregate conventional handshake messages. This will update the given Transcript_Hash_State accordingly as individual messages are added to the aggregation.

Definition at line 92 of file tls_channel_impl_13.h.

Constructor & Destructor Documentation

◆ AggregatedHandshakeMessages()

Botan::TLS::Channel_Impl_13::AggregatedHandshakeMessages::AggregatedHandshakeMessages ( Channel_Impl_13 & channel,
Handshake_Layer & handshake_layer,
Transcript_Hash_State & transcript_hash )

Definition at line 223 of file tls_channel_impl_13.cpp.

225 :
226 AggregatedMessages(channel, handshake_layer), m_transcript_hash(transcript_hash) {}
AggregatedMessages(Channel_Impl_13 &channel, Handshake_Layer &handshake_layer)

Member Function Documentation

◆ add()

Channel_Impl_13::AggregatedHandshakeMessages & Botan::TLS::Channel_Impl_13::AggregatedHandshakeMessages::add ( Handshake_Message_13_Ref message)

Adds a single handshake message to the send buffer. Note that this updates the handshake transcript hash regardless of sending the message.

Definition at line 228 of file tls_channel_impl_13.cpp.

229 {
230 std::visit([&](const auto msg) { m_channel.callbacks().tls_inspect_handshake_msg(msg.get()); }, message);
231 m_message_buffer += m_handshake_layer.prepare_message(message, m_transcript_hash);
232 return *this;
233}
static std::vector< uint8_t > prepare_message(Handshake_Message_13_Ref message, Transcript_Hash_State &transcript_hash)

References Botan::TLS::Channel_Impl_13::m_transcript_hash, and Botan::TLS::Handshake_Layer::prepare_message().

Referenced by Botan::TLS::Channel_Impl_13::send_handshake_message().

◆ contains_messages()

bool Botan::TLS::Channel_Impl_13::AggregatedMessages::contains_messages ( ) const
inlineinherited

◆ send()

std::vector< uint8_t > Botan::TLS::Channel_Impl_13::AggregatedMessages::send ( )
inherited

Send the messages aggregated in the message buffer. The buffer is returned if the sender needs to also handle it somehow. Most notable use: book keeping for a potential protocol downgrade in the client implementation.

Definition at line 242 of file tls_channel_impl_13.cpp.

242 {
245 return std::exchange(m_message_buffer, {});
246}
#define BOTAN_STATE_CHECK(expr)
Definition assert.h:41

References BOTAN_STATE_CHECK, and Botan::TLS::Handshake.

Referenced by Botan::TLS::Channel_Impl_13::send_handshake_message(), and Botan::TLS::Channel_Impl_13::send_post_handshake_message().

Member Data Documentation

◆ m_channel

Channel_Impl_13& Botan::TLS::Channel_Impl_13::AggregatedMessages::m_channel
protectedinherited

Definition at line 83 of file tls_channel_impl_13.h.

◆ m_handshake_layer

Handshake_Layer& Botan::TLS::Channel_Impl_13::AggregatedMessages::m_handshake_layer
protectedinherited

Definition at line 84 of file tls_channel_impl_13.h.

◆ m_message_buffer

std::vector<uint8_t> Botan::TLS::Channel_Impl_13::AggregatedMessages::m_message_buffer
protectedinherited

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