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

#include <tls_extensions.h>

Inheritance diagram for Botan::TLS::Renegotiation_Extension:
Botan::TLS::Extension

Public Member Functions

bool empty () const override
 
virtual bool is_implemented () const
 
 Renegotiation_Extension ()=default
 
 Renegotiation_Extension (const std::vector< uint8_t > &bits)
 
 Renegotiation_Extension (TLS_Data_Reader &reader, uint16_t extension_size)
 
const std::vector< uint8_t > & renegotiation_info () const
 
std::vector< uint8_t > serialize (Connection_Side whoami) const override
 
Extension_Code type () const override
 

Static Public Member Functions

static Extension_Code static_type ()
 

Detailed Description

Renegotiation Indication Extension (RFC 5746)

Definition at line 147 of file tls_extensions.h.

Constructor & Destructor Documentation

◆ Renegotiation_Extension() [1/3]

Botan::TLS::Renegotiation_Extension::Renegotiation_Extension ( )
default

◆ Renegotiation_Extension() [2/3]

Botan::TLS::Renegotiation_Extension::Renegotiation_Extension ( const std::vector< uint8_t > & bits)
inlineexplicit

Definition at line 155 of file tls_extensions.h.

155: m_reneg_data(bits) {}

◆ Renegotiation_Extension() [3/3]

Botan::TLS::Renegotiation_Extension::Renegotiation_Extension ( TLS_Data_Reader & reader,
uint16_t extension_size )

Definition at line 288 of file tls_extensions.cpp.

288 :
289 m_reneg_data(reader.get_range<uint8_t>(1, 0, 255)) {
290 if(m_reneg_data.size() + 1 != extension_size) {
291 throw Decoding_Error("Bad encoding for secure renegotiation extn");
292 }
293}

Member Function Documentation

◆ empty()

bool Botan::TLS::Renegotiation_Extension::empty ( ) const
inlineoverridevirtual
Returns
if we should encode this extension or not

Implements Botan::TLS::Extension.

Definition at line 163 of file tls_extensions.h.

163{ return false; } // always send this

◆ is_implemented()

virtual bool Botan::TLS::Extension::is_implemented ( ) const
inlinevirtualinherited
Returns
true if this extension is known and implemented by Botan

Reimplemented in Botan::TLS::Unknown_Extension.

Definition at line 116 of file tls_extensions.h.

116{ return true; }

◆ renegotiation_info()

const std::vector< uint8_t > & Botan::TLS::Renegotiation_Extension::renegotiation_info ( ) const
inline

Definition at line 159 of file tls_extensions.h.

159{ return m_reneg_data; }

◆ serialize()

std::vector< uint8_t > Botan::TLS::Renegotiation_Extension::serialize ( Connection_Side whoami) const
overridevirtual
Returns
serialized binary for the extension

Implements Botan::TLS::Extension.

Definition at line 295 of file tls_extensions.cpp.

295 {
296 std::vector<uint8_t> buf;
297 append_tls_length_value(buf, m_reneg_data, 1);
298 return buf;
299}
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

References Botan::TLS::append_tls_length_value().

◆ static_type()

static Extension_Code Botan::TLS::Renegotiation_Extension::static_type ( )
inlinestatic

Definition at line 149 of file tls_extensions.h.

◆ type()

Extension_Code Botan::TLS::Renegotiation_Extension::type ( ) const
inlineoverridevirtual
Returns
code number of the extension

Implements Botan::TLS::Extension.

Definition at line 151 of file tls_extensions.h.

151{ return static_type(); }
static Extension_Code static_type()

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