Botan  2.7.0
Crypto and TLS for C++11
Public Member Functions | Static Public Member Functions | List of all members
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
 
 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 () const override
 
Handshake_Extension_Type type () const override
 

Static Public Member Functions

static Handshake_Extension_Type static_type ()
 

Detailed Description

Renegotiation Indication Extension (RFC 5746)

Definition at line 128 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 138 of file tls_extensions.h.

138  :
139  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 228 of file tls_extensions.cpp.

229  : m_reneg_data(reader.get_range<uint8_t>(1, 0, 255))
230  {
231  if(m_reneg_data.size() + 1 != extension_size)
232  throw Decoding_Error("Bad encoding for secure renegotiation extn");
233  }

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 149 of file tls_extensions.h.

149 { return false; } // always send this

◆ renegotiation_info()

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

Definition at line 144 of file tls_extensions.h.

145  { return m_reneg_data; }

◆ serialize()

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

Implements Botan::TLS::Extension.

Definition at line 235 of file tls_extensions.cpp.

References Botan::TLS::append_tls_length_value().

236  {
237  std::vector<uint8_t> buf;
238  append_tls_length_value(buf, m_reneg_data, 1);
239  return buf;
240  }
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:185

◆ static_type()

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

◆ type()

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

Implements Botan::TLS::Extension.

Definition at line 134 of file tls_extensions.h.

References static_type().

134 { return static_type(); }
static Handshake_Extension_Type static_type()

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