Botan 3.2.0
Crypto and TLS for C&
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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 811 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 58 of file msg_finished.cpp.

58 {
59 m_verification_data = finished_compute_verify_12(state, side);
60 state.hash().update(io.send(*this));
61}
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 798 of file msg_finished.cpp.

52: 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 48 of file msg_finished.cpp.

48 {
50}

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 800 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 63 of file msg_finished.cpp.

63 {
64 std::vector<uint8_t> computed_verify = finished_compute_verify_12(state, side);
65
66#if defined(BOTAN_UNSAFE_FUZZER_MODE)
67 return true;
68#else
69 return (m_verification_data.size() == computed_verify.size()) &&
70 constant_time_compare(m_verification_data.data(), computed_verify.data(), computed_verify.size());
71#endif
72}
bool constant_time_compare(const uint8_t x[], const uint8_t y[], size_t len)
Definition mem_ops.h:80

References Botan::constant_time_compare(), and Botan::TLS::Finished::m_verification_data.

◆ verify_data()

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

Definition at line 54 of file msg_finished.cpp.

54 {
56}

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

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: