9#ifndef BOTAN_TLS_HANDSHAKE_STATE_H_
10#define BOTAN_TLS_HANDSHAKE_STATE_H_
12#include <botan/assert.h>
13#include <botan/tls_ciphersuite.h>
14#include <botan/tls_exceptn.h>
15#include <botan/tls_extensions.h>
16#include <botan/tls_handshake_msg.h>
17#include <botan/tls_session.h>
18#include <botan/x509cert.h>
19#include <botan/internal/tls_handshake_hash.h>
20#include <botan/internal/tls_handshake_io.h>
21#include <botan/internal/tls_handshake_transitions.h>
22#include <botan/internal/tls_session_key.h>
100 const std::vector<Signature_Scheme>& offered_schemes,
101 bool for_client_auth,
102 const Policy& policy)
const;
106 bool for_client_auth,
107 const Policy& policy)
const;
252 template <
typename T>
253 static const T& require(
const std::unique_ptr<T>& msg) {
258 Callbacks& m_callbacks;
260 std::unique_ptr<Handshake_IO> m_handshake_io;
262 Handshake_Transitions m_transitions;
263 Protocol_Version m_version;
264 std::optional<Ciphersuite> m_ciphersuite;
265 Session_Keys m_session_keys;
266 Handshake_Hash m_handshake_hash;
268 std::unique_ptr<Client_Hello_12> m_client_hello;
269 std::unique_ptr<Server_Hello_12> m_server_hello;
271 std::unique_ptr<Certificate_12> m_server_certs;
272 std::unique_ptr<Certificate_Status> m_server_cert_status;
273 std::unique_ptr<Server_Key_Exchange> m_server_kex;
274 std::unique_ptr<Certificate_Request_12> m_cert_req;
275 std::unique_ptr<Server_Hello_Done> m_server_hello_done;
276 std::unique_ptr<Certificate_12> m_client_certs;
277 std::unique_ptr<Client_Key_Exchange> m_client_kex;
278 std::unique_ptr<Certificate_Verify_12> m_client_verify;
279 std::unique_ptr<Certificate_Verify_12> m_server_verify;
280 std::unique_ptr<New_Session_Ticket_12> m_new_session_ticket;
281 std::unique_ptr<Finished_12> m_server_finished;
282 std::unique_ptr<Finished_12> m_client_finished;
#define BOTAN_ASSERT_NONNULL(ptr)
bool has_client_hello() const
std::pair< std::string, Signature_Format > 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
const Finished_12 * maybe_client_finished() const
const Certificate_12 * maybe_client_certs() const
const Finished_12 & server_finished() const
bool has_server_kex() const
Handshake_State & operator=(const Handshake_State &other)=delete
bool has_server_verify() const
void hello_verify_request(const Hello_Verify_Request &hello_verify)
void set_expected_next(Handshake_Type msg_type)
bool has_client_certs() const
const Certificate_Verify_12 * maybe_client_verify() const
void note_message(const Handshake_Message &msg)
std::pair< Handshake_Type, std::vector< uint8_t > > get_next_handshake_msg(size_t max_handshake_msg_size)
virtual ~Handshake_State()
const Server_Hello_Done * maybe_server_hello_done() const
const Server_Hello_12 * maybe_server_hello() const
const Certificate_Verify_12 & client_verify() const
const Certificate_Verify_12 & server_verify() const
Handshake_State(std::unique_ptr< Handshake_IO > io, Callbacks &callbacks)
Callbacks & callbacks() const
Handshake_IO & handshake_io()
const Server_Key_Exchange & server_kex() const
const Certificate_Verify_12 * maybe_server_verify() const
bool has_server_finished() const
bool has_client_kex() const
bool has_server_hello_done() const
const Session_Keys & session_keys() const
const Certificate_Status * maybe_server_cert_status() const
const Certificate_Request_12 * maybe_cert_req() const
const Client_Hello_12 * maybe_client_hello() const
const New_Session_Ticket_12 & new_session_ticket() const
bool has_client_finished() const
const Server_Hello_12 & server_hello() const
const Certificate_Status & server_cert_status() const
const Finished_12 * maybe_server_finished() const
const Handshake_Hash & hash() const
Handshake_State(const Handshake_State &other)=delete
const Finished_12 & client_finished() const
const Client_Hello_12 & client_hello() const
void confirm_transition_to(Handshake_Type msg_type)
const Certificate_12 & server_certs() const
std::unique_ptr< Handshake_IO > take_handshake_io()
void set_version(const Protocol_Version &version)
bool has_server_certs() const
std::optional< std::string > psk_identity() const
const Server_Hello_Done & server_hello_done() const
const Certificate_12 * maybe_server_certs() const
const Client_Key_Exchange & client_kex() const
bool has_server_hello() const
bool has_client_verify() const
void compute_session_keys()
const Ciphersuite & ciphersuite() const
Handshake_State(Handshake_State &&other)=delete
Session_Ticket session_ticket() const
const Certificate_Request_12 & cert_req() const
Handshake_State & operator=(Handshake_State &&other)=delete
const Certificate_12 & client_certs() const
bool has_server_cert_status() const
virtual std::vector< X509_Certificate > peer_cert_chain() const =0
bool has_cert_req() const
const Client_Key_Exchange * maybe_client_kex() const
bool received_handshake_msg(Handshake_Type msg_type) const
bool has_new_session_ticket() const
const New_Session_Ticket_12 * maybe_new_session_ticket() const
std::unique_ptr< KDF > protocol_specific_prf() const
std::pair< std::string, Signature_Format > choose_sig_format(const Private_Key &key, Signature_Scheme &scheme, bool for_client_auth, const Policy &policy) const
const Server_Key_Exchange * maybe_server_kex() const
Protocol_Version version() const
Strong< std::vector< uint8_t >, struct Session_Ticket_ > Session_Ticket
holds a TLS 1.2 session ticket for stateless resumption
std::vector< T, secure_allocator< T > > secure_vector