|
Botan 3.14.1
Crypto and TLS for C&
|
Namespaces | |
| namespace | detail |
| namespace | Internal |
Typedefs | |
| using | BytesNeeded = size_t |
| using | Client_Handshake_13_Message |
| using | Client_Handshake_13_Message_Ref = detail::as_wrapped_references_t<Client_Handshake_13_Message> |
| using | Client_Handshake_State_13 |
| using | Client_Post_Handshake_13_Message = std::variant<Key_Update> |
| typedef Policy | Default_Policy |
| typedef std::function< std::shared_ptr< Connection_Cipher_State >(uint16_t)> | get_cipherstate_fn |
| using | Handshake_Message_13 |
| using | Handshake_Message_13_Ref = detail::as_wrapped_references_t<Handshake_Message_13> |
| using | HandshakeProtocolHeader = Strong<std::array<uint8_t, 4>, struct HandshakeProtocolHeader_> |
| Holds the serialization of a TLS 1.3 handshake protocol header. | |
| using | MarshalledHandshakeMessageFlight = Strong<std::vector<uint8_t>, struct MarshalledHandshakeMessageFlight_> |
| using | Named_Group = Group_Params |
| using | Opaque_Session_Handle = Strong<std::vector<uint8_t>, struct Opaque_Session_Handle_> |
| holds an opaque session handle as used in TLS 1.3 that could be either a ticket for stateless resumption or a database handle. | |
| using | Post_Handshake_Message_13 = std::variant<New_Session_Ticket_13, Key_Update> |
| using | PresharedKeyID = Strong<std::string, struct PresharedKeyID_> |
| holds a PSK identity as used in TLS 1.3 | |
| using | Record = std::variant<ChangeCipherSpec_Record, Alert_Record, Handshake_Record, ApplicationData_Record> |
| using | SecretLoggerFn = std::function<void(std::string_view label, std::span<const uint8_t> secret)> |
| using | SerializedHandshakeMessage = Strong<std::vector<uint8_t>, struct SerializedHandshakeMessage_> |
| using | Server_Handshake_13_Message |
| using | Server_Handshake_13_Message_Ref = detail::as_wrapped_references_t<Server_Handshake_13_Message> |
| using | Server_Handshake_State_13 |
| using | Server_Post_Handshake_13_Message = std::variant<New_Session_Ticket_13, Key_Update> |
| using | Session_ID = Strong<std::vector<uint8_t>, struct Session_ID_> |
| holds a TLS 1.2 session ID for stateful resumption | |
| using | Session_Ticket = Strong<std::vector<uint8_t>, struct Session_Ticket_> |
| holds a TLS 1.2 session ticket for stateless resumption | |
| typedef PskIdentity | Ticket |
| using | Ticket_Nonce = Strong<std::vector<uint8_t>, struct Ticket_Nonce_> |
| Used to derive the ticket's PSK from the resumption_master_secret. | |
| using | Transcript_Hash = std::vector<uint8_t> |
Functions | |
| Record | annotate_record_type (Record_Content &&record) |
| template<typename T, typename Alloc, typename Alloc2> | |
| void | append_tls_length_value (std::vector< uint8_t, Alloc > &buf, const std::vector< T, Alloc2 > &vals, size_t tag_size) |
| template<typename T, typename Alloc> | |
| void | append_tls_length_value (std::vector< uint8_t, Alloc > &buf, const T *vals, size_t vals_size, size_t tag_size) |
| template<typename T, typename Alloc> | |
| void | append_tls_length_value (std::vector< uint8_t, Alloc > &buf, std::span< const T > vals, size_t tag_size) |
| template<typename Alloc> | |
| void | append_tls_length_value (std::vector< uint8_t, Alloc > &buf, std::string_view str, size_t tag_size) |
| TLS_Cipher_State * | as_tls_cipher_state (Cipher_State *cs) |
| Auth_Method | auth_method_from_string (std::string_view str) |
| std::string | auth_method_to_string (Auth_Method method) |
| std::vector< uint8_t > | calculate_cookie (std::span< const uint8_t > client_hello_bits, std::string_view client_identity, std::span< const uint8_t > cookie_secret) |
| Certificate_Type | certificate_type_from_string (const std::string &type_str) |
| std::string | certificate_type_to_string (Certificate_Type type) |
| uint16_t | check_tls_cbc_padding (const uint8_t record[], size_t record_len) |
| std::vector< std::string > | filter_signature_schemes (const std::vector< Signature_Scheme > &schemes, const Protocol_Version &version) |
| bool | group_may_be_ecc (Group_Params group) |
| bool | group_usable_in_version (Group_Params group, Protocol_Version version) |
| std::vector< Group_Params > | groups_usable_in_version (std::span< const Group_Params > groups, Protocol_Version version) |
| const char * | handshake_type_to_string (Handshake_Type type) |
| std::string | kdf_algo_to_string (KDF_Algo algo) |
| Kex_Algo | kex_method_from_string (std::string_view str) |
| std::string | kex_method_to_string (Kex_Algo method) |
| bool | key_exchange_is_psk (Kex_Algo m) |
| std::unique_ptr< Extension > | make_certificate_status_request (TLS_Data_Reader &reader, uint16_t extension_size, Handshake_Type message_type, Connection_Side from) |
| std::vector< uint8_t > | make_hello_random (RandomNumberGenerator &rng, Callbacks &cb, const Policy &policy) |
| std::vector< uint8_t > | make_server_hello_random (RandomNumberGenerator &rng, Protocol_Version offered_version, Callbacks &cb, const Policy &policy, TLS_Flavor flavor) |
| bool | operator!= (const Server_Information &a, const Server_Information &b) |
| bool | operator< (const Server_Information &a, const Server_Information &b) |
| auto | operator< (const Session_ID &id1, const Session_ID &id2) |
| bool | operator== (const Server_Information &a, const Server_Information &b) |
| Record_Header | read_record (TLS_Flavor flavor, secure_vector< uint8_t > &readbuf, const uint8_t input[], size_t input_len, size_t &consumed, secure_vector< uint8_t > &recbuf, Connection_Sequence_Numbers *sequence_numbers, const get_cipherstate_fn &get_cipherstate, bool allow_epoch0_restart) |
| std::vector< AlgorithmIdentifier > | to_algorithm_identifiers (const std::vector< Signature_Scheme > &schemes) |
| void | write_record (secure_vector< uint8_t > &output, Record_Type record_type, Protocol_Version version, uint64_t record_sequence, const uint8_t *message, size_t message_len, Connection_Cipher_State &cs, RandomNumberGenerator &rng) |
| void | write_unencrypted_record (secure_vector< uint8_t > &output, Record_Type record_type, Protocol_Version version, uint64_t record_sequence, const uint8_t *message, size_t message_len) |
Variables | |
| constexpr uint64_t | DOWNGRADE_TLS11 = 0x444F574E47524400 |
| constexpr uint64_t | DOWNGRADE_TLS12 = 0x444F574E47524401 |
| constexpr std::array< uint8_t, 32 > | HELLO_RETRY_REQUEST_MARKER |
Cipher_State state machine adapted from RFC 8446 7.1.
0
|
v
PSK -> HKDF-Extract = Early Secret
|
+-----> Derive-Secret(., "ext binder" | "res binder" | "imp binder", "")
| = binder_key
STATE PSK BINDER
This state is reached by constructing the Cipher_State using init_with_psk(). The state can then be further advanced using advance_with_client_hello() once the initial Client Hello is fully generated. | +-----> Derive-Secret(., "c e traffic", ClientHello) | = client_early_traffic_secret | +-----> Derive-Secret(., "e exp master", ClientHello) | = early_exporter_master_secret v Derive-Secret(., "derived", "") |
TLS 1.3 Preshared Key identity and importer (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity 2023 Fabian Albert, René Meusel - Rohde & Schwarz Cybersecurity 2025,2026 Jack Lloyd
Botan is released under the Simplified BSD License (see license.txt)
Wrapper type for a TLS 1.3 session ticket (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS 1.3 Strong Type Wrappers (C) 2026 Jack Lloyd 2026 Amos Treiber, René Meusel - Rohde & Schwarz Networks and Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
Composite key pair that exposes the Public/Private key API but combines multiple key agreement schemes into a hybrid algorithm.
(C) 2023 Jack Lloyd 2023 Fabian Albert, René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS Session Manger base class implementations (C) 2011-2023 Jack Lloyd 2022-2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
Hybrid Session Manager that emits both IDs and Tickets (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS Session Management (C) 2011,2012 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
TLS Stateless Session Manager for stateless servers (C) 2023 Jack Lloyd 2023 René Meusel - Rohde & Schwarz Cybersecurity
Botan is released under the Simplified BSD License (see license.txt)
| using Botan::TLS::BytesNeeded = size_t |
Definition at line 18 of file tls_types_13.h.
Definition at line 479 of file tls_messages_13.h.
| using Botan::TLS::Client_Handshake_13_Message_Ref = detail::as_wrapped_references_t<Client_Handshake_13_Message> |
Definition at line 485 of file tls_messages_13.h.
Definition at line 201 of file tls_handshake_state_13.h.
| using Botan::TLS::Client_Post_Handshake_13_Message = std::variant<Key_Update> |
Definition at line 467 of file tls_messages_13.h.
| typedef Policy Botan::TLS::Default_Policy |
Definition at line 724 of file tls_policy.h.
| typedef std::function<std::shared_ptr<Connection_Cipher_State>(uint16_t)> Botan::TLS::get_cipherstate_fn |
Definition at line 180 of file tls_record.h.
Definition at line 448 of file tls_messages_13.h.
Definition at line 459 of file tls_messages_13.h.
| using Botan::TLS::HandshakeProtocolHeader = Strong<std::array<uint8_t, 4>, struct HandshakeProtocolHeader_> |
Holds the serialization of a TLS 1.3 handshake protocol header.
Definition at line 27 of file tls_types_13.h.
| using Botan::TLS::MarshalledHandshakeMessageFlight = Strong<std::vector<uint8_t>, struct MarshalledHandshakeMessageFlight_> |
Holds the serialization of a TLS 1.3 handshake message flight containing multiple handshake messages along with their handshake protocol headers.
Definition at line 31 of file tls_types_13.h.
| using Botan::TLS::Named_Group = Group_Params |
Definition at line 432 of file tls_extensions.h.
| using Botan::TLS::Opaque_Session_Handle = Strong<std::vector<uint8_t>, struct Opaque_Session_Handle_> |
holds an opaque session handle as used in TLS 1.3 that could be either a ticket for stateless resumption or a database handle.
Definition at line 29 of file tls_session_id.h.
| using Botan::TLS::Post_Handshake_Message_13 = std::variant<New_Session_Ticket_13, Key_Update> |
Definition at line 461 of file tls_messages_13.h.
| using Botan::TLS::PresharedKeyID = Strong<std::string, struct PresharedKeyID_> |
holds a PSK identity as used in TLS 1.3
Definition at line 28 of file tls_psk_13.h.
| using Botan::TLS::Record = std::variant<ChangeCipherSpec_Record, Alert_Record, Handshake_Record, ApplicationData_Record> |
Definition at line 40 of file tls_record_13.h.
| using Botan::TLS::SecretLoggerFn = std::function<void(std::string_view label, std::span<const uint8_t> secret)> |
Definition at line 20 of file tls_types_13.h.
| using Botan::TLS::SerializedHandshakeMessage = Strong<std::vector<uint8_t>, struct SerializedHandshakeMessage_> |
Holds the serialization of a single TLS 1.3 handshake message without the handshake protocol header.
Definition at line 24 of file tls_types_13.h.
Definition at line 469 of file tls_messages_13.h.
| using Botan::TLS::Server_Handshake_13_Message_Ref = detail::as_wrapped_references_t<Server_Handshake_13_Message> |
Definition at line 477 of file tls_messages_13.h.
Definition at line 206 of file tls_handshake_state_13.h.
| using Botan::TLS::Server_Post_Handshake_13_Message = std::variant<New_Session_Ticket_13, Key_Update> |
Definition at line 466 of file tls_messages_13.h.
| using Botan::TLS::Session_ID = Strong<std::vector<uint8_t>, struct Session_ID_> |
holds a TLS 1.2 session ID for stateful resumption
Definition at line 22 of file tls_session_id.h.
| using Botan::TLS::Session_Ticket = Strong<std::vector<uint8_t>, struct Session_Ticket_> |
holds a TLS 1.2 session ticket for stateless resumption
Definition at line 25 of file tls_session_id.h.
| typedef PskIdentity Botan::TLS::Ticket |
Botan 3.0.0 used the class name "Ticket". In Botan 3.1.0 we decided to re-name it to the more generic term "PskIdentity" to better reflect its dual use case for resumption and externally provided PSKs.
Definition at line 77 of file tls_psk_13.h.
| using Botan::TLS::Ticket_Nonce = Strong<std::vector<uint8_t>, struct Ticket_Nonce_> |
Used to derive the ticket's PSK from the resumption_master_secret.
Definition at line 108 of file tls_magic.h.
| using Botan::TLS::Transcript_Hash = std::vector<uint8_t> |
Definition at line 105 of file tls_magic.h.
|
strong |
Type codes for TLS alerts
The enumeration value matches the wire encoding
Definition at line 21 of file tls_alert.h.
|
strong |
| Enumerator | |
|---|---|
| RSA | |
| ECDSA | |
| UNDEFINED | |
| IMPLICIT | |
Definition at line 63 of file tls_algos.h.
|
strong |
|
strong |
Definition at line 18 of file tls_algos.h.
|
strong |
| Enumerator | |
|---|---|
| Client | |
| Server | |
| CLIENT | |
| SERVER | |
Definition at line 50 of file tls_magic.h.
|
strong |
Definition at line 39 of file tls_extensions.h.
|
strong |
Definition at line 80 of file tls_algos.h.
|
strong |
Definition at line 74 of file tls_magic.h.
|
strong |
| Enumerator | |
|---|---|
| SHA_1 | |
| SHA_256 | |
| SHA_384 | |
Definition at line 46 of file tls_algos.h.
|
strong |
| Enumerator | |
|---|---|
| STATIC_RSA | |
| DH | |
| ECDH | |
| PSK | |
| ECDHE_PSK | |
| DHE_PSK | |
| KEM | |
| KEM_PSK | |
| HYBRID | |
| HYBRID_PSK | |
| UNDEFINED | |
Definition at line 265 of file tls_algos.h.
|
strong |
| Enumerator | |
|---|---|
| CBC_MODE | |
| AEAD_IMPLICIT_4 | |
| AEAD_XOR_12 | |
| NULL_CIPHER | |
Definition at line 54 of file tls_algos.h.
|
strong |
|
strong |
| Enumerator | |
|---|---|
| Invalid | |
| ChangeCipherSpec | |
| Alert | |
| Handshake | |
| ApplicationData | |
| Heartbeat | |
Definition at line 58 of file tls_magic.h.
| enum Botan::TLS::Size_Limits : size_t |
Protocol Constants for SSL/TLS
TODO(Botan4): this should not be an enum at all
| Enumerator | |
|---|---|
| TLS_HEADER_SIZE | |
| DTLS_HEADER_SIZE | |
| TLS_HANDSHAKE_HEADER_LENGTH | |
| MAX_PLAINTEXT_SIZE | |
| MAX_COMPRESSED_SIZE | |
| MAX_CIPHERTEXT_SIZE | |
| MAX_AEAD_EXPANSION_SIZE_TLS13 | |
| MAX_CIPHERTEXT_SIZE_TLS13 | |
Definition at line 29 of file tls_magic.h.
|
strong |
|
strong |
Definition at line 18 of file tls_version.h.
| Record Botan::TLS::annotate_record_type | ( | Record_Content && | record | ) |
Takes a generic record and transforms it into one of the strong typed record variants based on the contained type.
| TLS_Exception | if the record type is any other value. |
Definition at line 20 of file tls_record_13.cpp.
References Alert, ApplicationData, ChangeCipherSpec, Handshake, Heartbeat, and Invalid.
Referenced by Botan::TLS::TLS_Cipher_State::deprotect_record(), and Botan::TLS::TLS_Record_Layer::next_record().
|
inline |
Definition at line 212 of file tls_reader.h.
References append_tls_length_value().
|
inline |
Helper function for encoding length-tagged vectors
Definition at line 182 of file tls_reader.h.
References BOTAN_ARG_CHECK, and Botan::get_byte_var().
Referenced by append_tls_length_value(), append_tls_length_value(), append_tls_length_value(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), Botan::TLS::Certificate_12::serialize(), Botan::TLS::Certificate_13::serialize(), Botan::TLS::Certificate_Authorities::serialize(), Botan::TLS::Certificate_Request_12::serialize(), Botan::TLS::Certificate_Request_13::serialize(), Botan::TLS::Certificate_Type_Base::serialize(), Botan::TLS::Client_Hello::serialize(), Botan::TLS::Cookie::serialize(), Botan::TLS::Hello_Verify_Request::serialize(), Botan::TLS::New_Session_Ticket_12::serialize(), Botan::TLS::New_Session_Ticket_13::serialize(), Botan::TLS::PSK::serialize(), Botan::TLS::Renegotiation_Extension::serialize(), Botan::TLS::Server_Hello::serialize(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
|
inline |
Definition at line 207 of file tls_reader.h.
References append_tls_length_value().
|
inline |
Definition at line 219 of file tls_reader.h.
References append_tls_length_value(), and Botan::as_span_of_bytes().
|
inline |
Definition at line 499 of file tls_cipher_state.h.
References BOTAN_ASSERT_IMPLICATION.
Referenced by Botan::TLS::TLS_Record_Layer::next_record(), and Botan::TLS::TLS_Record_Layer::prepare_record().
| Auth_Method BOTAN_TEST_API Botan::TLS::auth_method_from_string | ( | std::string_view | str | ) |
Definition at line 125 of file tls_algos.cpp.
References ECDSA, Botan::fmt(), IMPLICIT, RSA, and UNDEFINED.
| std::string BOTAN_TEST_API Botan::TLS::auth_method_to_string | ( | Auth_Method | method | ) |
Definition at line 110 of file tls_algos.cpp.
References ECDSA, IMPLICIT, RSA, and UNDEFINED.
Referenced by Botan::TLS::Ciphersuite::sig_algo().
| std::vector< uint8_t > Botan::TLS::calculate_cookie | ( | std::span< const uint8_t > | client_hello_bits, |
| std::string_view | client_identity, | ||
| std::span< const uint8_t > | cookie_secret ) |
Compute a cookie value from the ClientHello and the client's identity. Used by both the DTLS 1.2 HelloVerifyRequest and the DTLS 1.3 HelloRetryRequest cookie extension.
Note: Currently, Botan does not support proper stateless handling of HelloVerifyRequest/HelloRetryRequest messages using Cookies.
Definition at line 47 of file msg_client_hello.cpp.
References Botan::MessageAuthenticationCode::create_or_throw().
Referenced by Botan::TLS::Hello_Verify_Request::Hello_Verify_Request().
| Certificate_Type Botan::TLS::certificate_type_from_string | ( | const std::string & | type_str | ) |
Definition at line 536 of file tls_algos.cpp.
References RawPublicKey, and X509.
Referenced by Botan::TLS::Text_Policy::read_cert_type_list().
| std::string Botan::TLS::certificate_type_to_string | ( | Certificate_Type | type | ) |
Definition at line 525 of file tls_algos.cpp.
References RawPublicKey, and X509.
Referenced by Botan::TLS::Certificate_Type_Base::validate_selection().
| BOTAN_TEST_API uint16_t Botan::TLS::check_tls_cbc_padding | ( | const uint8_t | record[], |
| size_t | record_len ) |
Check the TLS padding of a record
| record | the record bits |
| record_len | length of record |
Definition at line 264 of file tls_cbc.cpp.
References Botan::CT::Mask< T >::is_equal(), Botan::CT::Mask< T >::is_lt(), and Botan::CT::Mask< T >::is_lte().
| std::vector< std::string > Botan::TLS::filter_signature_schemes | ( | const std::vector< Signature_Scheme > & | schemes, |
| const Protocol_Version & | version ) |
Reduce schemes to the distinct certificate key-algorithm names (e.g. "RSA", "ECDSA") that are usable under version, preserving the order in which they first appear. Schemes that are unavailable in this build, or not compatible with version, are skipped. Used to narrow certificate selection to the key types the peer's signature_algorithms permits.
Definition at line 474 of file tls_signature_scheme.cpp.
References Botan::value_exists().
Referenced by Botan::TLS::Certificate_13::Certificate_13(), and Botan::TLS::Certificate_13::Certificate_13().
| bool Botan::TLS::group_may_be_ecc | ( | Group_Params | group | ) |
Return true if group is an elliptic curve group, or an unknown group outside the FFDHE range which the application may implement as a curve via the callbacks
Definition at line 256 of file tls_algos.cpp.
References Botan::TLS::Group_Params::is_in_ffdhe_range(), Botan::TLS::Group_Params::is_pure_ecc_group(), and Botan::TLS::Group_Params::to_string().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::TLS::Supported_Groups::ec_groups().
| bool Botan::TLS::group_usable_in_version | ( | Group_Params | group, |
| Protocol_Version | version ) |
The Brainpool group code points of RFC 7027 are only defined up to TLS 1.2, those of RFC 8734 and all KEM groups only for TLS 1.3.
Definition at line 233 of file tls_algos.cpp.
References Botan::TLS::Group_Params::is_kem(), and Botan::TLS::Protocol_Version::is_pre_tls_13().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), groups_usable_in_version(), and Botan::TLS::Key_Share::retry_offer().
| std::vector< Group_Params > Botan::TLS::groups_usable_in_version | ( | std::span< const Group_Params > | groups, |
| Protocol_Version | version ) |
Filter groups by group_usable_in_version()
Definition at line 246 of file tls_algos.cpp.
References group_usable_in_version().
Referenced by Botan::TLS::Client_Hello_13::Client_Hello_13(), Botan::TLS::Server_Hello_13::create(), Botan::TLS::Encrypted_Extensions::Encrypted_Extensions(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
| BOTAN_TEST_API const char * Botan::TLS::handshake_type_to_string | ( | Handshake_Type | type | ) |
Definition at line 15 of file tls_magic.cpp.
References Certificate, CertificateRequest, CertificateStatus, CertificateUrl, CertificateVerify, ClientHello, ClientKeyExchange, EncryptedExtensions, EndOfEarlyData, Finished, HandshakeCCS, HelloRequest, HelloRetryRequest, HelloVerifyRequest, KeyUpdate, MessageHash, NewSessionTicket, None, ServerHello, ServerHelloDone, and ServerKeyExchange.
Referenced by Botan::TLS::Handshake_Transitions::confirm_transition_to(), Botan::TLS::Key_Share::Key_Share(), and Botan::TLS::Handshake_Message::type_string().
Definition at line 20 of file tls_algos.cpp.
References SHA_1, SHA_256, and SHA_384.
Referenced by Botan::TLS::Ciphersuite::prf_algo().
| Kex_Algo BOTAN_TEST_API Botan::TLS::kex_method_from_string | ( | std::string_view | str | ) |
Definition at line 62 of file tls_algos.cpp.
References DH, DHE_PSK, ECDH, ECDHE_PSK, Botan::fmt(), HYBRID, HYBRID_PSK, KEM, KEM_PSK, PSK, STATIC_RSA, and UNDEFINED.
| std::string BOTAN_TEST_API Botan::TLS::kex_method_to_string | ( | Kex_Algo | method | ) |
Definition at line 33 of file tls_algos.cpp.
References DH, DHE_PSK, ECDH, ECDHE_PSK, HYBRID, HYBRID_PSK, KEM, KEM_PSK, PSK, STATIC_RSA, and UNDEFINED.
Referenced by Botan::TLS::Ciphersuite::kex_algo(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
|
inline |
Definition at line 284 of file tls_algos.h.
References DHE_PSK, ECDHE_PSK, and PSK.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
| std::unique_ptr< Extension > Botan::TLS::make_certificate_status_request | ( | TLS_Data_Reader & | reader, |
| uint16_t | extension_size, | ||
| Handshake_Type | message_type, | ||
| Connection_Side | from ) |
Parse a "status_request" extension. In a ClientHello, a request for any status_type other than "ocsp" is not supported and is treated as an unknown extension.
Definition at line 161 of file tls_extensions_cert_status_req.cpp.
References ClientHello, Botan::TLS::TLS_Data_Reader::peek_byte(), and Botan::TLS::Certificate_Status_Request::static_type().
| std::vector< uint8_t > Botan::TLS::make_hello_random | ( | RandomNumberGenerator & | rng, |
| Callbacks & | cb, | ||
| const Policy & | policy ) |
Generate a (client) hello random value.
Depending on the policy, the RNG output may be hashed and if TLS 1.2 is offered, the random value may contain a timestamp.
Definition at line 26 of file msg_client_hello.cpp.
References Botan::TLS::Policy::allow_dtls12(), Botan::TLS::Policy::allow_tls12(), Botan::HashFunction::create_or_throw(), Botan::TLS::Policy::hash_hello_random(), Botan::TLS::Policy::include_time_in_hello_random(), Botan::RandomNumberGenerator::random_vec(), Botan::store_be(), and Botan::TLS::Callbacks::tls_current_timestamp().
Referenced by Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Client_Hello_12::Client_Hello_12(), Botan::TLS::Client_Hello_13::Client_Hello_13(), and make_server_hello_random().
| std::vector< uint8_t > Botan::TLS::make_server_hello_random | ( | RandomNumberGenerator & | rng, |
| Protocol_Version | offered_version, | ||
| Callbacks & | cb, | ||
| const Policy & | policy, | ||
| TLS_Flavor | flavor ) |
Generate a server hello random value for the given protocol version.
Depending on the protocol version, the random value is generated differently. For instance, TLS 1.2 requested a timestamp in the random value. Also, when downgrading to TLS 1.2 from a peer that could also negotiate TLS 1.3, the random value must be slightly modified to signal the downgrade.
Definition at line 24 of file msg_server_hello.cpp.
References Botan::TLS::Policy::allow_tls13(), BOTAN_ASSERT_NOMSG, DOWNGRADE_TLS12, Botan::TLS::Protocol_Version::is_pre_tls_13(), make_hello_random(), Botan::store_be(), and TLS.
Referenced by Botan::TLS::Server_Hello_12::Server_Hello_12(), Botan::TLS::Server_Hello_12::Server_Hello_12(), and Botan::TLS::Server_Hello_13::Server_Hello_13().
|
inline |
Definition at line 75 of file tls_server_info.h.
|
inline |
Definition at line 79 of file tls_server_info.h.
References Botan::TLS::Server_Information::hostname(), Botan::TLS::Server_Information::port(), and Botan::TLS::Server_Information::service().
|
inline |
Definition at line 31 of file tls_session_id.h.
References Botan::detail::Strong_Base< T >::get().
|
inline |
Definition at line 71 of file tls_server_info.h.
References Botan::TLS::Server_Information::hostname(), Botan::TLS::Server_Information::port(), and Botan::TLS::Server_Information::service().
| Record_Header Botan::TLS::read_record | ( | TLS_Flavor | flavor, |
| secure_vector< uint8_t > & | read_buffer, | ||
| const uint8_t | input[], | ||
| size_t | input_len, | ||
| size_t & | consumed, | ||
| secure_vector< uint8_t > & | record_buf, | ||
| Connection_Sequence_Numbers * | sequence_numbers, | ||
| const get_cipherstate_fn & | get_cipherstate, | ||
| bool | allow_epoch0_restart ) |
Decode a TLS record
Definition at line 521 of file tls_record.cpp.
References DTLS.
Referenced by Botan::TLS::Channel_Impl_12::from_peer().
| std::vector< AlgorithmIdentifier > Botan::TLS::to_algorithm_identifiers | ( | const std::vector< Signature_Scheme > & | schemes | ) |
Definition at line 465 of file tls_signature_scheme.cpp.
Referenced by Botan::TLS::Certificate_13::Certificate_13(), and Botan::TLS::Certificate_13::Certificate_13().
| void Botan::TLS::write_record | ( | secure_vector< uint8_t > & | write_buffer, |
| Record_Type | record_type, | ||
| Protocol_Version | record_version, | ||
| uint64_t | record_sequence, | ||
| const uint8_t * | message, | ||
| size_t | message_len, | ||
| Connection_Cipher_State & | cipherstate, | ||
| RandomNumberGenerator & | rng ) |
Create a TLS record
| write_buffer | the output record is placed here |
| record_type | the record layer type |
| record_version | the record layer version |
| record_sequence | the record layer sequence number |
| message | the record contents |
| message_len | is size of message |
| cipherstate | is the writing cipher state |
| Random Number Generators | is a random number generator |
Definition at line 220 of file tls_record.cpp.
References Botan::TLS::Connection_Cipher_State::aead(), Botan::TLS::Connection_Cipher_State::aead_nonce(), BOTAN_ASSERT, CBC_MODE, Botan::Cipher_Mode::finish(), Botan::TLS::Connection_Cipher_State::format_ad(), MAX_CIPHERTEXT_SIZE, Botan::TLS::Connection_Cipher_State::nonce_bytes_from_handshake(), Botan::TLS::Connection_Cipher_State::nonce_bytes_from_record(), Botan::TLS::Connection_Cipher_State::nonce_format(), Botan::Cipher_Mode::output_length(), Botan::AEAD_Mode::set_associated_data(), and Botan::Cipher_Mode::start().
| void Botan::TLS::write_unencrypted_record | ( | secure_vector< uint8_t > & | write_buffer, |
| Record_Type | record_type, | ||
| Protocol_Version | record_version, | ||
| uint64_t | record_sequence, | ||
| const uint8_t * | message, | ||
| size_t | message_len ) |
Create an initial (unencrypted) TLS handshake record
| write_buffer | the output record is placed here |
| record_type | the record layer type |
| record_version | the record layer version |
| record_sequence | the record layer sequence number |
| message | the record contents |
| message_len | is size of message |
Definition at line 206 of file tls_record.cpp.
References ApplicationData.
|
constexpr |
Magic values used to signal a downgrade request to TLS 1.1.
RFC 8446 4.1.3: TLS 1.3 has a downgrade protection mechanism embedded in the server's random value. TLS 1.3 servers which negotiate TLS 1.2 or below in response to a ClientHello MUST set the last 8 bytes of their Random value specially in their ServerHello.
Definition at line 119 of file tls_magic.h.
Referenced by Botan::TLS::Server_Hello_12_Shim::random_signals_downgrade(), and Botan::TLS::Server_Hello_13::random_signals_downgrade().
|
constexpr |
Magic values used to signal a downgrade request to TLS 1.2.
RFC 8446 4.1.3: TLS 1.3 has a downgrade protection mechanism embedded in the server's random value. TLS 1.3 servers which negotiate TLS 1.2 or below in response to a ClientHello MUST set the last 8 bytes of their Random value specially in their ServerHello.
Definition at line 130 of file tls_magic.h.
Referenced by make_server_hello_random(), Botan::TLS::Server_Hello_12_Shim::random_signals_downgrade(), and Botan::TLS::Server_Hello_13::random_signals_downgrade().
|
constexpr |
RFC 8446 4.1.3: For reasons of backward compatibility with middleboxes, the HelloRetryRequest message uses the same structure as the ServerHello, but with Random set to the special value of the SHA-256 of "HelloRetryRequest":
Definition at line 138 of file tls_magic.h.
Referenced by Botan::TLS::Hello_Retry_Request::Hello_Retry_Request(), and Botan::TLS::Server_Hello_Internal::Server_Hello_Internal().