Botan 2.19.3
Crypto and TLS for C&
|
Namespaces | |
namespace | detail |
Typedefs | |
typedef Policy | Default_Policy |
typedef std::function< std::shared_ptr< Connection_Cipher_State >(uint16_t)> | get_cipherstate_fn |
Functions | |
const std::vector< Signature_Scheme > & | all_signature_schemes () |
template<typename Alloc > | |
void | append_tls_length_value (std::vector< uint8_t, Alloc > &buf, const std::string &str, size_t tag_size) |
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) |
Auth_Method | auth_method_from_string (const std::string &str) |
std::string | auth_method_to_string (Auth_Method method) |
const BotanAlertCategory & | botan_alert_category () noexcept |
const StreamCategory & | botan_stream_category () |
uint16_t | check_tls_cbc_padding (const uint8_t record[], size_t record_len) |
Group_Params | group_param_from_string (const std::string &group_name) |
bool | group_param_is_dh (Group_Params group) |
std::string | group_param_to_string (Group_Params group) |
const char * | handshake_type_to_string (Handshake_Type type) |
std::string | hash_function_of_scheme (Signature_Scheme scheme) |
std::string | kdf_algo_to_string (KDF_Algo algo) |
Kex_Algo | kex_method_from_string (const std::string &str) |
std::string | kex_method_to_string (Kex_Algo method) |
bool | key_exchange_is_psk (Kex_Algo m) |
boost::system::error_code | make_error_code (Botan::TLS::Alert::Type c) |
boost::system::error_code | make_error_code (Botan::TLS::StreamError e) |
std::vector< uint8_t > | make_hello_random (RandomNumberGenerator &rng, const Policy &policy) |
bool | operator!= (const Server_Information &a, const Server_Information &b) |
bool | operator< (const Server_Information &a, const Server_Information &b) |
bool | operator== (const Server_Information &a, const Server_Information &b) |
std::string | padding_string_for_scheme (Signature_Scheme scheme) |
Record_Header | read_record (bool is_datagram, 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, get_cipherstate_fn get_cipherstate, bool allow_epoch0_restart) |
std::string | sig_scheme_to_string (Signature_Scheme scheme) |
std::string | signature_algorithm_of_scheme (Signature_Scheme scheme) |
bool | signature_scheme_is_known (Signature_Scheme scheme) |
void | write_record (secure_vector< uint8_t > &output, uint8_t 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, uint8_t record_type, Protocol_Version version, uint64_t record_sequence, const uint8_t *message, size_t message_len) |
typedef Policy Botan::TLS::Default_Policy |
Definition at line 344 of file tls_policy.h.
typedef std::function<std::shared_ptr<Connection_Cipher_State>(uint16_t)> Botan::TLS::get_cipherstate_fn |
Definition at line 168 of file tls_record.h.
anonymous enum |
Enumerator | |
---|---|
TLS_EMPTY_RENEGOTIATION_INFO_SCSV | |
TLS_FALLBACK_SCSV |
Definition at line 28 of file msg_client_hello.cpp.
|
strong |
|
strong |
Definition at line 20 of file tls_algos.h.
|
strong |
Enumerator | |
---|---|
NONE | |
SECP256R1 | |
SECP384R1 | |
SECP521R1 | |
BRAINPOOL256R1 | |
BRAINPOOL384R1 | |
BRAINPOOL512R1 | |
X25519 | |
FFDHE_2048 | |
FFDHE_3072 | |
FFDHE_4096 | |
FFDHE_6144 | |
FFDHE_8192 |
Definition at line 123 of file tls_algos.h.
Definition at line 32 of file tls_extensions.h.
Definition at line 45 of file tls_magic.h.
|
strong |
Enumerator | |
---|---|
SHA_1 | |
SHA_256 | |
SHA_384 |
Definition at line 54 of file tls_algos.h.
|
strong |
Enumerator | |
---|---|
STATIC_RSA | |
DH | |
ECDH | |
CECPQ1 | |
SRP_SHA | |
PSK | |
DHE_PSK | |
ECDHE_PSK |
Definition at line 146 of file tls_algos.h.
|
strong |
Enumerator | |
---|---|
CBC_MODE | |
AEAD_IMPLICIT_4 | |
AEAD_XOR_12 |
Definition at line 62 of file tls_algos.h.
Enumerator | |
---|---|
CHANGE_CIPHER_SPEC | |
ALERT | |
HANDSHAKE | |
APPLICATION_DATA | |
NO_RECORD |
Definition at line 35 of file tls_magic.h.
|
strong |
Definition at line 86 of file tls_algos.h.
Protocol Constants for SSL/TLS
Enumerator | |
---|---|
TLS_HEADER_SIZE | |
DTLS_HEADER_SIZE | |
MAX_PLAINTEXT_SIZE | |
MAX_COMPRESSED_SIZE | |
MAX_CIPHERTEXT_SIZE |
Definition at line 22 of file tls_magic.h.
Enumerator | |
---|---|
StreamTruncated |
Definition at line 33 of file asio_error.h.
BOTAN_UNSTABLE_API const std::vector< Signature_Scheme > & Botan::TLS::all_signature_schemes | ( | ) |
Definition at line 229 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
Referenced by Botan::TLS::Policy::allowed_signature_schemes().
void Botan::TLS::append_tls_length_value | ( | std::vector< uint8_t, Alloc > & | buf, |
const std::string & | str, | ||
size_t | tag_size | ||
) |
Definition at line 217 of file tls_reader.h.
References append_tls_length_value(), and Botan::cast_char_ptr_to_uint8().
void Botan::TLS::append_tls_length_value | ( | std::vector< uint8_t, Alloc > & | buf, |
const std::vector< T, Alloc2 > & | vals, | ||
size_t | tag_size | ||
) |
Definition at line 209 of file tls_reader.h.
References append_tls_length_value().
void Botan::TLS::append_tls_length_value | ( | std::vector< uint8_t, Alloc > & | buf, |
const T * | vals, | ||
size_t | vals_size, | ||
size_t | tag_size | ||
) |
Helper function for encoding length-tagged vectors
Definition at line 185 of file tls_reader.h.
References Botan::get_byte(), and T.
Referenced by 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::Client_Hello::cookie_input_data(), Botan::TLS::Renegotiation_Extension::serialize(), Botan::TLS::Application_Layer_Protocol_Notification::serialize(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
Auth_Method BOTAN_TEST_API Botan::TLS::auth_method_from_string | ( | const std::string & | str | ) |
Definition at line 102 of file tls_algos.cpp.
std::string BOTAN_TEST_API Botan::TLS::auth_method_to_string | ( | Auth_Method | method | ) |
Definition at line 83 of file tls_algos.cpp.
References ANONYMOUS, DSA, ECDSA, IMPLICIT, and RSA.
Referenced by Botan::TLS::Ciphersuite::sig_algo().
|
inlinenoexcept |
Definition at line 85 of file asio_error.h.
Referenced by make_error_code().
|
inline |
Definition at line 59 of file asio_error.h.
Referenced by make_error_code().
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 243 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().
Referenced by Botan::TLS::TLS_CBC_HMAC_AEAD_Decryption::finish().
Group_Params Botan::TLS::group_param_from_string | ( | const std::string & | group_name | ) |
Definition at line 124 of file tls_algos.cpp.
References BRAINPOOL256R1, BRAINPOOL384R1, BRAINPOOL512R1, FFDHE_2048, FFDHE_3072, FFDHE_4096, FFDHE_6144, FFDHE_8192, NONE, SECP256R1, SECP384R1, SECP521R1, and X25519.
Referenced by Botan::TLS::Text_Policy::key_exchange_groups().
bool Botan::TLS::group_param_is_dh | ( | Group_Params | group | ) |
Definition at line 118 of file tls_algos.cpp.
Referenced by Botan::TLS::Policy::default_dh_group(), Botan::TLS::Supported_Groups::dh_groups(), Botan::TLS::Supported_Groups::ec_groups(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
std::string Botan::TLS::group_param_to_string | ( | Group_Params | group | ) |
Definition at line 155 of file tls_algos.cpp.
References BRAINPOOL256R1, BRAINPOOL384R1, BRAINPOOL512R1, FFDHE_2048, FFDHE_3072, FFDHE_4096, FFDHE_6144, FFDHE_8192, SECP256R1, SECP384R1, SECP521R1, and X25519.
Referenced by Botan::TLS::Callbacks::tls_decode_group_param().
const char * Botan::TLS::handshake_type_to_string | ( | Handshake_Type | type | ) |
Definition at line 24 of file tls_handshake_state.cpp.
References CERTIFICATE, CERTIFICATE_REQUEST, CERTIFICATE_STATUS, CERTIFICATE_URL, CERTIFICATE_VERIFY, CLIENT_HELLO, CLIENT_KEX, FINISHED, HANDSHAKE_CCS, HANDSHAKE_NONE, HELLO_REQUEST, HELLO_VERIFY_REQUEST, NEW_SESSION_TICKET, SERVER_HELLO, SERVER_HELLO_DONE, SERVER_KEX, type, and Botan::TLS::Alert::UNEXPECTED_MESSAGE.
Referenced by Botan::TLS::Handshake_State::confirm_transition_to(), and Botan::TLS::Handshake_Message::type_string().
std::string BOTAN_UNSTABLE_API Botan::TLS::hash_function_of_scheme | ( | Signature_Scheme | scheme | ) |
Definition at line 191 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, EDDSA_25519, EDDSA_448, NONE, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
Referenced by Botan::TLS::Policy::allowed_signature_schemes(), Botan::TLS::Handshake_State::choose_sig_format(), and Botan::TLS::Handshake_State::parse_sig_format().
std::string BOTAN_DLL Botan::TLS::kdf_algo_to_string | ( | KDF_Algo | algo | ) |
Definition at line 14 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 | ( | const std::string & | str | ) |
Definition at line 54 of file tls_algos.cpp.
References CECPQ1, DH, DHE_PSK, ECDH, ECDHE_PSK, PSK, SRP_SHA, and STATIC_RSA.
std::string BOTAN_TEST_API Botan::TLS::kex_method_to_string | ( | Kex_Algo | method | ) |
Definition at line 29 of file tls_algos.cpp.
References CECPQ1, DH, DHE_PSK, ECDH, ECDHE_PSK, PSK, SRP_SHA, and STATIC_RSA.
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 160 of file tls_algos.h.
References DHE_PSK, ECDHE_PSK, and PSK.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Definition at line 91 of file asio_error.h.
References botan_alert_category().
|
inline |
Definition at line 65 of file asio_error.h.
References botan_stream_category().
std::vector< uint8_t > Botan::TLS::make_hello_random | ( | RandomNumberGenerator & | rng, |
const Policy & | policy | ||
) |
Definition at line 33 of file msg_client_hello.cpp.
References Botan::HashFunction::create_or_throw(), Botan::TLS::Policy::include_time_in_hello_random(), Botan::RandomNumberGenerator::randomize(), and Botan::store_be().
|
inline |
Definition at line 84 of file tls_server_info.h.
|
inline |
Definition at line 89 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 76 of file tls_server_info.h.
References Botan::TLS::Server_Information::hostname(), Botan::TLS::Server_Information::port(), and Botan::TLS::Server_Information::service().
std::string BOTAN_UNSTABLE_API Botan::TLS::padding_string_for_scheme | ( | Signature_Scheme | scheme | ) |
Definition at line 379 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, EDDSA_25519, EDDSA_448, NONE, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
Referenced by Botan::TLS::Handshake_State::choose_sig_format(), and Botan::TLS::Handshake_State::parse_sig_format().
Record_Header Botan::TLS::read_record | ( | bool | is_datagram, |
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, | ||
get_cipherstate_fn | get_cipherstate, | ||
bool | allow_epoch0_restart | ||
) |
Decode a TLS record
Definition at line 514 of file tls_record.cpp.
Referenced by Botan::TLS::Channel::received_data().
std::string BOTAN_UNSTABLE_API Botan::TLS::sig_scheme_to_string | ( | Signature_Scheme | scheme | ) |
Definition at line 329 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, EDDSA_25519, EDDSA_448, NONE, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
std::string Botan::TLS::signature_algorithm_of_scheme | ( | Signature_Scheme | scheme | ) |
Definition at line 291 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, EDDSA_25519, EDDSA_448, NONE, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
Referenced by Botan::TLS::Policy::allowed_signature_schemes(), Botan::TLS::Handshake_State::choose_sig_format(), and Botan::TLS::Handshake_State::parse_sig_format().
bool BOTAN_UNSTABLE_API Botan::TLS::signature_scheme_is_known | ( | Signature_Scheme | scheme | ) |
Definition at line 262 of file tls_algos.cpp.
References DSA_SHA1, DSA_SHA256, DSA_SHA384, DSA_SHA512, ECDSA_SHA1, ECDSA_SHA256, ECDSA_SHA384, ECDSA_SHA512, RSA_PKCS1_SHA1, RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384, and RSA_PSS_SHA512.
Referenced by Botan::TLS::Policy::allowed_signature_schemes(), Botan::TLS::Handshake_State::choose_sig_format(), and Botan::TLS::Handshake_State::parse_sig_format().
void Botan::TLS::write_record | ( | secure_vector< uint8_t > & | write_buffer, |
uint8_t | 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 |
rng | is a random number generator |
Definition at line 224 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_ad(), and Botan::Cipher_Mode::start().
void Botan::TLS::write_unencrypted_record | ( | secure_vector< uint8_t > & | write_buffer, |
uint8_t | 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 210 of file tls_record.cpp.
References APPLICATION_DATA.