Botan 3.9.0
Crypto and TLS for C&
|
#include <tls_handshake_state.h>
SSL/TLS Handshake State
This is a data holder object for all state aggregated during the handshake, both on client and server side and across protocol versions. It does not implement any logic and offers no guarantees regarding state consistency and legal TLS state transitions.
TODO: currently it implements some logic for TLS 1.2, which should be removed TODO: investigate moving the handshake_io to the channel
Definition at line 59 of file tls_handshake_state.h.
Botan::TLS::Handshake_State::Handshake_State | ( | std::unique_ptr< Handshake_IO > | io, |
Callbacks & | callbacks ) |
Definition at line 95 of file tls_handshake_state.cpp.
Referenced by Handshake_State(), Handshake_State(), operator=(), and operator=().
|
virtualdefault |
|
delete |
References Handshake_State().
|
delete |
References Handshake_State().
|
inline |
Definition at line 165 of file tls_handshake_state.h.
Referenced by Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Certificate_Verify_12::verify(), and Botan::TLS::Server_Key_Exchange::verify().
|
inline |
Definition at line 139 of file tls_handshake_state.h.
Referenced by choose_sig_format(), and parse_sig_format().
void Botan::TLS::Handshake_State::cert_req | ( | std::unique_ptr< Certificate_Request_12 > | cert_req | ) |
Definition at line 147 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, cert_req(), and note_message().
Referenced by cert_req().
std::pair< std::string, Signature_Format > Botan::TLS::Handshake_State::choose_sig_format | ( | const Private_Key & | key, |
Signature_Scheme & | scheme, | ||
bool | for_client_auth, | ||
const Policy & | policy ) const |
Definition at line 264 of file tls_handshake_state.cpp.
References Botan::Asymmetric_Key::algo_name(), Botan::TLS::Policy::allowed_signature_hash(), Botan::TLS::Policy::allowed_signature_schemes(), cert_req(), client_hello(), Botan::TLS::Signature_Scheme::format(), hash(), Botan::TLS::Signature_Scheme::hash_function_name(), Botan::TLS::Signature_Scheme::padding_string(), Botan::TLS::Certificate_Request_12::signature_schemes(), and Botan::TLS::Client_Hello::signature_schemes().
Referenced by Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), and Botan::TLS::Server_Key_Exchange::Server_Key_Exchange().
const Ciphersuite & Botan::TLS::Handshake_State::ciphersuite | ( | ) | const |
Definition at line 201 of file tls_handshake_state.cpp.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), protocol_specific_prf(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), and Botan::TLS::Session_Keys::Session_Keys().
|
inline |
Definition at line 143 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::client_certs | ( | std::unique_ptr< Certificate_12 > | client_certs | ) |
Definition at line 159 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_certs(), and note_message().
Referenced by client_certs().
|
inline |
Definition at line 157 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::client_finished | ( | std::unique_ptr< Finished_12 > | client_finished | ) |
Definition at line 195 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_finished(), and note_message().
Referenced by client_finished().
|
inline |
Definition at line 131 of file tls_handshake_state.h.
Referenced by choose_sig_format(), and session_ticket().
void Botan::TLS::Handshake_State::client_hello | ( | std::unique_ptr< Client_Hello_12 > | client_hello | ) |
Definition at line 111 of file tls_handshake_state.cpp.
References client_hello(), hash(), note_message(), and Botan::TLS::Handshake_Hash::reset().
Referenced by client_hello(), Botan::TLS::Client_Impl_12::Client_Impl_12(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Session_Keys::Session_Keys(), Botan::TLS::Certificate_Verify_12::verify(), and Botan::TLS::Server_Key_Exchange::verify().
|
inline |
Definition at line 145 of file tls_handshake_state.h.
Referenced by compute_session_keys().
void Botan::TLS::Handshake_State::client_kex | ( | std::unique_ptr< Client_Key_Exchange > | client_kex | ) |
Definition at line 165 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_kex(), and note_message().
Referenced by client_kex().
|
inline |
Definition at line 147 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::client_verify | ( | std::unique_ptr< Certificate_Verify_12 > | client_verify | ) |
Definition at line 171 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_verify(), and note_message().
Referenced by client_verify().
void Botan::TLS::Handshake_State::compute_session_keys | ( | ) |
Definition at line 219 of file tls_handshake_state.cpp.
References client_kex().
void Botan::TLS::Handshake_State::compute_session_keys | ( | const secure_vector< uint8_t > & | resume_master_secret | ) |
Definition at line 223 of file tls_handshake_state.cpp.
void Botan::TLS::Handshake_State::confirm_transition_to | ( | Handshake_Type | msg_type | ) |
Confirm that we were expecting this message type
msg_type | the message type |
Definition at line 227 of file tls_handshake_state.cpp.
std::pair< Handshake_Type, std::vector< uint8_t > > Botan::TLS::Handshake_State::get_next_handshake_msg | ( | ) |
Definition at line 239 of file tls_handshake_state.cpp.
|
inline |
Definition at line 69 of file tls_handshake_state.h.
Referenced by hello_verify_request().
|
inline |
Definition at line 171 of file tls_handshake_state.h.
Referenced by Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), choose_sig_format(), client_hello(), Botan::TLS::Client_Impl_12::Client_Impl_12(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Finished_12::Finished_12(), hello_verify_request(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Session_Keys::Session_Keys(), and Botan::TLS::Certificate_Verify_12::verify().
|
inline |
Definition at line 173 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::hello_verify_request | ( | const Hello_Verify_Request & | hello_verify | ) |
Definition at line 102 of file tls_handshake_state.cpp.
References handshake_io(), hash(), note_message(), Botan::TLS::Handshake_Hash::reset(), and Botan::TLS::Handshake_Hash::update().
|
inline |
Definition at line 153 of file tls_handshake_state.h.
Referenced by session_ticket().
void Botan::TLS::Handshake_State::new_session_ticket | ( | std::unique_ptr< New_Session_Ticket_12 > | new_session_ticket | ) |
Definition at line 183 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, new_session_ticket(), and note_message().
Referenced by new_session_ticket().
void Botan::TLS::Handshake_State::note_message | ( | const Handshake_Message & | msg | ) |
Definition at line 98 of file tls_handshake_state.cpp.
Referenced by cert_req(), client_certs(), client_finished(), client_hello(), client_kex(), client_verify(), hello_verify_request(), new_session_ticket(), server_cert_status(), server_certs(), server_finished(), server_hello(), server_hello_done(), server_kex(), and server_verify().
|
delete |
References Handshake_State().
|
delete |
References Handshake_State().
std::pair< std::string, Signature_Format > Botan::TLS::Handshake_State::parse_sig_format | ( | const Public_Key & | key, |
Signature_Scheme | scheme, | ||
const std::vector< Signature_Scheme > & | offered_schemes, | ||
bool | for_client_auth, | ||
const Policy & | policy ) const |
Definition at line 317 of file tls_handshake_state.cpp.
References Botan::Asymmetric_Key::algo_name(), Botan::TLS::Signature_Scheme::algorithm_name(), Botan::TLS::Policy::allowed_signature_method(), cert_req(), Botan::TLS::Signature_Scheme::format(), Botan::TLS::Signature_Scheme::hash_function_name(), Botan::TLS::Signature_Scheme::is_available(), Botan::TLS::Signature_Scheme::is_compatible_with(), Botan::TLS::Signature_Scheme::padding_string(), and Botan::TLS::Certificate_Request_12::signature_schemes().
Referenced by Botan::TLS::Certificate_Verify_12::verify(), and Botan::TLS::Server_Key_Exchange::verify().
std::unique_ptr< KDF > Botan::TLS::Handshake_State::protocol_specific_prf | ( | ) | const |
Definition at line 254 of file tls_handshake_state.cpp.
References ciphersuite(), Botan::KDF::create_or_throw(), and Botan::TLS::Ciphersuite::prf_algo().
Referenced by Botan::TLS::Session_Keys::Session_Keys().
std::optional< std::string > Botan::TLS::Handshake_State::psk_identity | ( | ) | const |
Definition at line 208 of file tls_handshake_state.cpp.
bool Botan::TLS::Handshake_State::received_handshake_msg | ( | Handshake_Type | msg_type | ) | const |
Return true iff we have received a particular message already
msg_type | the message type |
Definition at line 235 of file tls_handshake_state.cpp.
|
inline |
Definition at line 151 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_cert_status | ( | std::unique_ptr< Certificate_Status > | server_cert_status | ) |
Definition at line 135 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_cert_status().
Referenced by server_cert_status().
|
inline |
Definition at line 135 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_certs | ( | std::unique_ptr< Certificate_12 > | server_certs | ) |
Definition at line 129 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_certs().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and server_certs().
|
inline |
Definition at line 155 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_finished | ( | std::unique_ptr< Finished_12 > | server_finished | ) |
Definition at line 189 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_finished().
Referenced by server_finished().
|
inline |
Definition at line 133 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_hello | ( | std::unique_ptr< Server_Hello_12 > | server_hello | ) |
Definition at line 122 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, Botan::TLS::Ciphersuite::by_id(), note_message(), and server_hello().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), server_hello(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Session_Keys::Session_Keys(), and Botan::TLS::Server_Key_Exchange::verify().
|
inline |
Definition at line 141 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_hello_done | ( | std::unique_ptr< Server_Hello_Done > | server_hello_done | ) |
Definition at line 153 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_hello_done().
Referenced by server_hello_done().
|
inline |
Definition at line 137 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_kex | ( | std::unique_ptr< Server_Key_Exchange > | server_kex | ) |
Definition at line 141 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_kex().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and server_kex().
|
inline |
Definition at line 149 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::server_verify | ( | std::unique_ptr< Certificate_Verify_12 > | server_verify | ) |
Definition at line 177 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_verify().
Referenced by server_verify().
|
inline |
Definition at line 163 of file tls_handshake_state.h.
Session_Ticket Botan::TLS::Handshake_State::session_ticket | ( | ) | const |
Definition at line 243 of file tls_handshake_state.cpp.
References client_hello(), new_session_ticket(), and Botan::TLS::Client_Hello_12::session_ticket().
void Botan::TLS::Handshake_State::set_expected_next | ( | Handshake_Type | msg_type | ) |
Record that we are expecting a particular message type next
msg_type | the message type |
Definition at line 231 of file tls_handshake_state.cpp.
Referenced by Botan::TLS::Client_Impl_12::Client_Impl_12().
void Botan::TLS::Handshake_State::set_version | ( | const Protocol_Version & | version | ) |
Definition at line 215 of file tls_handshake_state.cpp.
References version().
|
inline |
Definition at line 106 of file tls_handshake_state.h.
Referenced by set_version().