|
Botan 3.14.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 62 of file tls_handshake_state.h.
| Botan::TLS::Handshake_State::Handshake_State | ( | std::unique_ptr< Handshake_IO > | io, |
| Callbacks & | callbacks ) |
Definition at line 31 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 239 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 180 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 84 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 195 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::is_set(), Botan::TLS::Signature_Scheme::padding_string(), Botan::TLS::Certificate_Request_12::signature_schemes(), Botan::TLS::Client_Hello::signature_schemes(), and version().
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 138 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 184 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::client_certs | ( | std::unique_ptr< Certificate_12 > | client_certs | ) |
Definition at line 96 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_certs(), and note_message().
Referenced by client_certs().
|
inline |
Definition at line 198 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::client_finished | ( | std::unique_ptr< Finished_12 > | client_finished | ) |
Definition at line 132 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_finished(), and note_message().
Referenced by client_finished().
|
inline |
Definition at line 172 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 48 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_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 186 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 102 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, client_kex(), and note_message().
Referenced by client_kex().
|
inline |
Definition at line 188 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::client_verify | ( | std::unique_ptr< Certificate_Verify_12 > | client_verify | ) |
Definition at line 108 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 156 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 160 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 164 of file tls_handshake_state.cpp.
| std::pair< Handshake_Type, std::vector< uint8_t > > Botan::TLS::Handshake_State::get_next_handshake_msg | ( | size_t | max_handshake_msg_size | ) |
Definition at line 176 of file tls_handshake_state.cpp.
|
inline |
Definition at line 72 of file tls_handshake_state.h.
Referenced by hello_verify_request().
|
inline |
Definition at line 147 of file tls_handshake_state.h.
Referenced by parse_sig_format().
|
inline |
Definition at line 151 of file tls_handshake_state.h.
|
inline |
Definition at line 165 of file tls_handshake_state.h.
|
inline |
Definition at line 139 of file tls_handshake_state.h.
|
inline |
Definition at line 153 of file tls_handshake_state.h.
|
inline |
Definition at line 155 of file tls_handshake_state.h.
|
inline |
Definition at line 161 of file tls_handshake_state.h.
|
inline |
Definition at line 159 of file tls_handshake_state.h.
|
inline |
Definition at line 143 of file tls_handshake_state.h.
|
inline |
Definition at line 163 of file tls_handshake_state.h.
|
inline |
Definition at line 141 of file tls_handshake_state.h.
|
inline |
Definition at line 149 of file tls_handshake_state.h.
|
inline |
Definition at line 145 of file tls_handshake_state.h.
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Definition at line 157 of file tls_handshake_state.h.
|
inline |
Definition at line 245 of file tls_handshake_state.h.
Referenced by Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), choose_sig_format(), client_hello(), 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 247 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::hello_verify_request | ( | const Hello_Verify_Request & | hello_verify | ) |
Definition at line 38 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, handshake_io(), hash(), note_message(), Botan::TLS::Handshake_Hash::reset(), and Botan::TLS::Handshake_Hash::update().
|
inline |
Definition at line 211 of file tls_handshake_state.h.
|
inline |
Definition at line 215 of file tls_handshake_state.h.
|
inline |
Definition at line 229 of file tls_handshake_state.h.
|
inline |
Definition at line 203 of file tls_handshake_state.h.
|
inline |
Definition at line 217 of file tls_handshake_state.h.
|
inline |
Definition at line 219 of file tls_handshake_state.h.
|
inline |
Definition at line 225 of file tls_handshake_state.h.
Referenced by session_ticket().
|
inline |
Definition at line 223 of file tls_handshake_state.h.
|
inline |
Definition at line 207 of file tls_handshake_state.h.
|
inline |
Definition at line 227 of file tls_handshake_state.h.
|
inline |
Definition at line 205 of file tls_handshake_state.h.
|
inline |
Definition at line 213 of file tls_handshake_state.h.
|
inline |
Definition at line 209 of file tls_handshake_state.h.
|
inline |
Definition at line 221 of file tls_handshake_state.h.
|
inline |
Definition at line 194 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::new_session_ticket | ( | std::unique_ptr< New_Session_Ticket_12 > | new_session_ticket | ) |
Definition at line 120 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 34 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 251 of file tls_handshake_state.cpp.
References Botan::TLS::Policy::acceptable_signature_schemes(), Botan::Asymmetric_Key::algo_name(), Botan::TLS::Signature_Scheme::algorithm_name(), Botan::TLS::Policy::allowed_signature_method(), cert_req(), Botan::TLS::Signature_Scheme::format(), has_cert_req(), Botan::TLS::Signature_Scheme::is_available(), Botan::TLS::Signature_Scheme::is_compatible_with(), Botan::TLS::Signature_Scheme::padding_string(), Botan::TLS::Certificate_Request_12::signature_schemes(), Botan::TLS::Signature_Scheme::to_string(), and Botan::value_exists().
Referenced by Botan::TLS::Certificate_Verify_12::verify(), and Botan::TLS::Server_Key_Exchange::verify().
|
pure virtual |
| std::unique_ptr< KDF > Botan::TLS::Handshake_State::protocol_specific_prf | ( | ) | const |
Definition at line 191 of file tls_handshake_state.cpp.
References ciphersuite().
Referenced by Botan::TLS::Session_Keys::Session_Keys().
| std::optional< std::string > Botan::TLS::Handshake_State::psk_identity | ( | ) | const |
Definition at line 145 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 172 of file tls_handshake_state.cpp.
|
inline |
Definition at line 192 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 72 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 176 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::server_certs | ( | std::unique_ptr< Certificate_12 > | server_certs | ) |
Definition at line 66 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 196 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::server_finished | ( | std::unique_ptr< Finished_12 > | server_finished | ) |
Definition at line 126 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_finished().
Referenced by server_finished().
|
inline |
Definition at line 174 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::server_hello | ( | std::unique_ptr< Server_Hello_12 > | server_hello | ) |
Definition at line 59 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 182 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 90 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 178 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::server_kex | ( | std::unique_ptr< Server_Key_Exchange > | server_kex | ) |
Definition at line 78 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 190 of file tls_handshake_state.h.
| void Botan::TLS::Handshake_State::server_verify | ( | std::unique_ptr< Certificate_Verify_12 > | server_verify | ) |
Definition at line 114 of file tls_handshake_state.cpp.
References BOTAN_ASSERT_NONNULL, note_message(), and server_verify().
Referenced by server_verify().
|
inline |
Definition at line 237 of file tls_handshake_state.h.
| Session_Ticket Botan::TLS::Handshake_State::session_ticket | ( | ) | const |
Definition at line 180 of file tls_handshake_state.cpp.
References client_hello(), maybe_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 168 of file tls_handshake_state.cpp.
| void Botan::TLS::Handshake_State::set_version | ( | const Protocol_Version & | version | ) |
Definition at line 152 of file tls_handshake_state.cpp.
References version().
|
inline |
Definition at line 74 of file tls_handshake_state.h.
|
inline |
Definition at line 111 of file tls_handshake_state.h.
Referenced by choose_sig_format(), and set_version().