Botan 3.6.1
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.
|
virtualdefault |
|
delete |
|
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 cert_req(), choose_sig_format(), and parse_sig_format().
void Botan::TLS::Handshake_State::cert_req | ( | Certificate_Request_12 * | cert_req | ) |
Definition at line 142 of file tls_handshake_state.cpp.
References cert_req(), and note_message().
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 247 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 187 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.
Referenced by client_certs().
void Botan::TLS::Handshake_State::client_certs | ( | Certificate_12 * | client_certs | ) |
Definition at line 152 of file tls_handshake_state.cpp.
References client_certs(), and note_message().
|
inline |
Definition at line 157 of file tls_handshake_state.h.
Referenced by client_finished().
void Botan::TLS::Handshake_State::client_finished | ( | Finished_12 * | client_finished | ) |
Definition at line 182 of file tls_handshake_state.cpp.
References client_finished(), and note_message().
|
inline |
Definition at line 131 of file tls_handshake_state.h.
Referenced by choose_sig_format(), client_hello(), and session_ticket().
void Botan::TLS::Handshake_State::client_hello | ( | 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 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 client_kex(), and compute_session_keys().
void Botan::TLS::Handshake_State::client_kex | ( | Client_Key_Exchange * | client_kex | ) |
Definition at line 157 of file tls_handshake_state.cpp.
References client_kex(), and note_message().
|
inline |
Definition at line 147 of file tls_handshake_state.h.
Referenced by client_verify().
void Botan::TLS::Handshake_State::client_verify | ( | Certificate_Verify_12 * | client_verify | ) |
Definition at line 162 of file tls_handshake_state.cpp.
References client_verify(), and note_message().
void Botan::TLS::Handshake_State::compute_session_keys | ( | ) |
Definition at line 205 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 209 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 213 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::confirm_transition_to().
std::pair< Handshake_Type, std::vector< uint8_t > > Botan::TLS::Handshake_State::get_next_handshake_msg | ( | ) |
Definition at line 225 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::change_cipher_spec_expected().
|
inline |
Definition at line 67 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 new_session_ticket(), and session_ticket().
void Botan::TLS::Handshake_State::new_session_ticket | ( | New_Session_Ticket_12 * | new_session_ticket | ) |
Definition at line 172 of file tls_handshake_state.cpp.
References new_session_ticket(), and note_message().
void Botan::TLS::Handshake_State::note_message | ( | const Handshake_Message & | msg | ) |
Definition at line 98 of file tls_handshake_state.cpp.
References Botan::TLS::Callbacks::tls_inspect_handshake_msg().
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 |
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 300 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 237 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 194 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 221 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::received_handshake_msg().
|
inline |
Definition at line 151 of file tls_handshake_state.h.
Referenced by server_cert_status().
void Botan::TLS::Handshake_State::server_cert_status | ( | Certificate_Status * | server_cert_status | ) |
Definition at line 132 of file tls_handshake_state.cpp.
References note_message(), and server_cert_status().
|
inline |
Definition at line 135 of file tls_handshake_state.h.
Referenced by server_certs().
void Botan::TLS::Handshake_State::server_certs | ( | Certificate_12 * | server_certs | ) |
Definition at line 127 of file tls_handshake_state.cpp.
References note_message(), and server_certs().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Definition at line 155 of file tls_handshake_state.h.
Referenced by server_finished().
void Botan::TLS::Handshake_State::server_finished | ( | Finished_12 * | server_finished | ) |
Definition at line 177 of file tls_handshake_state.cpp.
References note_message(), and server_finished().
|
inline |
Definition at line 133 of file tls_handshake_state.h.
Referenced by server_hello().
void Botan::TLS::Handshake_State::server_hello | ( | Server_Hello_12 * | server_hello | ) |
Definition at line 121 of file tls_handshake_state.cpp.
References Botan::TLS::Ciphersuite::by_id(), note_message(), and server_hello().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), 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.
Referenced by server_hello_done().
void Botan::TLS::Handshake_State::server_hello_done | ( | Server_Hello_Done * | server_hello_done | ) |
Definition at line 147 of file tls_handshake_state.cpp.
References note_message(), and server_hello_done().
|
inline |
Definition at line 137 of file tls_handshake_state.h.
Referenced by server_kex().
void Botan::TLS::Handshake_State::server_kex | ( | Server_Key_Exchange * | server_kex | ) |
Definition at line 137 of file tls_handshake_state.cpp.
References note_message(), and server_kex().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), and Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Definition at line 149 of file tls_handshake_state.h.
Referenced by server_verify().
void Botan::TLS::Handshake_State::server_verify | ( | Certificate_Verify_12 * | server_verify | ) |
Definition at line 167 of file tls_handshake_state.cpp.
References note_message(), and 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 229 of file tls_handshake_state.cpp.
References client_hello(), new_session_ticket(), Botan::TLS::Client_Hello_12::session_ticket(), and Botan::TLS::New_Session_Ticket_12::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 217 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::set_expected_next().
Referenced by Botan::TLS::Client_Impl_12::Client_Impl_12().
void Botan::TLS::Handshake_State::set_version | ( | const Protocol_Version & | version | ) |
Definition at line 201 of file tls_handshake_state.cpp.
References version().
|
inline |
Definition at line 104 of file tls_handshake_state.h.
Referenced by set_version().