|
Botan 3.13.0
Crypto and TLS for C&
|
#include <tls_extensions.h>
Public Member Functions | |
| void | add (Extension *extn) |
| void | add (std::unique_ptr< Extension > extn) |
| 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, bool allow_unknown_extensions=false) const |
| void | deserialize (TLS_Data_Reader &reader, Connection_Side from, Handshake_Type message_type) |
| bool | empty () const |
| std::optional< std::vector< uint8_t > > | extension_raw_bytes (Extension_Code type) const |
| std::set< Extension_Code > | extension_types () const |
| Extensions ()=default | |
| Extensions (const Extensions &)=delete | |
| 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 |
| std::optional< Extension_Code > | last_added () const |
| Extensions & | operator= (const Extensions &)=delete |
| Extensions & | operator= (Extensions &&)=default |
| bool | remove_extension (Extension_Code type) |
| void | reorder (std::span< const Extension_Code > order) |
| std::vector< uint8_t > | serialize (Connection_Side whoami) const |
| size_t | size () const |
| ~Extensions () | |
Represents a block of extensions in a hello message
Definition at line 473 of file tls_extensions.h.
|
default |
Referenced by Extensions(), Extensions(), operator=(), and operator=().
|
delete |
References Extensions().
|
default |
References Extensions().
|
default |
|
inline |
Definition at line 555 of file tls_extensions.h.
References deserialize().
|
inline |
Definition at line 495 of file tls_extensions.h.
References add().
Referenced by add().
| void Botan::TLS::Extensions::add | ( | std::unique_ptr< Extension > | extn | ) |
Definition at line 157 of file tls_extensions.cpp.
References has(), and Botan::TLS::Extension::type().
|
inline |
| allowed_extensions | extension types that are allowed |
allowed_extensions. Definition at line 516 of file tls_extensions.h.
References contains_other_than().
| bool Botan::TLS::Extensions::contains_other_than | ( | const std::set< Extension_Code > & | allowed_extensions, |
| 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 196 of file tls_extensions.cpp.
References extension_types().
Referenced by contains_implemented_extensions_other_than().
| void Botan::TLS::Extensions::deserialize | ( | TLS_Data_Reader & | reader, |
| Connection_Side | from, | ||
| Handshake_Type | message_type ) |
Definition at line 167 of file tls_extensions.cpp.
References Botan::TLS::TLS_Data_Reader::get_uint16_t(), has(), Botan::TLS::TLS_Data_Reader::has_remaining(), and Botan::TLS::TLS_Data_Reader::remaining_bytes().
Referenced by Extensions().
|
inline |
Definition at line 491 of file tls_extensions.h.
|
inline |
Definition at line 564 of file tls_extensions.h.
Referenced by Botan::TLS::Client_Hello_13::validate_updates().
| std::set< Extension_Code > Botan::TLS::Extensions::extension_types | ( | ) | const |
Definition at line 274 of file tls_extensions.cpp.
Referenced by contains_other_than().
|
inline |
Definition at line 478 of file tls_extensions.h.
References get().
Referenced by Botan::TLS::Certificate_13::Certificate_13(), Botan::TLS::Certificate_13::Certificate_13(), get(), has(), Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), and Botan::TLS::Client_Hello_13::retry().
| Extension * Botan::TLS::Extensions::get | ( | Extension_Code | type | ) | const |
Definition at line 147 of file tls_extensions.cpp.
|
inline |
Definition at line 483 of file tls_extensions.h.
References get().
Referenced by add(), Botan::TLS::Certificate_13::Certificate_13(), deserialize(), Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), Botan::TLS::Client_Hello_13::retry(), and Botan::TLS::Client_Hello_13::validate_updates().
| bool Botan::TLS::Extensions::has | ( | Extension_Code | type | ) | const |
Definition at line 143 of file tls_extensions.cpp.
|
inline |
Return the code of the extension that appears last in the encoding This is used for checking the position of PSK extension in TLS 1.3
Definition at line 540 of file tls_extensions.h.
|
delete |
References Extensions().
|
default |
References Extensions().
| bool Botan::TLS::Extensions::remove_extension | ( | Extension_Code | type | ) |
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 219 of file tls_extensions.cpp.
| void Botan::TLS::Extensions::reorder | ( | std::span< const Extension_Code > | order | ) |
Reorder extensions for serialization. Extensions not mentioned in order retain their relative position at the front; extensions in order are appended in the given order.
Definition at line 286 of file tls_extensions.cpp.
| std::vector< uint8_t > Botan::TLS::Extensions::serialize | ( | Connection_Side | whoami | ) | const |
Definition at line 232 of file tls_extensions.cpp.
References BOTAN_ASSERT_NOMSG, and Botan::get_byte().
|
inline |
Definition at line 489 of file tls_extensions.h.