|
1 /* |
|
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: EAP and WLAN authentication protocols. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #if !defined(_TLS_COMPLETION_H_) |
|
22 #define _TLS_COMPLETION_H_ |
|
23 |
|
24 #include "eap_tools.h" |
|
25 #include "eap_array.h" |
|
26 #include "tls_record_message.h" |
|
27 #include "abs_tls_message_hash.h" |
|
28 |
|
29 /** @file */ |
|
30 |
|
31 /** |
|
32 * This is enumeration of TLS competion actions. |
|
33 */ |
|
34 enum tls_completion_action_e |
|
35 { |
|
36 tls_completion_action_none, ///< Initialization value means no action. |
|
37 tls_completion_action_create_handshake_type_hello_request, ///< create_handshake_type_hello_request |
|
38 tls_completion_action_create_handshake_type_client_hello, ///< create_handshake_type_client_hello |
|
39 tls_completion_action_create_handshake_type_server_hello, ///< create_handshake_type_server_hello |
|
40 tls_completion_action_create_handshake_type_certificate, ///< create_handshake_type_certificate |
|
41 tls_completion_action_create_handshake_type_server_key_exchange, ///< create_handshake_type_server_key_exchange |
|
42 tls_completion_action_create_handshake_type_certificate_request, ///< create_handshake_type_certificate_request |
|
43 tls_completion_action_create_handshake_type_server_hello_done, ///< create_handshake_type_server_hello_done |
|
44 tls_completion_action_create_handshake_type_certificate_verify, ///< create_handshake_type_certificate_verify |
|
45 tls_completion_action_create_handshake_type_client_key_exchange, ///< create_handshake_type_client_key_exchange |
|
46 tls_completion_action_create_handshake_type_finished, ///< create_handshake_type_finished |
|
47 tls_completion_action_finish_handshake, ///< finish_handshake |
|
48 #if defined(USE_EAP_TLS_SESSION_TICKET) |
|
49 tls_completion_action_create_handshake_type_new_session_ticket, ///< create_handshake_type_new_session_ticket |
|
50 #endif //#if defined(USE_EAP_TLS_SESSION_TICKET) |
|
51 tls_completion_action_create_change_cipher_spec_type_change_cipher_spec, ///< create_change_cipher_spec_type_change_cipher_spec |
|
52 tls_completion_action_query_dh_parameters, ///< query_dh_parameters |
|
53 tls_completion_action_verify_certificate_chain, ///< verify_certificate_chain |
|
54 tls_completion_action_process_tls_records, ///< process_tls_records |
|
55 tls_completion_action_check_sent_tls_message, ///< check_sent_tls_message |
|
56 tls_completion_action_complete_create_handshake_type_server_key_exchange, ///< complete_create_handshake_type_server_key_exchange |
|
57 tls_completion_action_complete_create_handshake_type_certificate_verify, ///< complete_create_handshake_type_certificate_verify |
|
58 tls_completion_action_complete_create_handshake_type_client_key_exchange, ///< complete_create_handshake_type_client_key_exchange |
|
59 tls_completion_action_query_cipher_suites_and_previous_session, ///< query_cipher_suites_and_previous_session |
|
60 tls_completion_action_check_tunnel_authentication_runs, ///< check_tunnel_authentication_runs |
|
61 }; |
|
62 |
|
63 //---------------------------------------------------------------------------- |
|
64 |
|
65 |
|
66 /// This class defines one TLS completion action. |
|
67 class EAP_EXPORT tls_completion_c |
|
68 { |
|
69 private: |
|
70 //-------------------------------------------------- |
|
71 |
|
72 /// This is pointer to the tools class. @see abs_eap_am_tools_c. |
|
73 abs_eap_am_tools_c * const m_am_tools; |
|
74 |
|
75 /// This variable stores the completion action. |
|
76 tls_completion_action_e m_completion_action; |
|
77 |
|
78 /// This indicates whether this object was generated successfully. |
|
79 bool m_is_valid; |
|
80 |
|
81 /** |
|
82 * The set_is_valid() function sets the state of the object valid. |
|
83 * The creator of this object calls this function after it is initialized. |
|
84 */ |
|
85 EAP_FUNC_IMPORT void set_is_valid(); |
|
86 |
|
87 //-------------------------------------------------- |
|
88 protected: |
|
89 //-------------------------------------------------- |
|
90 |
|
91 //-------------------------------------------------- |
|
92 public: |
|
93 //-------------------------------------------------- |
|
94 |
|
95 /** |
|
96 * Destructor does nothing special. |
|
97 */ |
|
98 EAP_FUNC_IMPORT virtual ~tls_completion_c(); |
|
99 |
|
100 /** |
|
101 * Constructor initializes object. |
|
102 */ |
|
103 EAP_FUNC_IMPORT tls_completion_c( |
|
104 abs_eap_am_tools_c * const tools, |
|
105 tls_completion_action_e completion_action); |
|
106 |
|
107 /** |
|
108 * Object must indicate it's validity. |
|
109 * If object initialization fails this function must return false. |
|
110 * @return This function returns the validity of this object. |
|
111 */ |
|
112 EAP_FUNC_IMPORT bool get_is_valid(); |
|
113 |
|
114 /** |
|
115 * This function sets the completion action type. |
|
116 */ |
|
117 EAP_FUNC_IMPORT void set_completion_action(tls_completion_action_e completion_action); |
|
118 |
|
119 /** |
|
120 * This function gets the completion action type. |
|
121 */ |
|
122 EAP_FUNC_IMPORT tls_completion_action_e get_completion_action() const; |
|
123 |
|
124 /** |
|
125 * This function gets the debug string of the completion action type. |
|
126 */ |
|
127 EAP_FUNC_IMPORT eap_const_string get_completion_action_string() const; |
|
128 |
|
129 // |
|
130 //-------------------------------------------------- |
|
131 }; // class tls_completion_c |
|
132 |
|
133 |
|
134 //-------------------------------------------------- |
|
135 |
|
136 #endif //#if !defined(_TLS_COMPLETION_H_) |
|
137 |
|
138 |
|
139 |
|
140 // End. |