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 |
|
63 |
44 |
64 class CEapType; |
45 class CEapType; |
65 class abs_eapol_am_wlan_authentication_c; |
46 class abs_eapol_am_wlan_authentication_c; |
66 class abs_eap_am_tools_c; |
47 class abs_eap_am_tools_c; |
67 class eap_file_config_c; |
48 class eap_file_config_c; |
73 |
54 |
74 |
55 |
75 /// This class declares the simulator adaptation module of eapol_am_wlan_authentication_c. |
56 /// This class declares the simulator adaptation module of eapol_am_wlan_authentication_c. |
76 /// See comments of the functions from eapol_am_wlan_authentication_c. |
57 /// See comments of the functions from eapol_am_wlan_authentication_c. |
77 class EAP_EXPORT eapol_am_wlan_authentication_symbian_c |
58 class EAP_EXPORT eapol_am_wlan_authentication_symbian_c |
78 : public CActive |
59 : public eapol_am_wlan_authentication_c |
79 , public eapol_am_wlan_authentication_c |
|
80 #if defined(USE_EAP_SIMPLE_CONFIG) |
60 #if defined(USE_EAP_SIMPLE_CONFIG) |
81 , public abs_eap_configuration_if_c |
61 , public abs_eap_configuration_if_c |
82 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
62 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
83 { |
63 { |
84 private: |
64 private: |
102 eap_variable_data_c m_wpa_preshared_key; |
82 eap_variable_data_c m_wpa_preshared_key; |
103 |
83 |
104 /// HAHS of WPA(2)-PSK |
84 /// HAHS of WPA(2)-PSK |
105 eap_variable_data_c m_wpa_preshared_key_hash; |
85 eap_variable_data_c m_wpa_preshared_key_hash; |
106 |
86 |
107 /// This pointer is abstract interface to reference of WLAN database of the current connection. |
87 /// Database reference to EAPOL settings. |
108 const abs_eapol_wlan_database_reference_if_c * m_wlan_database_reference; |
88 eap_variable_data_c m_database_reference; |
109 |
89 |
110 /// Handle of database session. |
90 /// Handle of database session. |
111 RDbs m_session; |
91 RFs m_session; |
112 |
92 |
113 /// Handle of database file. |
93 /// Handle of database file. |
114 RFs m_fs; |
94 //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 |
|
141 |
95 |
142 /// Network identity of current connection. |
96 /// Network identity of current connection. |
143 eap_am_network_id_c m_receive_network_id; |
97 eap_am_network_id_c m_receive_network_id; |
144 |
|
145 /// WLAN security mode as defined in Symbian platform. |
|
146 EWlanSecurityMode m_security_mode; |
|
147 |
98 |
148 /// WLAN authentication type. |
99 /// WLAN authentication type. |
149 eapol_key_authentication_type_e m_selected_eapol_key_authentication_type; |
100 eapol_key_authentication_type_e m_selected_eapol_key_authentication_type; |
150 |
101 |
151 /// WPA(2)-PSK override. |
102 /// WPA(2)-PSK override. |
194 void RetrievePSKL(TPSKEntry& entry); |
145 void RetrievePSKL(TPSKEntry& entry); |
195 |
146 |
196 /// This function saves WPA(2)-PSK to database. |
147 /// This function saves WPA(2)-PSK to database. |
197 void SavePSKL(TPSKEntry& entry); |
148 void SavePSKL(TPSKEntry& entry); |
198 |
149 |
199 /// This function reads EAP-settings from database. |
150 /// This function reads WPA-settings from database. |
200 void ReadEAPSettingsL(); |
151 void ReadWPASettingsL(); |
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 |
|
213 |
152 |
214 /// THis function reads the references to active Internet Access Point (IAP). |
153 /// THis function reads the references to active Internet Access Point (IAP). |
215 eap_status_e read_database_reference_values( |
154 eap_status_e read_database_reference_values( |
216 TIndexType * const type, |
155 TIndexType * const type, |
217 TUint * const index); |
156 TUint * const index); |
218 |
157 |
219 /// This function resets all EAP-plugings. |
|
220 eap_status_e reset_eap_plugins(); |
|
221 |
|
222 /// This function sends error notification to partner object. |
158 /// This function sends error notification to partner object. |
223 void send_error_notification(const eap_status_e error); |
159 void send_error_notification(const eap_status_e error); |
224 |
160 |
225 //-------------------------------------------------- |
161 //-------------------------------------------------- |
226 public: |
162 public: |
230 EAP_FUNC_IMPORT virtual ~eapol_am_wlan_authentication_symbian_c(); |
166 EAP_FUNC_IMPORT virtual ~eapol_am_wlan_authentication_symbian_c(); |
231 |
167 |
232 // |
168 // |
233 EAP_FUNC_IMPORT eapol_am_wlan_authentication_symbian_c( |
169 EAP_FUNC_IMPORT eapol_am_wlan_authentication_symbian_c( |
234 abs_eap_am_tools_c * const tools, |
170 abs_eap_am_tools_c * const tools, |
235 const bool is_client_when_true, |
171 const bool is_client_when_true); |
236 const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference); |
|
237 |
172 |
238 |
173 |
239 /// See comments of the functions from eapol_am_wlan_authentication_c. |
174 /// See comments of the functions from eapol_am_wlan_authentication_c. |
240 |
175 |
241 EAP_FUNC_IMPORT bool get_is_valid(); |
176 EAP_FUNC_IMPORT bool get_is_valid(); |
249 #if defined(USE_EAP_SIMPLE_CONFIG) |
184 #if defined(USE_EAP_SIMPLE_CONFIG) |
250 , abs_eap_configuration_if_c * const configuration_if |
185 , abs_eap_configuration_if_c * const configuration_if |
251 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
186 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
252 ); |
187 ); |
253 |
188 |
254 EAP_FUNC_IMPORT eap_status_e reset_eap_configuration(); |
189 EAP_FUNC_IMPORT eap_status_e reset_wpa_configuration(); |
255 |
190 |
256 EAP_FUNC_IMPORT eap_status_e set_wlan_parameters( |
191 EAP_FUNC_IMPORT eap_status_e set_wlan_parameters( |
257 const eap_variable_data_c * const SSID, |
192 const eap_variable_data_c * const SSID, |
258 const bool WPA_override_enabled, |
193 const bool WPA_override_enabled, |
259 const eap_variable_data_c * const wpa_preshared_key, |
194 const eap_variable_data_c * const wpa_preshared_key, |
264 |
199 |
265 EAP_FUNC_IMPORT eap_status_e disassociation( |
200 EAP_FUNC_IMPORT eap_status_e disassociation( |
266 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
201 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
267 ); |
202 ); |
268 |
203 |
269 EAP_FUNC_IMPORT eap_status_e get_selected_eap_types( |
|
270 eap_array_c<eap_type_selection_c> * const selected_eap_types); |
|
271 |
|
272 EAP_FUNC_IMPORT eap_status_e get_wlan_configuration( |
204 EAP_FUNC_IMPORT eap_status_e get_wlan_configuration( |
273 eap_variable_data_c * const wpa_preshared_key_hash); |
205 eap_variable_data_c * const wpa_preshared_key_hash); |
274 |
206 |
275 EAP_FUNC_IMPORT eap_status_e authentication_finished( |
207 EAP_FUNC_IMPORT eap_status_e authentication_finished( |
276 const bool when_true_successfull, |
208 const bool when_true_successfull, |
277 const eap_type_value_e eap_type, |
209 const eap_type_value_e eap_type, |
278 const eapol_key_authentication_type_e authentication_type); |
210 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); |
|
291 |
211 |
292 EAP_FUNC_IMPORT eap_status_e read_configure( |
212 EAP_FUNC_IMPORT eap_status_e read_configure( |
293 const eap_configuration_field_c * const field, |
213 const eap_configuration_field_c * const field, |
294 eap_variable_data_c * const data); |
214 eap_variable_data_c * const data); |
295 |
215 |
307 abs_eap_base_timer_c * const initializer, |
227 abs_eap_base_timer_c * const initializer, |
308 const u32_t id); |
228 const u32_t id); |
309 |
229 |
310 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
230 EAP_FUNC_IMPORT eap_status_e cancel_all_timers(); |
311 |
231 |
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 |
|
317 EAP_FUNC_IMPORT void state_notification( |
232 EAP_FUNC_IMPORT void state_notification( |
318 const abs_eap_state_notification_c * const state); |
233 const abs_eap_state_notification_c * const state); |
319 |
234 |
320 #if defined(USE_EAP_SIMPLE_CONFIG) |
235 #if defined(USE_EAP_SIMPLE_CONFIG) |
321 |
236 |
322 EAP_FUNC_EXPORT eap_status_e save_simple_config_session( |
237 EAP_FUNC_IMPORT eap_status_e save_simple_config_session( |
323 const simple_config_state_e state, |
238 const simple_config_state_e state, |
324 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
239 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const credential_array, |
325 const eap_variable_data_c * const new_password, |
240 const eap_variable_data_c * const new_password, |
326 const simple_config_Device_Password_ID_e Device_Password_ID, |
241 const simple_config_Device_Password_ID_e Device_Password_ID, |
327 const simple_config_payloads_c * const other_configuration); |
242 const simple_config_payloads_c * const other_configuration); |
328 |
243 |
329 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
244 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
330 |
245 |
|
246 EAP_FUNC_IMPORT eap_status_e set_eap_database_reference_values( |
|
247 const eap_variable_data_c * const reference); |
|
248 |
331 //-------------------------------------------------- |
249 //-------------------------------------------------- |
332 }; // class eapol_am_wlan_authentication_symbian_c |
250 }; // class eapol_am_wlan_authentication_symbian_c |
333 |
251 |
334 #endif //#if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_SYMBIAN_H_) |
252 #endif //#if !defined(_EAPOL_AM_WLAN_AUTHENTICATION_SYMBIAN_H_) |
335 |
253 |