Botan 3.0.0
Crypto and TLS for C&
|
#include <tls_extensions.h>
Public Member Functions | |
void | add (Extension *extn) |
void | add (std::unique_ptr< Extension > extn) |
const std::vector< std::unique_ptr< Extension > > & | all () const |
bool | contains_implemented_extensions_other_than (const std::set< Extension_Code > &allowed_extensions) const |
bool | contains_other_than (const std::set< Extension_Code > &allowed_extensions, const bool allow_unknown_extensions=false) const |
void | deserialize (TLS_Data_Reader &reader, const Connection_Side from, const Handshake_Type message_type) |
std::set< Extension_Code > | extension_types () const |
Extensions ()=default | |
Extensions (Extensions &&)=default | |
Extensions (TLS_Data_Reader &reader, Connection_Side side, Handshake_Type message_type) | |
template<typename T > | |
T * | get () const |
Extension * | get (Extension_Code type) const |
template<typename T > | |
bool | has () const |
bool | has (Extension_Code type) const |
Extensions & | operator= (Extensions &&)=default |
bool | remove_extension (Extension_Code type) |
std::vector< uint8_t > | serialize (Connection_Side whoami) const |
size_t | size () const |
template<typename T > | |
decltype(auto) | take () |
std::unique_ptr< Extension > | take (Extension_Code type) |
Represents a block of extensions in a hello message
Definition at line 835 of file tls_extensions.h.
|
default |
|
default |
|
inline |
Definition at line 949 of file tls_extensions.h.
|
inline |
Definition at line 869 of file tls_extensions.h.
void Botan::TLS::Extensions::add | ( | std::unique_ptr< Extension > | extn | ) |
Definition at line 103 of file tls_extensions.cpp.
References has().
Referenced by deserialize().
|
inline |
Definition at line 840 of file tls_extensions.h.
|
inline |
allowed_extensions | extension types that are allowed |
allowed_extensions
. Definition at line 903 of file tls_extensions.h.
bool Botan::TLS::Extensions::contains_other_than | ( | const std::set< Extension_Code > & | allowed_extensions, |
const bool | allow_unknown_extensions = false |
||
) | const |
allowed_extensions | extension types that are allowed |
allow_unknown_extensions | if true, ignores unrecognized extensions |
allowed_extensions
. Definition at line 148 of file tls_extensions.cpp.
References extension_types().
void Botan::TLS::Extensions::deserialize | ( | TLS_Data_Reader & | reader, |
const Connection_Side | from, | ||
const Handshake_Type | message_type | ||
) |
Definition at line 114 of file tls_extensions.cpp.
References add(), Botan::TLS::TLS_Data_Reader::get_fixed(), Botan::TLS::TLS_Data_Reader::get_uint16_t(), has(), Botan::TLS::TLS_Data_Reader::has_remaining(), and Botan::TLS::TLS_Data_Reader::remaining_bytes().
std::set< Extension_Code > Botan::TLS::Extensions::extension_types | ( | ) | const |
Definition at line 227 of file tls_extensions.cpp.
Referenced by contains_other_than().
|
inline |
Definition at line 874 of file tls_extensions.h.
|
inline |
Definition at line 852 of file tls_extensions.h.
Referenced by add(), and deserialize().
|
inline |
Definition at line 857 of file tls_extensions.h.
|
default |
|
inline |
Remove an extension from this extensions object, if it exists. Returns true if the extension existed (and thus is now removed), otherwise false (the extension wasn't set in the first place).
Note: not used internally, might be used in Callbacks::tls_modify_extensions()
Definition at line 940 of file tls_extensions.h.
std::vector< uint8_t > Botan::TLS::Extensions::serialize | ( | Connection_Side | whoami | ) | const |
Definition at line 193 of file tls_extensions.cpp.
|
inline |
Definition at line 862 of file tls_extensions.h.
|
inline |
Take the extension with the given type out of the extensions list. Returns a nullptr if the extension didn't exist.
Definition at line 913 of file tls_extensions.h.
References BOTAN_ASSERT_NOMSG, and T.
std::unique_ptr< Extension > Botan::TLS::Extensions::take | ( | Extension_Code | type | ) |
Take the extension with the given type out of the extensions list. Returns a nullptr if the extension didn't exist.
Definition at line 176 of file tls_extensions.cpp.