Botan 3.6.1
Crypto and TLS for C&
Botan::TLS::Server_Hello Class Referenceabstract

#include <tls_messages.h>

Inheritance diagram for Botan::TLS::Server_Hello:
Botan::TLS::Handshake_Message Botan::TLS::Server_Hello_12 Botan::TLS::Server_Hello_13 Botan::TLS::Hello_Retry_Request

Public Member Functions

uint16_t ciphersuite () const
 
const Extensionsextensions () const
 
Server_Hellooperator= (const Server_Hello &)=delete
 
Server_Hellooperator= (Server_Hello &&) noexcept
 
virtual Protocol_Version selected_version () const =0
 
std::vector< uint8_t > serialize () const override
 
 Server_Hello (const Server_Hello &)=delete
 
 Server_Hello (Server_Hello &&) noexcept
 
const Session_IDsession_id () const
 
Handshake_Type type () const override
 
std::string type_string () const
 
virtual Handshake_Type wire_type () const
 
 ~Server_Hello () override
 

Protected Member Functions

uint8_t compression_method () const
 
std::set< Extension_Codeextension_types () const
 
Protocol_Version legacy_version () const
 
const std::vector< uint8_t > & random () const
 
 Server_Hello (std::unique_ptr< Server_Hello_Internal > data)
 

Protected Attributes

std::unique_ptr< Server_Hello_Internal > m_data
 

Detailed Description

Server Hello Message

Definition at line 274 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Server_Hello() [1/3]

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

◆ Server_Hello() [2/3]

Botan::TLS::Server_Hello::Server_Hello ( Server_Hello && )
defaultnoexcept

◆ ~Server_Hello()

Botan::TLS::Server_Hello::~Server_Hello ( )
overridedefault

◆ Server_Hello() [3/3]

Botan::TLS::Server_Hello::Server_Hello ( std::unique_ptr< Server_Hello_Internal > data)
explicitprotected

Definition at line 168 of file msg_server_hello.cpp.

168: m_data(std::move(data)) {}
std::unique_ptr< Server_Hello_Internal > m_data

Member Function Documentation

◆ ciphersuite()

uint16_t Botan::TLS::Server_Hello::ciphersuite ( ) const

Definition at line 218 of file msg_server_hello.cpp.

218 {
219 return m_data->ciphersuite();
220}

References m_data.

Referenced by Botan::TLS::Client_Hello_13::retry().

◆ compression_method()

uint8_t Botan::TLS::Server_Hello::compression_method ( ) const
protected

Definition at line 210 of file msg_server_hello.cpp.

210 {
211 return m_data->comp_method();
212}

References m_data.

Referenced by Botan::TLS::Server_Hello_13::basic_validation().

◆ extension_types()

std::set< Extension_Code > Botan::TLS::Server_Hello::extension_types ( ) const
protected

Definition at line 222 of file msg_server_hello.cpp.

222 {
223 return m_data->extensions().extension_types();
224}

References m_data.

◆ extensions()

◆ legacy_version()

Protocol_Version Botan::TLS::Server_Hello::legacy_version ( ) const
protected

Definition at line 202 of file msg_server_hello.cpp.

202 {
203 return m_data->legacy_version();
204}

References m_data.

Referenced by Botan::TLS::Server_Hello_13::basic_validation().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ random()

const std::vector< uint8_t > & Botan::TLS::Server_Hello::random ( ) const
protected

Definition at line 206 of file msg_server_hello.cpp.

206 {
207 return m_data->random();
208}

References m_data.

Referenced by serialize().

◆ selected_version()

virtual Protocol_Version Botan::TLS::Server_Hello::selected_version ( ) const
pure virtual

◆ serialize()

std::vector< uint8_t > Botan::TLS::Server_Hello::serialize ( ) const
overridevirtual
Returns
DER representation of this message

Implements Botan::TLS::Handshake_Message.

Definition at line 178 of file msg_server_hello.cpp.

178 {
179 std::vector<uint8_t> buf;
180 buf.reserve(1024); // working around GCC warning
181
182 buf.push_back(m_data->legacy_version().major_version());
183 buf.push_back(m_data->legacy_version().minor_version());
184 buf += m_data->random();
185
186 append_tls_length_value(buf, m_data->session_id().get(), 1);
187
188 buf.push_back(get_byte<0>(m_data->ciphersuite()));
189 buf.push_back(get_byte<1>(m_data->ciphersuite()));
190
191 buf.push_back(m_data->comp_method());
192
193 buf += m_data->extensions().serialize(Connection_Side::Server);
194
195 return buf;
196}
void append_tls_length_value(std::vector< uint8_t, Alloc > &buf, const T *vals, size_t vals_size, size_t tag_size)
Definition tls_reader.h:180
constexpr uint8_t get_byte(T input)
Definition loadstor.h:75

References Botan::TLS::append_tls_length_value(), Botan::get_byte(), random(), and Botan::TLS::Server.

◆ session_id()

const Session_ID & Botan::TLS::Server_Hello::session_id ( ) const

Definition at line 214 of file msg_server_hello.cpp.

214 {
215 return m_data->session_id();
216}

References m_data.

◆ type()

Handshake_Type Botan::TLS::Server_Hello::type ( ) const
overridevirtual
Returns
the message type

Implements Botan::TLS::Handshake_Message.

Definition at line 198 of file msg_server_hello.cpp.

References Botan::TLS::ServerHello.

◆ type_string()

std::string Botan::TLS::Handshake_Message::type_string ( ) const
inherited
Returns
string representation of this message type

Definition at line 19 of file tls_handshake_state.cpp.

19 {
21}
virtual Handshake_Type type() const =0
const char * handshake_type_to_string(Handshake_Type type)

References Botan::TLS::handshake_type_to_string(), and Botan::TLS::Handshake_Message::type().

◆ wire_type()

virtual Handshake_Type Botan::TLS::Handshake_Message::wire_type ( ) const
inlinevirtualinherited
Returns
the wire representation of the message's type

Reimplemented in Botan::TLS::Hello_Retry_Request.

Definition at line 39 of file tls_handshake_msg.h.

39 {
40 // Usually equal to the Handshake_Type enum value,
41 // with the exception of TLS 1.3 Hello Retry Request.
42 return type();
43 }

Referenced by Botan::TLS::Stream_Handshake_IO::send().

Member Data Documentation

◆ m_data


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