36 |
36 |
37 #include <e32base.h> |
37 #include <e32base.h> |
38 #include <e32std.h> |
38 #include <e32std.h> |
39 #include <d32dbms.h> |
39 #include <d32dbms.h> |
40 |
40 |
41 //#include <wdbifwlansettings.h> |
41 #include <wdbifwlansettings.h> |
42 |
42 |
43 #include <EapType.h> // For TIndexType |
43 #include <EapType.h> // For TIndexType |
|
44 |
|
45 |
|
46 #ifdef SYMBIAN_SECURE_DBMS |
|
47 // For EAP TLS, PEAP, TTLS, FAST secure databases. |
|
48 // Full path is not needed. The database eaptls.dat will be saved in the |
|
49 // data cage path for DBMS. So it will be in "\private\100012a5\eaptls.dat" in C: drive. |
|
50 // The maximum length of database name is 0x40 (KDbMaxName) , which is defined in d32dbms.h. |
|
51 |
|
52 _LIT(KFastDatabaseName, "c:eapfast.dat"); |
|
53 |
|
54 |
|
55 #else |
|
56 |
|
57 #ifdef USE_EAP_FAST_TYPE |
|
58 _LIT(KFastDatabaseName, "c:\\system\\data\\eapfast.dat"); |
|
59 #endif |
|
60 |
|
61 #endif // #ifdef SYMBIAN_SECURE_DBMS |
|
62 |
44 |
63 |
45 class CEapType; |
64 class CEapType; |
46 class abs_eapol_am_wlan_authentication_c; |
65 class abs_eapol_am_wlan_authentication_c; |
47 class abs_eap_am_tools_c; |
66 class abs_eap_am_tools_c; |
48 class eap_file_config_c; |
67 class eap_file_config_c; |
54 |
73 |
55 |
74 |
56 /// This class declares the simulator adaptation module of eapol_am_wlan_authentication_c. |
75 /// This class declares the simulator adaptation module of eapol_am_wlan_authentication_c. |
57 /// See comments of the functions from eapol_am_wlan_authentication_c. |
76 /// See comments of the functions from eapol_am_wlan_authentication_c. |
58 class EAP_EXPORT eapol_am_wlan_authentication_symbian_c |
77 class EAP_EXPORT eapol_am_wlan_authentication_symbian_c |
59 : public eapol_am_wlan_authentication_c |
78 : public CActive |
|
79 , public eapol_am_wlan_authentication_c |
60 #if defined(USE_EAP_SIMPLE_CONFIG) |
80 #if defined(USE_EAP_SIMPLE_CONFIG) |
61 , public abs_eap_configuration_if_c |
81 , public abs_eap_configuration_if_c |
62 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
82 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
63 { |
83 { |
64 private: |
84 private: |
82 eap_variable_data_c m_wpa_preshared_key; |
102 eap_variable_data_c m_wpa_preshared_key; |
83 |
103 |
84 /// HAHS of WPA(2)-PSK |
104 /// HAHS of WPA(2)-PSK |
85 eap_variable_data_c m_wpa_preshared_key_hash; |
105 eap_variable_data_c m_wpa_preshared_key_hash; |
86 |
106 |
87 /// Database reference to EAPOL settings. |
107 /// This pointer is abstract interface to reference of WLAN database of the current connection. |
88 eap_variable_data_c m_database_reference; |
108 const abs_eapol_wlan_database_reference_if_c * m_wlan_database_reference; |
89 |
109 |
90 /// Handle of database session. |
110 /// Handle of database session. |
91 RFs m_session; |
111 RDbs m_session; |
92 |
112 |
93 /// Handle of database file. |
113 /// Handle of database file. |
94 //RFs m_fs; |
114 RFs m_fs; |
|
115 |
|
116 /// Array for storing the loaded EAP types. |
|
117 RPointerArray<CEapType> m_plugin_if_array; |
|
118 |
|
119 #ifdef USE_EAP_EXPANDED_TYPES |
|
120 |
|
121 /// Enabled expanded EAP configuration data from CommsDat |
|
122 // This is for the outer most EAP (not tunneled) |
|
123 RExpandedEapTypeArray m_enabled_expanded_eap_array; |
|
124 |
|
125 /// Disabled expanded EAP configuration data from CommsDat |
|
126 // This is for the outer most EAP (not tunneled) |
|
127 RExpandedEapTypeArray m_disabled_expanded_eap_array; |
|
128 |
|
129 /// Array which corresponds with m_plugin_if_array and indicates the types of the loaded EAP types. |
|
130 eap_array_c<eap_type_value_e> m_eap_type_array; |
|
131 |
|
132 #else |
|
133 |
|
134 /// EAP configuration data from CommDb |
|
135 TEapArray m_iap_eap_array; |
|
136 |
|
137 /// Array which corresponds with m_plugin_if_array and indicates the types of the loaded EAP types. |
|
138 RArray<eap_type_value_e> m_eap_type_array; |
|
139 |
|
140 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
95 |
141 |
96 /// Network identity of current connection. |
142 /// Network identity of current connection. |
97 eap_am_network_id_c m_receive_network_id; |
143 eap_am_network_id_c m_receive_network_id; |
|
144 |
|
145 /// WLAN security mode as defined in Symbian platform. |
|
146 EWlanSecurityMode m_security_mode; |
98 |
147 |
99 /// WLAN authentication type. |
148 /// WLAN authentication type. |
100 eapol_key_authentication_type_e m_selected_eapol_key_authentication_type; |
149 eapol_key_authentication_type_e m_selected_eapol_key_authentication_type; |
101 |
150 |
102 /// WPA(2)-PSK override. |
151 /// WPA(2)-PSK override. |
145 void RetrievePSKL(TPSKEntry& entry); |
194 void RetrievePSKL(TPSKEntry& entry); |
146 |
195 |
147 /// This function saves WPA(2)-PSK to database. |
196 /// This function saves WPA(2)-PSK to database. |
148 void SavePSKL(TPSKEntry& entry); |
197 void SavePSKL(TPSKEntry& entry); |
149 |
198 |
150 /// This function reads WPA-settings from database. |
199 /// This function reads EAP-settings from database. |
151 void ReadWPASettingsL(); |
200 void ReadEAPSettingsL(); |
|
201 |
|
202 #ifdef USE_EAP_EXPANDED_TYPES |
|
203 |
|
204 /// This function set the EAP-type to highest in priority. |
|
205 void SetToTopPriorityL(const eap_type_value_e aEapType); |
|
206 |
|
207 #else // For normal EAP types. |
|
208 |
|
209 /// This function set the EAP-type to highest in priority. |
|
210 void SetToTopPriorityL(const TEap* const aEapType); |
|
211 |
|
212 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
152 |
213 |
153 /// THis function reads the references to active Internet Access Point (IAP). |
214 /// THis function reads the references to active Internet Access Point (IAP). |
154 eap_status_e read_database_reference_values( |
215 eap_status_e read_database_reference_values( |
155 TIndexType * const type, |
216 TIndexType * const type, |
156 TUint * const index); |
217 TUint * const index); |
157 |
218 |
|
219 /// This function resets all EAP-plugings. |
|
220 eap_status_e reset_eap_plugins(); |
|
221 |
158 /// This function sends error notification to partner object. |
222 /// This function sends error notification to partner object. |
159 void send_error_notification(const eap_status_e error); |
223 void send_error_notification(const eap_status_e error); |
160 |
224 |
161 //-------------------------------------------------- |
225 //-------------------------------------------------- |
162 public: |
226 public: |
166 EAP_FUNC_IMPORT virtual ~eapol_am_wlan_authentication_symbian_c(); |
230 EAP_FUNC_IMPORT virtual ~eapol_am_wlan_authentication_symbian_c(); |
167 |
231 |
168 // |
232 // |
169 EAP_FUNC_IMPORT eapol_am_wlan_authentication_symbian_c( |
233 EAP_FUNC_IMPORT eapol_am_wlan_authentication_symbian_c( |
170 abs_eap_am_tools_c * const tools, |
234 abs_eap_am_tools_c * const tools, |
171 const bool is_client_when_true); |
235 const bool is_client_when_true, |
|
236 const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference); |
172 |
237 |
173 |
238 |
174 /// See comments of the functions from eapol_am_wlan_authentication_c. |
239 /// See comments of the functions from eapol_am_wlan_authentication_c. |
175 |
240 |
176 EAP_FUNC_IMPORT bool get_is_valid(); |
241 EAP_FUNC_IMPORT bool get_is_valid(); |
184 #if defined(USE_EAP_SIMPLE_CONFIG) |
249 #if defined(USE_EAP_SIMPLE_CONFIG) |
185 , abs_eap_configuration_if_c * const configuration_if |
250 , abs_eap_configuration_if_c * const configuration_if |
186 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
251 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
187 ); |
252 ); |
188 |
253 |
189 EAP_FUNC_IMPORT eap_status_e reset_wpa_configuration(); |
254 EAP_FUNC_IMPORT eap_status_e reset_eap_configuration(); |
190 |
255 |
191 EAP_FUNC_IMPORT eap_status_e set_wlan_parameters( |
256 EAP_FUNC_IMPORT eap_status_e set_wlan_parameters( |
192 const eap_variable_data_c * const SSID, |
257 const eap_variable_data_c * const SSID, |
193 const bool WPA_override_enabled, |
258 const bool WPA_override_enabled, |
194 const eap_variable_data_c * const wpa_preshared_key, |
259 const eap_variable_data_c * const wpa_preshared_key, |
199 |
264 |
200 EAP_FUNC_IMPORT eap_status_e disassociation( |
265 EAP_FUNC_IMPORT eap_status_e disassociation( |
201 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
266 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
202 ); |
267 ); |
203 |
268 |
|
269 EAP_FUNC_IMPORT eap_status_e get_selected_eap_types( |
|
270 eap_array_c<eap_type_selection_c> * const selected_eap_types); |
|
271 |
204 EAP_FUNC_IMPORT eap_status_e get_wlan_configuration( |
272 EAP_FUNC_IMPORT eap_status_e get_wlan_configuration( |
205 eap_variable_data_c * const wpa_preshared_key_hash); |
273 eap_variable_data_c * const wpa_preshared_key_hash); |
206 |
274 |
207 EAP_FUNC_IMPORT eap_status_e authentication_finished( |
275 EAP_FUNC_IMPORT eap_status_e authentication_finished( |
208 const bool when_true_successfull, |
276 const bool when_true_successfull, |
209 const eap_type_value_e eap_type, |
277 const eap_type_value_e eap_type, |
210 const eapol_key_authentication_type_e authentication_type); |
278 const eapol_key_authentication_type_e authentication_type); |
|
279 |
|
280 EAP_FUNC_IMPORT eap_status_e load_module( |
|
281 const eap_type_value_e type, |
|
282 const eap_type_value_e tunneling_type, |
|
283 abs_eap_base_type_c * const partner, |
|
284 eap_base_type_c ** const eap_type_if, |
|
285 const bool is_client_when_true, |
|
286 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
|
287 ); |
|
288 |
|
289 EAP_FUNC_IMPORT eap_status_e unload_module( |
|
290 const eap_type_value_e type); |
211 |
291 |
212 EAP_FUNC_IMPORT eap_status_e read_configure( |
292 EAP_FUNC_IMPORT eap_status_e read_configure( |
213 const eap_configuration_field_c * const field, |
293 const eap_configuration_field_c * const field, |
214 eap_variable_data_c * const data); |
294 eap_variable_data_c * const data); |
215 |
295 |
227 abs_eap_base_timer_c * const initializer, |
307 abs_eap_base_timer_c * const initializer, |
228 const u32_t id); |
308 const u32_t id); |
229 |
309 |
230 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
310 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
231 |
311 |
|
312 EAP_FUNC_IMPORT eap_status_e check_is_valid_eap_type(const eap_type_value_e eap_type); |
|
313 |
|
314 EAP_FUNC_IMPORT eap_status_e get_eap_type_list( |
|
315 eap_array_c<eap_type_value_e> * const eap_type_list); |
|
316 |
232 EAP_FUNC_IMPORT void state_notification( |
317 EAP_FUNC_IMPORT void state_notification( |
233 const abs_eap_state_notification_c * const state); |
318 const abs_eap_state_notification_c * const state); |
234 |
319 |
235 #if defined(USE_EAP_SIMPLE_CONFIG) |
320 #if defined(USE_EAP_SIMPLE_CONFIG) |
236 |
321 |
237 EAP_FUNC_IMPORT eap_status_e save_simple_config_session( |
322 EAP_FUNC_EXPORT eap_status_e save_simple_config_session( |
238 const simple_config_state_e state, |
323 const simple_config_state_e state, |
239 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
324 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
240 const eap_variable_data_c * const new_password, |
325 const eap_variable_data_c * const new_password, |
241 const simple_config_Device_Password_ID_e Device_Password_ID, |
326 const simple_config_Device_Password_ID_e Device_Password_ID, |
242 const simple_config_payloads_c * const other_configuration); |
327 const simple_config_payloads_c * const other_configuration); |
243 |
328 |
244 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
329 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
245 |
330 |
246 EAP_FUNC_IMPORT eap_status_e set_eap_database_reference_values( |
|
247 const eap_variable_data_c * const reference); |
|
248 |
|
249 //-------------------------------------------------- |
331 //-------------------------------------------------- |
250 }; // class eapol_am_wlan_authentication_symbian_c |
332 }; // class eapol_am_wlan_authentication_symbian_c |
251 |
333 |
252 #endif //#if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_SYMBIAN_H_) |
334 #endif //#if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_SYMBIAN_H_) |
253 |
335 |