aboutsummaryrefslogtreecommitdiffstats
path: root/src/tls/tls_state.h
blob: 4d1ae9d6db37bd473d839907f1025bfc194d6ed8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
* 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 <botan/internal/tls_messages.h>
#include <botan/internal/tls_session_key.h>
#include <botan/secqueue.h>

namespace Botan {

/**
* SSL/TLS Handshake State
*/
class Handshake_State
   {
   public:
      Handshake_State();
      ~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);

      Client_Hello* client_hello;
      Server_Hello* server_hello;
      Certificate* server_certs;
      Server_Key_Exchange* server_kex;
      Certificate_Req* cert_req;
      Server_Hello_Done* server_hello_done;

      Certificate* client_certs;
      Client_Key_Exchange* client_kex;
      Certificate_Verify* client_verify;
      Finished* client_finished;
      Finished* server_finished;

      Public_Key* kex_pub;
      Private_Key* kex_priv;

      CipherSuite suite;
      SessionKeys keys;
      TLS_Handshake_Hash hash;

      SecureQueue queue;

      Version_Code version;
   private:
      u32bit hand_expecting_mask, hand_received_mask;
   };

}

#endif