Botan  2.8.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::TLS::Finished Class Referencefinal

#include <tls_messages.h>

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

Public Member Functions

 Finished (Handshake_IO &io, Handshake_State &state, Connection_Side side)
 
 Finished (const std::vector< uint8_t > &buf)
 
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
 

Detailed Description

Finished Message

Definition at line 474 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Finished() [1/2]

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

Definition at line 52 of file msg_finished.cpp.

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

54  : m_verification_data(finished_compute_verify( state, side ))
55  {
56  state.hash().update(io.send(*this));
57  }

◆ Finished() [2/2]

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

Definition at line 70 of file msg_finished.cpp.

70  : m_verification_data(buf)
71  {}

Member Function Documentation

◆ type()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 477 of file tls_messages.h.

References Botan::TLS::FINISHED.

477 { return FINISHED; }

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

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

20  {
22  }
virtual Handshake_Type type() const =0
const char * handshake_type_to_string(Handshake_Type type)

◆ verify()

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

Definition at line 76 of file msg_finished.cpp.

References Botan::constant_time_compare().

78  {
79  std::vector<byte> computed_verify = finished_compute_verify(state, side);
80 
81 #if defined(BOTAN_UNSAFE_FUZZER_MODE)
82  return true;
83 #else
84  return (m_verification_data.size() == computed_verify.size()) &&
85  constant_time_compare(m_verification_data.data(), computed_verify.data(), computed_verify.size());
86 #endif
87  }
bool constant_time_compare(const uint8_t x[], const uint8_t y[], size_t len)
Definition: mem_ops.cpp:51

◆ verify_data()

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

Definition at line 479 of file tls_messages.h.

480  { return m_verification_data; }

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