/* * TLS Handshake State * (C) 2004-2006 Jack Lloyd * * Released under the terms of the Botan license */ #ifndef BOTAN_TLS_HANDSHAKE_STATE_H__ #define BOTAN_TLS_HANDSHAKE_STATE_H__ #include #include #include #include #include #include #if defined(BOTAN_USE_STD_TR1) #if defined(BOTAN_BUILD_COMPILER_IS_MSVC) #include #else #include #endif #elif defined(BOTAN_USE_BOOST_TR1) #include #else #error "No TR1 library defined for use" #endif namespace Botan { /** * SSL/TLS Handshake State */ class TLS_Handshake_State { public: TLS_Handshake_State(); ~TLS_Handshake_State(); bool received_handshake_msg(Handshake_Type handshake_msg) const; void confirm_transition_to(Handshake_Type handshake_msg); void set_expected_next(Handshake_Type handshake_msg); std::pair choose_sig_format(const Public_Key* key, TLS_Ciphersuite_Algos hash_algo, TLS_Ciphersuite_Algos sig_algo, bool for_client_auth); std::pair choose_sig_format(const Private_Key* key, TLS_Ciphersuite_Algos& hash_algo, TLS_Ciphersuite_Algos& sig_algo, bool for_client_auth); Version_Code version; class Client_Hello* client_hello; class Server_Hello* server_hello; class Certificate* server_certs; class Server_Key_Exchange* server_kex; class Certificate_Req* cert_req; class Server_Hello_Done* server_hello_done; class Certificate* client_certs; class Client_Key_Exchange* client_kex; class Certificate_Verify* client_verify; class Next_Protocol* next_protocol; class Finished* client_finished; class Finished* server_finished; Public_Key* kex_pub; Private_Key* kex_priv; TLS_Cipher_Suite suite; Session_Keys keys; TLS_Handshake_Hash hash; SecureQueue queue; /* * Only used by clients for session resumption */ SecureVector resume_master_secret; /** * Used by client using NPN */ std::tr1::function)> client_npn_cb; private: u32bit hand_expecting_mask, hand_received_mask; }; } #endif