|
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 * %version: % |
|
20 */ |
|
21 |
|
22 #if !defined(_EAP_PAC_STORE_SERVER_MESSAGE_IF_H_) |
|
23 #define _EAP_PAC_STORE_SERVER_MESSAGE_IF_H_ |
|
24 |
|
25 #include "eap_tools.h" |
|
26 #include "eap_am_export.h" |
|
27 #include "abs_eap_session_core.h" |
|
28 #include "eap_variable_data.h" |
|
29 #include "abs_eap_am_mutex.h" |
|
30 #include "eap_session_core_base.h" |
|
31 #include "abs_eap_am_message_if.h" |
|
32 #include "eap_am_message_if.h" |
|
33 #include "eap_process_tlv_message_data.h" |
|
34 #include "abs_eap_am_pac_store.h" |
|
35 #include "eap_am_pac_store.h" |
|
36 |
|
37 |
|
38 /** @file */ |
|
39 |
|
40 |
|
41 /// A eap_pac_store_server_message_if_c class implements the basic functionality of EAPOL. |
|
42 class EAP_EXPORT eap_pac_store_server_message_if_c |
|
43 : public abs_eap_am_pac_store_c |
|
44 , public eap_am_message_if_c |
|
45 , public abs_eap_base_timer_c |
|
46 { |
|
47 |
|
48 private: |
|
49 //-------------------------------------------------- |
|
50 |
|
51 /// This is back pointer to object which created this object. |
|
52 abs_eap_am_message_if_c * m_partner; |
|
53 |
|
54 eap_am_pac_store_c * const m_am_client; |
|
55 |
|
56 /// This is pointer to the tools class. |
|
57 abs_eap_am_tools_c * const m_am_tools; |
|
58 |
|
59 eap_status_e m_error_code; |
|
60 |
|
61 eap_tlv_message_type_function_e m_error_function; |
|
62 |
|
63 /// This indicates whether this object is client (true) or server (false). |
|
64 /// In terms of EAP-protocol whether this network entity is EAP-supplicant (true) or EAP-authenticator (false). |
|
65 bool m_is_client; |
|
66 |
|
67 /// This indicates whether this object was generated successfully. |
|
68 bool m_is_valid; |
|
69 |
|
70 bool m_shutdown_was_called; |
|
71 |
|
72 eap_status_e send_error_message( |
|
73 const eap_status_e error_code, |
|
74 const eap_tlv_message_type_function_e function); |
|
75 |
|
76 eap_status_e send_message(eap_process_tlv_message_data_c * const message); |
|
77 |
|
78 eap_status_e process_message_type_error( |
|
79 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
80 |
|
81 eap_status_e process_message(eap_process_tlv_message_data_c * const message); |
|
82 |
|
83 eap_status_e open_pac_store(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
84 eap_status_e create_device_seed(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
85 eap_status_e is_master_key_present(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
86 eap_status_e is_master_key_and_password_matching(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
87 eap_status_e create_and_save_master_key(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
88 eap_status_e compare_pac_store_password(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
89 eap_status_e is_pacstore_password_present(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
90 eap_status_e set_pac_store_password(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
91 eap_status_e destroy_pac_store(EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
92 |
|
93 eap_status_e set_eap_methods( |
|
94 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
95 |
|
96 eap_status_e get_eap_methods( |
|
97 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
98 |
|
99 eap_status_e get_certificate_lists( |
|
100 EAP_TEMPLATE_CONST eap_array_c<eap_tlv_header_c> * const parameters); |
|
101 |
|
102 //-------------------------------------------------- |
|
103 protected: |
|
104 //-------------------------------------------------- |
|
105 |
|
106 //-------------------------------------------------- |
|
107 public: |
|
108 //-------------------------------------------------- |
|
109 |
|
110 /** |
|
111 * The destructor deletes the m_eap_core object. |
|
112 */ |
|
113 EAP_FUNC_IMPORT virtual ~eap_pac_store_server_message_if_c(); |
|
114 |
|
115 /** |
|
116 * The constructor creates the eap_core object and initializes the m_eap_core |
|
117 * to point the eap_core object. |
|
118 * @param tools is pointer to the tools class. @see abs_eap_am_tools_c. |
|
119 */ |
|
120 EAP_FUNC_IMPORT eap_pac_store_server_message_if_c( |
|
121 abs_eap_am_tools_c * const tools); |
|
122 |
|
123 static eap_pac_store_server_message_if_c * new_eap_pac_store_server_message_if_c( |
|
124 abs_eap_am_tools_c * const tools); |
|
125 |
|
126 EAP_FUNC_IMPORT void set_partner(abs_eap_am_message_if_c * const partner); |
|
127 |
|
128 EAP_FUNC_IMPORT eap_status_e process_data(const void * const data, const u32_t length); |
|
129 |
|
130 // This is documented in abs_eap_stack_interface_c::configure(). |
|
131 EAP_FUNC_IMPORT eap_status_e configure( |
|
132 const eap_variable_data_c * const client_configuration); |
|
133 |
|
134 // This is documented in abs_eap_stack_interface_c::shutdown(). |
|
135 EAP_FUNC_IMPORT eap_status_e shutdown(); |
|
136 |
|
137 // This is documented in abs_eap_stack_interface_c::set_is_valid(). |
|
138 EAP_FUNC_IMPORT void set_is_valid(); |
|
139 |
|
140 // This is documented in abs_eap_stack_interface_c::get_is_valid(). |
|
141 EAP_FUNC_IMPORT bool get_is_valid(); |
|
142 |
|
143 // See abs_eap_base_timer_c::timer_expired(). |
|
144 EAP_FUNC_IMPORT eap_status_e timer_expired( |
|
145 const u32_t id, void *data); |
|
146 |
|
147 // See abs_eap_base_timer_c::timer_delete_data(). |
|
148 EAP_FUNC_IMPORT eap_status_e timer_delete_data( |
|
149 const u32_t id, void *data); |
|
150 |
|
151 |
|
152 EAP_FUNC_IMPORT eap_status_e complete_open_pac_store( |
|
153 const eap_status_e completion_status); |
|
154 |
|
155 EAP_FUNC_IMPORT eap_status_e complete_create_device_seed( |
|
156 const eap_status_e completion_status); |
|
157 |
|
158 EAP_FUNC_IMPORT eap_status_e complete_is_master_key_present( |
|
159 const bool is_present); |
|
160 |
|
161 EAP_FUNC_IMPORT eap_status_e complete_is_master_key_and_password_matching( |
|
162 const bool is_matching); |
|
163 |
|
164 EAP_FUNC_IMPORT eap_status_e complete_create_and_save_master_key( |
|
165 const eap_status_e completion_status); |
|
166 |
|
167 EAP_FUNC_IMPORT eap_status_e complete_is_pacstore_password_present( |
|
168 const bool is_present); |
|
169 |
|
170 EAP_FUNC_IMPORT eap_status_e complete_compare_pac_store_password( |
|
171 const bool is_matching); |
|
172 |
|
173 EAP_FUNC_IMPORT eap_status_e complete_set_pac_store_password( |
|
174 const eap_status_e completion_status); |
|
175 |
|
176 EAP_FUNC_IMPORT eap_status_e complete_destroy_pac_store( |
|
177 const eap_status_e completion_status); |
|
178 |
|
179 //-------------------------------------------------- |
|
180 }; // class eap_pac_store_server_message_if_c |
|
181 |
|
182 #endif //#if !defined(_EAP_PAC_STORE_SERVER_MESSAGE_IF_H_) |
|
183 |
|
184 //-------------------------------------------------- |
|
185 |
|
186 |
|
187 |
|
188 // End. |