Botan 3.6.1
Crypto and TLS for C&
Botan::TLS::Finished_12 Class Referencefinal

#include <tls_messages.h>

Inheritance diagram for Botan::TLS::Finished_12:
Botan::TLS::Finished Botan::TLS::Handshake_Message

Public Member Functions

 Finished (const std::vector< uint8_t > &buf)
 
 Finished_12 (Handshake_IO &io, Handshake_State &state, Connection_Side side)
 
std::vector< uint8_t > serialize () const override
 
Handshake_Type type () const override
 
std::string type_string () const
 
bool verify (const Handshake_State &state, Connection_Side side) const
 
std::vector< uint8_t > verify_data () const
 
virtual Handshake_Type wire_type () const
 

Protected Member Functions

 Handshake_Message ()=default
 
 Handshake_Message (const Handshake_Message &)=delete
 
 Handshake_Message (Handshake_Message &&)=default
 

Protected Attributes

std::vector< uint8_t > m_verification_data
 

Detailed Description

Definition at line 846 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Finished_12()

Botan::TLS::Finished_12::Finished_12 ( Handshake_IO & io,
Handshake_State & state,
Connection_Side side )

Definition at line 59 of file msg_finished.cpp.

59 {
60 m_verification_data = finished_compute_verify_12(state, side);
61 state.hash().update(io.send(*this));
62}
std::vector< uint8_t > m_verification_data

References Botan::TLS::Handshake_State::hash(), Botan::TLS::Finished::m_verification_data, Botan::TLS::Handshake_IO::send(), and Botan::TLS::Handshake_Hash::update().

Member Function Documentation

◆ Finished()

Botan::TLS::Finished::Finished ( const std::vector< uint8_t > & buf)
explicit

Definition at line 833 of file msg_finished.cpp.

53: m_verification_data(buf) {}

◆ Handshake_Message() [1/3]

Botan::TLS::Handshake_Message::Handshake_Message ( )
protecteddefaultinherited

◆ Handshake_Message() [2/3]

Botan::TLS::Handshake_Message::Handshake_Message ( const Handshake_Message & )
protecteddeleteinherited

◆ Handshake_Message() [3/3]

Botan::TLS::Handshake_Message::Handshake_Message ( Handshake_Message && )
protecteddefaultinherited

◆ serialize()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 49 of file msg_finished.cpp.

49 {
51}

References Botan::TLS::Finished::m_verification_data.

◆ type()

Handshake_Type Botan::TLS::Finished::type ( ) const
inlineoverridevirtualinherited
Returns
the message type

Implements Botan::TLS::Handshake_Message.

Definition at line 835 of file tls_messages.h.

◆ 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().

◆ verify()

bool Botan::TLS::Finished_12::verify ( const Handshake_State & state,
Connection_Side side ) const

Definition at line 64 of file msg_finished.cpp.

64 {
65 std::vector<uint8_t> computed_verify = finished_compute_verify_12(state, side);
66
67#if defined(BOTAN_UNSAFE_FUZZER_MODE)
68 return true;
69#else
70 // first check the size:
71 if(m_verification_data.size() != computed_verify.size()) {
72 return false;
73 }
74
75 return CT::is_equal(m_verification_data.data(), computed_verify.data(), computed_verify.size()).as_bool();
76#endif
77}
constexpr CT::Mask< T > is_equal(const T x[], const T y[], size_t len)
Definition ct_utils.h:759

References Botan::CT::is_equal(), and Botan::TLS::Finished::m_verification_data.

◆ verify_data()

std::vector< uint8_t > Botan::TLS::Finished::verify_data ( ) const
inherited

Definition at line 55 of file msg_finished.cpp.

55 {
57}

References Botan::TLS::Finished::m_verification_data.

◆ 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_verification_data

std::vector<uint8_t> Botan::TLS::Finished::m_verification_data
protectedinherited

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