Botan 3.0.0-alpha0
Crypto and TLS for C&
|
#include <tls_handshake_state.h>
Inherited by Botan::TLS::Server_Handshake_State.
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 98 of file tls_handshake_state.cpp.
|
virtualdefault |
|
delete |
|
inline |
Definition at line 181 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::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Server_Key_Exchange::verify(), and Botan::TLS::Certificate_Verify_12::verify().
|
inline |
Definition at line 147 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 159 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 277 of file tls_handshake_state.cpp.
References Botan::Public_Key::algo_name(), Botan::TLS::Policy::allowed_signature_hash(), Botan::TLS::Policy::allowed_signature_schemes(), cert_req(), client_hello(), Botan::TLS::Signature_Scheme::format(), Botan::TLS::Alert::HANDSHAKE_FAILURE, hash(), Botan::TLS::Signature_Scheme::hash_function_name(), Botan::TLS::Signature_Scheme::padding_string(), Botan::TLS::Client_Hello::signature_schemes(), and Botan::TLS::Certificate_Request_12::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 213 of file tls_handshake_state.cpp.
Referenced by 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 153 of file tls_handshake_state.h.
Referenced by client_certs().
void Botan::TLS::Handshake_State::client_certs | ( | Certificate_12 * | client_certs | ) |
Definition at line 171 of file tls_handshake_state.cpp.
References client_certs(), and note_message().
|
inline |
Definition at line 174 of file tls_handshake_state.h.
Referenced by client_finished().
void Botan::TLS::Handshake_State::client_finished | ( | Finished_12 * | client_finished | ) |
Definition at line 207 of file tls_handshake_state.cpp.
References client_finished(), and note_message().
|
inline |
Definition at line 135 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 120 of file tls_handshake_state.cpp.
References client_hello(), hash(), note_message(), and Botan::TLS::Handshake_Hash::reset().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange(), Botan::TLS::Server_Key_Exchange::Server_Key_Exchange(), Botan::TLS::Session_Keys::Session_Keys(), Botan::TLS::Server_Key_Exchange::verify(), and Botan::TLS::Certificate_Verify_12::verify().
|
inline |
Definition at line 156 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 177 of file tls_handshake_state.cpp.
References client_kex(), and note_message().
|
inline |
Definition at line 159 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 183 of file tls_handshake_state.cpp.
References client_verify(), and note_message().
void Botan::TLS::Handshake_State::compute_session_keys | ( | ) |
Definition at line 227 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 232 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 237 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 253 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::change_cipher_spec_expected().
|
inline |
Definition at line 68 of file tls_handshake_state.h.
Referenced by hello_verify_request().
|
inline |
Definition at line 187 of file tls_handshake_state.h.
Referenced by Botan::TLS::Certificate_Verify_12::Certificate_Verify_12(), choose_sig_format(), client_hello(), 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 189 of file tls_handshake_state.h.
void Botan::TLS::Handshake_State::hello_verify_request | ( | const Hello_Verify_Request & | hello_verify | ) |
Definition at line 110 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 168 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 195 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 105 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 343 of file tls_handshake_state.cpp.
References Botan::Public_Key::algo_name(), Botan::TLS::Signature_Scheme::algorithm_name(), Botan::TLS::Policy::allowed_signature_method(), cert_req(), Botan::TLS::Signature_Scheme::format(), Botan::TLS::Alert::HANDSHAKE_FAILURE, hash_algo, Botan::TLS::Signature_Scheme::hash_function_name(), Botan::TLS::Alert::ILLEGAL_PARAMETER, 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(), and Botan::TLS::Protocol_Version::TLS_V12.
Referenced by Botan::TLS::Server_Key_Exchange::verify(), and Botan::TLS::Certificate_Verify_12::verify().
std::unique_ptr< KDF > Botan::TLS::Handshake_State::protocol_specific_prf | ( | ) | const |
Definition at line 266 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().
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 247 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::received_handshake_msg().
|
inline |
Definition at line 165 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 147 of file tls_handshake_state.cpp.
References note_message(), and server_cert_status().
|
inline |
Definition at line 141 of file tls_handshake_state.h.
Referenced by server_certs().
void Botan::TLS::Handshake_State::server_certs | ( | Certificate_12 * | server_certs | ) |
Definition at line 141 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 171 of file tls_handshake_state.h.
Referenced by server_finished().
void Botan::TLS::Handshake_State::server_finished | ( | Finished_12 * | server_finished | ) |
Definition at line 201 of file tls_handshake_state.cpp.
References note_message(), and server_finished().
|
inline |
Definition at line 138 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 134 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 150 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 165 of file tls_handshake_state.cpp.
References note_message(), and server_hello_done().
|
inline |
Definition at line 144 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 153 of file tls_handshake_state.cpp.
References note_message(), and server_kex().
Referenced by Botan::TLS::Client_Key_Exchange::Client_Key_Exchange().
|
inline |
Definition at line 162 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 189 of file tls_handshake_state.cpp.
References note_message(), and server_verify().
|
inline |
Definition at line 179 of file tls_handshake_state.h.
std::vector< uint8_t > Botan::TLS::Handshake_State::session_ticket | ( | ) | const |
Definition at line 258 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 242 of file tls_handshake_state.cpp.
References Botan::TLS::Handshake_Transitions::set_expected_next().
void Botan::TLS::Handshake_State::set_version | ( | const Protocol_Version & | version | ) |
Definition at line 222 of file tls_handshake_state.cpp.
References version().
|
inline |
Definition at line 108 of file tls_handshake_state.h.
Referenced by set_version().