8 #ifndef BOTAN_TLS_HANDSHAKE_STATE_H__
9 #define BOTAN_TLS_HANDSHAKE_STATE_H__
11 #include <botan/internal/tls_handshake_hash.h>
12 #include <botan/internal/tls_handshake_io.h>
13 #include <botan/internal/tls_session_key.h>
14 #include <botan/tls_ciphersuite.h>
15 #include <botan/tls_exceptn.h>
16 #include <botan/tls_handshake_msg.h>
17 #include <botan/pk_keys.h>
18 #include <botan/pubkey.h>
30 class Hello_Verify_Request;
34 class Certificate_Status;
35 class Server_Key_Exchange;
36 class Certificate_Req;
37 class Server_Hello_Done;
39 class Client_Key_Exchange;
40 class Certificate_Verify;
41 class New_Session_Ticket;
77 std::pair<Handshake_Type, std::vector<uint8_t>>
82 std::pair<std::string, Signature_Format>
84 const std::string& hash_algo,
85 const std::string& sig_algo,
87 const Policy& policy)
const;
89 std::pair<std::string, Signature_Format>
91 std::string& hash_algo,
92 std::string& sig_algo,
94 const Policy& policy)
const;
121 {
return m_client_hello.get(); }
124 {
return m_server_hello.get(); }
127 {
return m_server_certs.get(); }
130 {
return m_server_kex.get(); }
133 {
return m_cert_req.get(); }
136 {
return m_server_hello_done.get(); }
139 {
return m_client_certs.get(); }
142 {
return m_client_kex.get(); }
145 {
return m_client_verify.get(); }
148 {
return m_server_cert_status.get(); }
151 {
return m_new_session_ticket.get(); }
154 {
return m_server_finished.get(); }
157 {
return m_client_finished.get(); }
176 std::unique_ptr<Handshake_IO> m_handshake_io;
178 uint32_t m_hand_expecting_mask = 0;
179 uint32_t m_hand_received_mask = 0;
185 std::unique_ptr<Client_Hello> m_client_hello;
186 std::unique_ptr<Server_Hello> m_server_hello;
187 std::unique_ptr<Certificate> m_server_certs;
188 std::unique_ptr<Certificate_Status> m_server_cert_status;
189 std::unique_ptr<Server_Key_Exchange> m_server_kex;
190 std::unique_ptr<Certificate_Req> m_cert_req;
191 std::unique_ptr<Server_Hello_Done> m_server_hello_done;
192 std::unique_ptr<Certificate> m_client_certs;
193 std::unique_ptr<Client_Key_Exchange> m_client_kex;
194 std::unique_ptr<Certificate_Verify> m_client_verify;
195 std::unique_ptr<New_Session_Ticket> m_new_session_ticket;
196 std::unique_ptr<Finished> m_server_finished;
197 std::unique_ptr<Finished> m_client_finished;
std::pair< std::string, Signature_Format > parse_sig_format(const Public_Key &key, const std::string &hash_algo, const std::string &sig_algo, bool for_client_auth, const Policy &policy) const
Handshake_State & operator=(const Handshake_State &)=delete
virtual ~Handshake_State()=default
const Server_Hello_Done * server_hello_done() const
const Finished * client_finished() const
const Session_Keys & session_keys() const
const Server_Hello * server_hello() const
const Finished * server_finished() const
const Certificate * server_certs() const
Handshake_State(Handshake_IO *io, Callbacks &callbacks)
const Certificate_Status * server_cert_status() const
KDF * protocol_specific_prf() const
void compute_session_keys()
void set_version(const Protocol_Version &version)
const Server_Key_Exchange * server_kex() const
std::vector< T, secure_allocator< T >> secure_vector
std::pair< Handshake_Type, std::vector< uint8_t > > get_next_handshake_msg()
const Certificate_Verify * client_verify() const
const Handshake_Hash & hash() const
void confirm_transition_to(Handshake_Type msg_type)
std::vector< uint8_t > session_ticket() const
secure_vector< uint8_t > resume_master_secret
void note_message(const Handshake_Message &msg)
Handshake_IO & handshake_io()
void hello_verify_request(const Hello_Verify_Request &hello_verify)
std::string srp_identifier() const
std::pair< std::string, Signature_Format > choose_sig_format(const Private_Key &key, std::string &hash_algo, std::string &sig_algo, bool for_client_auth, const Policy &policy) const
const New_Session_Ticket * new_session_ticket() const
const Ciphersuite & ciphersuite() const
bool received_handshake_msg(Handshake_Type msg_type) const
const Certificate * client_certs() const
void set_expected_next(Handshake_Type msg_type)
const Certificate_Req * cert_req() const
Protocol_Version version() const
const Client_Hello * client_hello() const
const Client_Key_Exchange * client_kex() const