Botan 3.5.0
Crypto and TLS for C&
Botan::TLS::Key_Update Class Referencefinal

#include <tls_messages.h>

Inheritance diagram for Botan::TLS::Key_Update:
Botan::TLS::Handshake_Message

Public Member Functions

bool expects_reciprocation () const
 
 Key_Update (bool request_peer_update)
 
 Key_Update (const std::vector< uint8_t > &buf)
 
std::vector< uint8_t > serialize () const override
 
Handshake_Type type () const override
 
std::string type_string () const
 
virtual Handshake_Type wire_type () const
 

Detailed Description

Definition at line 1026 of file tls_messages.h.

Constructor & Destructor Documentation

◆ Key_Update() [1/2]

Botan::TLS::Key_Update::Key_Update ( bool request_peer_update)
explicit

Definition at line 15 of file msg_key_update.cpp.

15: m_update_requested(request_peer_update) {}

◆ Key_Update() [2/2]

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

Definition at line 17 of file msg_key_update.cpp.

17 {
18 if(buf.size() != 1) {
19 throw TLS_Exception(Alert::DecodeError, "malformed key_update");
20 }
21
22 // RFC 8446 4.6.3
23 // If an implementation receives any other value [than 0 or 1], it MUST
24 // terminate the connection with an "illegal_parameter" alert.
25 const uint8_t update_requested = buf.at(0);
26 if(update_requested > 1) {
27 throw TLS_Exception(Alert::IllegalParameter, "unexpected key_update parameter");
28 }
29
30 m_update_requested = update_requested == 1;
31}

Member Function Documentation

◆ expects_reciprocation()

bool Botan::TLS::Key_Update::expects_reciprocation ( ) const
inline

Definition at line 1035 of file tls_messages.h.

1035{ return m_update_requested; }

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

◆ serialize()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 33 of file msg_key_update.cpp.

33 {
34 return std::vector<uint8_t>(1, (m_update_requested ? 1 : 0));
35}

◆ type()

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

Implements Botan::TLS::Handshake_Message.

Definition at line 1028 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().

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


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