66 EAP_TRACE_DEBUG( |
68 EAP_TRACE_DEBUG( |
67 m_am_tools, |
69 m_am_tools, |
68 TRACE_FLAGS_DEFAULT, |
70 TRACE_FLAGS_DEFAULT, |
69 (EAPL("eapol_am_wlan_authentication_symbian_c::~eapol_am_wlan_authentication_symbian_c(): this = 0x%08x\n"), |
71 (EAPL("eapol_am_wlan_authentication_symbian_c::~eapol_am_wlan_authentication_symbian_c(): this = 0x%08x\n"), |
70 this)); |
72 this)); |
71 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::~eapol_am_wlan_authentication_symbian_c()"); |
|
72 } |
73 } |
73 |
74 |
74 //-------------------------------------------------- |
75 //-------------------------------------------------- |
75 |
76 |
76 // |
77 // |
77 EAP_FUNC_EXPORT eapol_am_wlan_authentication_symbian_c::eapol_am_wlan_authentication_symbian_c( |
78 EAP_FUNC_EXPORT eapol_am_wlan_authentication_symbian_c::eapol_am_wlan_authentication_symbian_c( |
78 abs_eap_am_tools_c * const tools, |
79 abs_eap_am_tools_c * const tools, |
79 const bool is_client_when_true) |
80 const bool is_client_when_true, |
80 : m_am_partner(0) |
81 const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference) |
|
82 : CActive(CActive::EPriorityStandard) |
|
83 , m_am_partner(0) |
81 #if defined(USE_EAP_SIMPLE_CONFIG) |
84 #if defined(USE_EAP_SIMPLE_CONFIG) |
82 , m_configuration_if(0) |
85 , m_configuration_if(0) |
83 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
86 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
84 , m_am_tools(tools) |
87 , m_am_tools(tools) |
85 , m_fileconfig(0) |
88 , m_fileconfig(0) |
86 , m_SSID(tools) |
89 , m_SSID(tools) |
87 , m_wpa_preshared_key(tools) |
90 , m_wpa_preshared_key(tools) |
88 , m_wpa_preshared_key_hash(tools) |
91 , m_wpa_preshared_key_hash(tools) |
89 , m_database_reference(tools) |
92 , m_wlan_database_reference(wlan_database_reference) |
|
93 #ifdef USE_EAP_EXPANDED_TYPES |
|
94 , m_eap_type_array(tools) |
|
95 #endif |
90 , m_receive_network_id(tools) |
96 , m_receive_network_id(tools) |
|
97 , m_security_mode(Wpa) |
91 , m_selected_eapol_key_authentication_type(eapol_key_authentication_type_none) |
98 , m_selected_eapol_key_authentication_type(eapol_key_authentication_type_none) |
92 , m_WPA_override_enabled(false) |
99 , m_WPA_override_enabled(false) |
93 , m_is_client(is_client_when_true) |
100 , m_is_client(is_client_when_true) |
94 , m_is_valid(false) |
101 , m_is_valid(false) |
95 |
102 |
96 { |
103 { |
97 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
104 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
98 |
105 |
99 EAP_TRACE_DEBUG( |
|
100 m_am_tools, |
|
101 TRACE_FLAGS_DEFAULT, |
|
102 (EAPL("eapol_am_wlan_authentication_symbian_c::eapol_am_wlan_authentication_symbian_c(): this = 0x%08x\n"), |
|
103 this)); |
|
104 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::eapol_am_wlan_authentication_symbian_c()"); |
|
105 |
|
106 m_is_valid = true; |
106 m_is_valid = true; |
107 |
107 |
108 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
108 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
109 } |
109 } |
110 |
110 |
111 //-------------------------------------------------- |
111 //-------------------------------------------------- |
112 |
112 |
113 EAP_FUNC_EXPORT bool eapol_am_wlan_authentication_symbian_c::get_is_valid() |
113 EAP_FUNC_EXPORT bool eapol_am_wlan_authentication_symbian_c::get_is_valid() |
114 { |
114 { |
115 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
115 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
116 |
|
117 EAP_TRACE_DEBUG( |
|
118 m_am_tools, |
|
119 TRACE_FLAGS_DEFAULT, |
|
120 (EAPL("eapol_am_wlan_authentication_symbian_c::get_is_valid(): this = 0x%08x\n"), |
|
121 this)); |
|
122 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::get_is_valid()"); |
|
123 |
116 |
124 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
117 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
125 return m_is_valid; |
118 return m_is_valid; |
126 } |
119 } |
127 |
120 |
131 { |
124 { |
132 EAP_TRACE_DEBUG( |
125 EAP_TRACE_DEBUG( |
133 m_am_tools, |
126 m_am_tools, |
134 TRACE_FLAGS_DEFAULT, |
127 TRACE_FLAGS_DEFAULT, |
135 (EAPL("eapol_am_wlan_authentication_symbian_c::TryOpenDatabaseL()\n"))); |
128 (EAPL("eapol_am_wlan_authentication_symbian_c::TryOpenDatabaseL()\n"))); |
136 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::TryInitDatabaseL()"); |
|
137 |
129 |
138 // 1. Open/create a database |
130 // 1. Open/create a database |
139 RDbNamedDatabase db; |
131 RDbNamedDatabase db; |
140 |
132 |
|
133 #ifdef SYMBIAN_SECURE_DBMS |
|
134 |
141 // Create the secure shared database (if necessary) with the specified secure policy. |
135 // Create the secure shared database (if necessary) with the specified secure policy. |
142 // Database will be created in the data caging path for DBMS (C:\private\100012a5). |
136 // Database will be created in the data caging path for DBMS (C:\private\100012a5). |
143 |
137 |
144 TFileName aPrivateDatabasePathName; |
138 TInt err = db.Create(m_session, KDatabaseName, KSecureUIDFormat); |
145 |
|
146 EapPluginTools::GetPrivatePathL( |
|
147 m_session, |
|
148 aPrivateDatabasePathName); |
|
149 |
|
150 aPrivateDatabasePathName.Append(KEapolDatabaseName); |
|
151 |
|
152 EAP_TRACE_DATA_DEBUG_SYMBIAN(("aPrivateDatabasePathName", |
|
153 aPrivateDatabasePathName.Ptr(), |
|
154 aPrivateDatabasePathName.Size())); |
|
155 |
|
156 TInt error = db.Create(m_session, aPrivateDatabasePathName); |
|
157 |
139 |
158 EAP_TRACE_DEBUG( |
140 EAP_TRACE_DEBUG( |
159 m_am_tools, |
141 m_am_tools, |
160 TRACE_FLAGS_DEFAULT, |
142 TRACE_FLAGS_DEFAULT, |
161 (EAPL("TryOpenDatabaseL() - Created Secure DB for eapol.dat. error=%d\n"), error )); |
143 (EAPL("TryOpenDatabaseL() - Created Secure DB for eapol.dat. err=%d\n"), err )); |
162 |
144 |
163 if(error == KErrNone) |
145 if(err == KErrNone) |
164 { |
146 { |
165 db.Close(); |
147 db.Close(); |
166 |
148 |
167 } else if (error != KErrAlreadyExists) |
149 } else if (err != KErrAlreadyExists) |
168 { |
150 { |
169 User::LeaveIfError(error); |
151 User::LeaveIfError(err); |
170 } |
152 } |
171 |
153 |
172 User::LeaveIfError(db.Open(m_session, aPrivateDatabasePathName)); |
154 User::LeaveIfError(db.Open(m_session, KDatabaseName, KSecureUIDFormat)); |
173 |
155 |
|
156 #else |
|
157 // For non-secured database. The database will be created in the old location (c:\system\data). |
|
158 |
|
159 // Create the database (if necessary) |
|
160 TInt err = db.Create(m_fs, KDatabaseName); |
|
161 |
|
162 EAP_TRACE_DEBUG( |
|
163 m_am_tools, |
|
164 TRACE_FLAGS_DEFAULT, |
|
165 (EAPL("TryOpenDatabaseL() - Created Non-Secure DB for eapol.dat. err=%d\n"), err )); |
|
166 |
|
167 if(err == KErrNone) |
|
168 { |
|
169 db.Close(); |
|
170 |
|
171 } else if (err != KErrAlreadyExists) |
|
172 { |
|
173 User::LeaveIfError(err); |
|
174 } |
|
175 |
|
176 User::LeaveIfError(db.Open(m_session, KDatabaseName)); |
|
177 |
|
178 #endif // #ifdef SYMBIAN_SECURE_DBMS |
|
179 |
174 CleanupClosePushL(db); |
180 CleanupClosePushL(db); |
175 |
181 |
176 HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
182 HBufC* buf = HBufC::NewLC(KMaxSqlQueryLength); |
177 TPtr sqlStatement = buf->Des(); |
183 TPtr sqlStatement = buf->Des(); |
178 |
184 |
190 %S VARBINARY(255), \ |
196 %S VARBINARY(255), \ |
191 %S VARBINARY(255), \ |
197 %S VARBINARY(255), \ |
192 %S VARBINARY(255))"); |
198 %S VARBINARY(255))"); |
193 sqlStatement.Format(KSQLCreateTable2, &KEapolPSKTableName, |
199 sqlStatement.Format(KSQLCreateTable2, &KEapolPSKTableName, |
194 &KServiceType, &KServiceIndex, &KSSID, &KPassword, &KPSK); |
200 &KServiceType, &KServiceIndex, &KSSID, &KPassword, &KPSK); |
195 error = db.Execute(sqlStatement); |
201 err = db.Execute(sqlStatement); |
196 if (error != KErrNone && error != KErrAlreadyExists) |
202 if (err != KErrNone && err != KErrAlreadyExists) |
197 { |
203 { |
198 User::Leave(error); |
204 User::Leave(err); |
199 } |
205 } |
200 |
206 |
201 CleanupStack::PopAndDestroy(buf); |
207 CleanupStack::PopAndDestroy(); // buf |
202 |
208 |
203 // If compacting is not done the database will start growing |
209 // If compacting is not done the database will start growing |
204 db.Compact(); |
210 db.Compact(); |
205 |
211 |
206 CleanupStack::PopAndDestroy(&db); |
212 CleanupStack::PopAndDestroy(); // Close database |
207 } |
213 } |
208 |
214 |
209 //-------------------------------------------------- |
215 //-------------------------------------------------- |
210 |
216 |
211 void eapol_am_wlan_authentication_symbian_c::InitDatabaseL() |
217 void eapol_am_wlan_authentication_symbian_c::InitDatabaseL() |
212 { |
218 { |
213 EAP_TRACE_DEBUG( |
219 EAP_TRACE_DEBUG( |
214 m_am_tools, |
220 m_am_tools, |
215 TRACE_FLAGS_DEFAULT, |
221 TRACE_FLAGS_DEFAULT, |
216 (EAPL("eapol_am_wlan_authentication_symbian_c::InitDatabaseL()\n"))); |
222 (EAPL("eapol_am_wlan_authentication_symbian_c::OpenDatabaseL()\n"))); |
217 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::InitDatabaseL()"); |
|
218 |
223 |
219 // Create the database (if necessary) |
224 // Create the database (if necessary) |
220 TRAPD(error, TryInitDatabaseL()); |
225 TRAPD(err, TryInitDatabaseL()); |
221 if (error != KErrNone) |
226 if (err != KErrNone) |
222 { |
227 { |
223 // Because of error remove the database file. |
228 // Because of error remove the database file. |
224 TFileName aPrivateDatabasePathName; |
229 err = m_fs.Delete(KDatabaseName); |
225 |
230 if(err != KErrNone) |
226 EapPluginTools::GetPrivatePathL( |
|
227 m_session, |
|
228 aPrivateDatabasePathName); |
|
229 |
|
230 aPrivateDatabasePathName.Append(KEapolDatabaseName); |
|
231 |
|
232 EAP_TRACE_DATA_DEBUG_SYMBIAN(("aPrivateDatabasePathName", |
|
233 aPrivateDatabasePathName.Ptr(), |
|
234 aPrivateDatabasePathName.Size())); |
|
235 |
|
236 error = m_session.Delete(aPrivateDatabasePathName); |
|
237 if(error != KErrNone) |
|
238 { |
231 { |
239 User::Leave(KErrCorrupt); |
232 User::Leave(KErrCorrupt); |
240 } |
233 } |
241 |
234 |
242 // Try open database again. This will leave if fails second time. |
235 // Try open database again. This will leave if fails second time. |
255 TRACE_FLAGS_DEFAULT, |
248 TRACE_FLAGS_DEFAULT, |
256 (EAPL("eapol_am_wlan_authentication_symbian_c::configure(): %s, this = 0x%08x => 0x%08x\n"), |
249 (EAPL("eapol_am_wlan_authentication_symbian_c::configure(): %s, this = 0x%08x => 0x%08x\n"), |
257 (m_is_client == true) ? "client": "server", |
250 (m_is_client == true) ? "client": "server", |
258 this, |
251 this, |
259 dynamic_cast<abs_eap_base_timer_c *>(this))); |
252 dynamic_cast<abs_eap_base_timer_c *>(this))); |
260 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::configure()"); |
|
261 |
253 |
262 TInt error(KErrNone); |
254 TInt error(KErrNone); |
263 eap_status_e status(eap_status_process_general_error); |
|
264 |
255 |
265 // Open the database session |
256 // Open the database session |
266 error = m_session.Connect(); |
257 error = m_session.Connect(); |
267 if (error != KErrNone) |
258 if (error != KErrNone) |
268 { |
259 { |
269 eap_status_e status(m_am_tools->convert_am_error_to_eapol_error(error)); |
260 eap_status_e status(m_am_tools->convert_am_error_to_eapol_error(error)); |
270 |
261 |
271 EAP_TRACE_DEBUG( |
262 EAP_TRACE_DEBUG( |
272 m_am_tools, |
263 m_am_tools, |
273 TRACE_FLAGS_DEFAULT, |
264 TRACE_FLAGS_DEFAULT, |
274 (EAPL("ERROR: RDbs::Connect() failed %d=%s.\n"), |
265 (EAPL("RDbs::Connect() failed %d.\n"), |
275 status, |
266 status)); |
276 eap_status_string_c::get_status_string(status))); |
|
277 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
267 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
278 return EAP_STATUS_RETURN(m_am_tools, status); |
268 return EAP_STATUS_RETURN(m_am_tools, status); |
279 } |
269 } |
280 |
270 |
281 EAP_TRACE_DEBUG( |
271 EAP_TRACE_DEBUG( |
282 m_am_tools, |
272 m_am_tools, |
283 TRACE_FLAGS_DEFAULT, |
273 TRACE_FLAGS_DEFAULT, |
284 (EAPL("Database session initialized...\n"))); |
274 (EAPL("Database session initialized...\n"))); |
285 |
275 |
286 // Initialize database |
276 // Connect to FS |
287 TRAP(error, InitDatabaseL()); |
277 error = m_fs.Connect(); |
288 if (error != KErrNone) |
278 if (error != KErrNone) |
289 { |
279 { |
290 eap_status_e status(m_am_tools->convert_am_error_to_eapol_error(error)); |
280 eap_status_e status(m_am_tools->convert_am_error_to_eapol_error(error)); |
291 |
281 |
292 EAP_TRACE_DEBUG( |
282 EAP_TRACE_DEBUG( |
293 m_am_tools, |
283 m_am_tools, |
294 TRACE_FLAGS_DEFAULT, |
284 TRACE_FLAGS_DEFAULT, |
295 (EAPL("ERROR: InitDatabaseL failed %d=%s.\n"), |
285 (EAPL("RFs::Connect() failed %d.\n"), |
296 status, |
286 status)); |
297 eap_status_string_c::get_status_string(status))); |
287 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
288 return EAP_STATUS_RETURN(m_am_tools, status); |
|
289 } |
|
290 |
|
291 EAP_TRACE_DEBUG( |
|
292 m_am_tools, |
|
293 TRACE_FLAGS_DEFAULT, |
|
294 (EAPL("Fileserver session initialized...\n"))); |
|
295 |
|
296 // Initialize database |
|
297 TRAPD(err, InitDatabaseL()); |
|
298 if (err != KErrNone) |
|
299 { |
|
300 eap_status_e status(m_am_tools->convert_am_error_to_eapol_error(error)); |
|
301 |
|
302 EAP_TRACE_DEBUG( |
|
303 m_am_tools, |
|
304 TRACE_FLAGS_DEFAULT, |
|
305 (EAPL("InitDatabaseL failed %d.\n"), |
|
306 status)); |
298 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
307 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
299 return EAP_STATUS_RETURN(m_am_tools, status); |
308 return EAP_STATUS_RETURN(m_am_tools, status); |
300 } |
309 } |
301 |
310 |
302 EAP_TRACE_DEBUG( |
311 EAP_TRACE_DEBUG( |
304 TRACE_FLAGS_DEFAULT, |
313 TRACE_FLAGS_DEFAULT, |
305 (EAPL("Database initialized...\n"))); |
314 (EAPL("Database initialized...\n"))); |
306 |
315 |
307 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
316 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
308 |
317 |
309 status = EapConfigToolsSymbian::EapReadDefaultConfigFileSymbian( |
318 #if defined(USE_EAP_FILECONFIG) |
310 m_am_tools, |
319 { |
311 &m_fileconfig); |
320 eap_am_file_input_symbian_c * const fileio = new eap_am_file_input_symbian_c(m_am_tools); |
312 if (status != eap_status_ok) |
321 |
313 { |
322 eap_automatic_variable_c<eap_am_file_input_symbian_c> automatic_fileio(m_am_tools, fileio); |
314 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
323 |
315 return EAP_STATUS_RETURN(m_am_tools, status); |
324 if (fileio != 0 |
316 } |
325 && fileio->get_is_valid() == true) |
|
326 { |
|
327 EAP_TRACE_DEBUG( |
|
328 m_am_tools, |
|
329 TRACE_FLAGS_DEFAULT, |
|
330 (EAPL("Initialize file configuration.\n"))); |
|
331 |
|
332 eap_variable_data_c file_name_c_data(m_am_tools); |
|
333 |
|
334 eap_status_e status(eap_status_process_general_error); |
|
335 |
|
336 { |
|
337 #if defined(EAPOL_SYMBIAN_VERSION_7_0_s) |
|
338 eap_const_string const FILECONFIG_FILENAME_C |
|
339 = "c:\\system\\data\\eap.conf"; |
|
340 #else |
|
341 eap_const_string const FILECONFIG_FILENAME_C |
|
342 = "c:\\private\\101F8EC5\\eap.conf"; |
|
343 #endif |
|
344 |
|
345 status = file_name_c_data.set_copy_of_buffer( |
|
346 FILECONFIG_FILENAME_C, |
|
347 m_am_tools->strlen(FILECONFIG_FILENAME_C)); |
|
348 if (status != eap_status_ok) |
|
349 { |
|
350 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
351 return EAP_STATUS_RETURN(m_am_tools, status); |
|
352 } |
|
353 |
|
354 status = file_name_c_data.add_end_null(); |
|
355 if (status != eap_status_ok) |
|
356 { |
|
357 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
358 return EAP_STATUS_RETURN(m_am_tools, status); |
|
359 } |
|
360 } |
|
361 |
|
362 eap_variable_data_c file_name_z_data(m_am_tools); |
|
363 |
|
364 { |
|
365 #if defined(EAPOL_SYMBIAN_VERSION_7_0_s) |
|
366 eap_const_string const FILECONFIG_FILENAME_Z |
|
367 = "z:\\system\\data\\eap.conf"; |
|
368 #else |
|
369 eap_const_string const FILECONFIG_FILENAME_Z |
|
370 = "z:\\private\\101F8EC5\\eap.conf"; |
|
371 #endif |
|
372 |
|
373 status = file_name_z_data.set_copy_of_buffer( |
|
374 FILECONFIG_FILENAME_Z, |
|
375 m_am_tools->strlen(FILECONFIG_FILENAME_Z)); |
|
376 if (status != eap_status_ok) |
|
377 { |
|
378 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
379 return EAP_STATUS_RETURN(m_am_tools, status); |
|
380 } |
|
381 |
|
382 status = file_name_z_data.add_end_null(); |
|
383 if (status != eap_status_ok) |
|
384 { |
|
385 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
386 return EAP_STATUS_RETURN(m_am_tools, status); |
|
387 } |
|
388 } |
|
389 |
|
390 |
|
391 |
|
392 if (status == eap_status_ok) |
|
393 { |
|
394 // First try open from C: disk. |
|
395 status = fileio->file_open( |
|
396 &file_name_c_data, |
|
397 eap_file_io_direction_read); |
|
398 if (status == eap_status_ok) |
|
399 { |
|
400 EAP_TRACE_DEBUG( |
|
401 m_am_tools, |
|
402 TRACE_FLAGS_DEFAULT, |
|
403 (EAPL("Opens configure file %s\n"), |
|
404 file_name_c_data.get_data(file_name_c_data.get_data_length()))); |
|
405 } |
|
406 else if (status != eap_status_ok) |
|
407 { |
|
408 // Second try open from Z: disk. |
|
409 status = fileio->file_open( |
|
410 &file_name_z_data, |
|
411 eap_file_io_direction_read); |
|
412 if (status == eap_status_ok) |
|
413 { |
|
414 EAP_TRACE_DEBUG( |
|
415 m_am_tools, |
|
416 TRACE_FLAGS_DEFAULT, |
|
417 (EAPL("Opens configure file %s\n"), |
|
418 file_name_z_data.get_data(file_name_z_data.get_data_length()))); |
|
419 } |
|
420 } |
|
421 |
|
422 if (status == eap_status_ok) |
|
423 { |
|
424 // Some of the files were opened. |
|
425 |
|
426 m_fileconfig = new eap_file_config_c(m_am_tools); |
|
427 if (m_fileconfig != 0 |
|
428 && m_fileconfig->get_is_valid() == true) |
|
429 { |
|
430 status = m_fileconfig->configure(fileio); |
|
431 if (status != eap_status_ok) |
|
432 { |
|
433 EAP_TRACE_DEBUG( |
|
434 m_am_tools, |
|
435 TRACE_FLAGS_DEFAULT, |
|
436 (EAPL("ERROR: Configure read from %s failed.\n"), |
|
437 file_name_c_data.get_data(file_name_c_data.get_data_length()))); |
|
438 } |
|
439 else |
|
440 { |
|
441 EAP_TRACE_DEBUG( |
|
442 m_am_tools, |
|
443 TRACE_FLAGS_DEFAULT, |
|
444 (EAPL("Configure read from %s\n"), |
|
445 file_name_c_data.get_data(file_name_c_data.get_data_length()))); |
|
446 } |
|
447 } |
|
448 else |
|
449 { |
|
450 // No file configuration. |
|
451 delete m_fileconfig; |
|
452 m_fileconfig = 0; |
|
453 |
|
454 EAP_TRACE_DEBUG( |
|
455 m_am_tools, |
|
456 TRACE_FLAGS_DEFAULT, |
|
457 (EAPL("ERROR: Cannot create configure object for file %s\n"), |
|
458 file_name_c_data.get_data(file_name_c_data.get_data_length()))); |
|
459 } |
|
460 } |
|
461 else |
|
462 { |
|
463 EAP_TRACE_DEBUG( |
|
464 m_am_tools, |
|
465 TRACE_FLAGS_DEFAULT, |
|
466 (EAPL("ERROR: Cannot open configure file neither %s nor %s\n"), |
|
467 file_name_c_data.get_data(file_name_c_data.get_data_length()), |
|
468 file_name_z_data.get_data(file_name_z_data.get_data_length()))); |
|
469 } |
|
470 } |
|
471 } |
|
472 else |
|
473 { |
|
474 EAP_TRACE_DEBUG( |
|
475 m_am_tools, |
|
476 TRACE_FLAGS_DEFAULT, |
|
477 (EAPL("Skips file configuration.\n"))); |
|
478 } |
|
479 } |
|
480 #endif //#if defined(USE_EAP_FILECONFIG) |
317 |
481 |
318 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
482 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
319 |
483 |
320 #if defined(USE_EAP_FILE_TRACE) |
484 #if defined(USE_EAP_FILE_TRACE) |
321 { |
485 { |
322 eap_variable_data_c trace_output_file(m_am_tools); |
486 eap_variable_data_c trace_output_file(m_am_tools); |
323 |
487 |
324 status = read_configure( |
488 eap_status_e status = read_configure( |
325 cf_str_EAP_TRACE_output_file_name.get_field(), |
489 cf_str_EAP_TRACE_output_file_name.get_field(), |
326 &trace_output_file); |
490 &trace_output_file); |
327 if (status == eap_status_ok |
491 if (status == eap_status_ok |
328 && trace_output_file.get_is_valid_data() == true) |
492 && trace_output_file.get_is_valid_data() == true) |
329 { |
493 { |
648 TRACE_FLAGS_DEFAULT, |
820 TRACE_FLAGS_DEFAULT, |
649 (EAPL("eapol_am_wlan_authentication_symbian_c::disassociation(): %s, this = 0x%08x => 0x%08x\n"), |
821 (EAPL("eapol_am_wlan_authentication_symbian_c::disassociation(): %s, this = 0x%08x => 0x%08x\n"), |
650 (m_is_client == true) ? "client": "server", |
822 (m_is_client == true) ? "client": "server", |
651 this, |
823 this, |
652 dynamic_cast<abs_eap_base_timer_c *>(this))); |
824 dynamic_cast<abs_eap_base_timer_c *>(this))); |
653 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::disassociation()"); |
|
654 |
825 |
655 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
826 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
656 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
827 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
657 } |
828 } |
|
829 |
|
830 //-------------------------------------------------- |
|
831 |
|
832 #ifdef USE_EAP_EXPANDED_TYPES |
|
833 |
|
834 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::get_selected_eap_types( |
|
835 eap_array_c<eap_type_selection_c> * const selected_eap_types) |
|
836 { |
|
837 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
838 |
|
839 EAP_TRACE_DEBUG( |
|
840 m_am_tools, |
|
841 TRACE_FLAGS_DEFAULT, |
|
842 (EAPL("eapol_am_wlan_authentication_symbian_c::get_selected_eap_types(): %s, this = 0x%08x => 0x%08x\n"), |
|
843 (m_is_client == true) ? "client": "server", |
|
844 this, |
|
845 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
846 |
|
847 eap_status_e status = selected_eap_types->reset(); |
|
848 if (status != eap_status_ok) |
|
849 { |
|
850 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
851 return EAP_STATUS_RETURN(m_am_tools, status); |
|
852 } |
|
853 |
|
854 eap_header_string_c eap_string; |
|
855 EAP_UNREFERENCED_PARAMETER(eap_string); |
|
856 |
|
857 // We need to return only the EAP types available as enabled types. |
|
858 // It means only the ones available in m_enabled_expanded_eap_array. |
|
859 |
|
860 for (TInt i = 0; i < m_enabled_expanded_eap_array.Count(); i++) |
|
861 { |
|
862 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[i]->EapExpandedType); |
|
863 |
|
864 EAP_TRACE_DEBUG( |
|
865 m_am_tools, |
|
866 TRACE_FLAGS_DEFAULT, |
|
867 (EAPL("eapol_am_wlan_authentication_symbian_c::get_selected_eap_types:Enabled expanded EAP type at index=%d\n"), |
|
868 i)); |
|
869 |
|
870 EAP_TRACE_DATA_DEBUG( |
|
871 m_am_tools, |
|
872 TRACE_FLAGS_DEFAULT, |
|
873 (EAPL("Enabled expanded EAP type"), |
|
874 tmpExpEAP.Ptr(), |
|
875 tmpExpEAP.Size())); |
|
876 |
|
877 // This is for one expanded EAP type (for the above one). |
|
878 eap_expanded_type_c expandedEAPType; |
|
879 |
|
880 // Read the expanded EAP type details from an item in m_enabled_expanded_eap_array. |
|
881 status = eap_expanded_type_c::read_type(m_am_tools, |
|
882 0, |
|
883 tmpExpEAP.Ptr(), |
|
884 tmpExpEAP.Size(), |
|
885 &expandedEAPType); |
|
886 if (status != eap_status_ok) |
|
887 { |
|
888 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
889 return EAP_STATUS_RETURN(m_am_tools, status); |
|
890 } |
|
891 |
|
892 // Add EAP-type to list. |
|
893 eap_type_selection_c * selection = new eap_type_selection_c( |
|
894 m_am_tools, |
|
895 expandedEAPType, |
|
896 true); |
|
897 if (selection != 0) |
|
898 { |
|
899 status = selected_eap_types->add_object(selection, true); |
|
900 if (status != eap_status_ok) |
|
901 { |
|
902 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
903 return EAP_STATUS_RETURN(m_am_tools, status); |
|
904 } |
|
905 |
|
906 EAP_TRACE_DEBUG( |
|
907 m_am_tools, |
|
908 TRACE_FLAGS_DEFAULT, |
|
909 (EAPL("get_selected_eap_types(): added EAP-type=0x%08x=%s\n"), |
|
910 expandedEAPType.get_vendor_type(), |
|
911 eap_string.get_eap_type_string(expandedEAPType))); |
|
912 } |
|
913 else |
|
914 { |
|
915 // On error we ignore this EAP-type. |
|
916 EAP_TRACE_DEBUG( |
|
917 m_am_tools, |
|
918 TRACE_FLAGS_DEFAULT, |
|
919 (EAPL("Some problem with EAP type at index %d in m_enabled_expanded_eap_array\n"), |
|
920 i)); |
|
921 } |
|
922 } |
|
923 |
|
924 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
925 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
926 } |
|
927 |
|
928 //-------------------------------------------------- |
|
929 |
|
930 #else // for non-expanded (normal EAP types) |
|
931 |
|
932 //-------------------------------------------------- |
|
933 |
|
934 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::get_selected_eap_types( |
|
935 eap_array_c<eap_type_selection_c> * const selected_eap_types) |
|
936 { |
|
937 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
938 |
|
939 EAP_TRACE_DEBUG( |
|
940 m_am_tools, |
|
941 TRACE_FLAGS_DEFAULT, |
|
942 (EAPL("eapol_am_wlan_authentication_symbian_c::get_selected_eap_types(): %s, this = 0x%08x => 0x%08x\n"), |
|
943 (m_is_client == true) ? "client": "server", |
|
944 this, |
|
945 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
946 |
|
947 eap_status_e status = selected_eap_types->reset(); |
|
948 if (status != eap_status_ok) |
|
949 { |
|
950 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
951 return EAP_STATUS_RETURN(m_am_tools, status); |
|
952 } |
|
953 |
|
954 eap_header_string_c eap_string; |
|
955 EAP_UNREFERENCED_PARAMETER(eap_string); |
|
956 |
|
957 TEap *eapType = 0; |
|
958 |
|
959 for (TInt i = 0; i < m_iap_eap_array.Count(); i++) |
|
960 { |
|
961 // Check if type is enabled |
|
962 eapType = m_iap_eap_array[i]; |
|
963 if (eapType->Enabled == 1) |
|
964 { |
|
965 TLex8 tmp(eapType->UID); |
|
966 TInt val(0); |
|
967 tmp.Val(val); |
|
968 |
|
969 EAP_TRACE_DEBUG( |
|
970 m_am_tools, |
|
971 TRACE_FLAGS_DEFAULT, |
|
972 (EAPL("get_selected_eap_types(): adds EAP-type=0x%08x=%s\n"), |
|
973 static_cast<eap_type_ietf_values_e>(val), |
|
974 eap_string.get_eap_type_string( |
|
975 static_cast<eap_type_value_e>( |
|
976 static_cast<eap_type_ietf_values_e>(val))))); |
|
977 |
|
978 // Add EAP-type to list. |
|
979 eap_type_selection_c * selection = new eap_type_selection_c( |
|
980 m_am_tools, |
|
981 static_cast<eap_type_value_e>(static_cast<eap_type_ietf_values_e>(val)), |
|
982 true); |
|
983 if (selection != 0) |
|
984 { |
|
985 status = selected_eap_types->add_object(selection, true); |
|
986 if (status != eap_status_ok) |
|
987 { |
|
988 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
989 return EAP_STATUS_RETURN(m_am_tools, status); |
|
990 } |
|
991 } |
|
992 else |
|
993 { |
|
994 // On error we ignore this EAP-type. |
|
995 } |
|
996 } |
|
997 } |
|
998 |
|
999 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1000 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1001 } |
|
1002 |
|
1003 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
658 |
1004 |
659 //-------------------------------------------------- |
1005 //-------------------------------------------------- |
660 |
1006 |
661 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::get_wlan_configuration( |
1007 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::get_wlan_configuration( |
662 eap_variable_data_c * const wpa_preshared_key_hash) |
1008 eap_variable_data_c * const wpa_preshared_key_hash) |
746 *type, |
1132 *type, |
747 *index)); |
1133 *index)); |
748 |
1134 |
749 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1135 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
750 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
1136 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1137 } |
|
1138 |
|
1139 //-------------------------------------------------- |
|
1140 |
|
1141 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::load_module( |
|
1142 const eap_type_value_e type, |
|
1143 const eap_type_value_e tunneling_type, |
|
1144 abs_eap_base_type_c * const partner, |
|
1145 eap_base_type_c ** const eap_type_if, |
|
1146 const bool is_client_when_true, |
|
1147 const eap_am_network_id_c * const receive_network_id ///< source includes remote address, destination includes local address. |
|
1148 ) |
|
1149 { |
|
1150 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1151 |
|
1152 EAP_TRACE_DEBUG( |
|
1153 m_am_tools, |
|
1154 TRACE_FLAGS_DEFAULT, |
|
1155 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module(type %d=%s, tunneling_type %d=%s)\n"), |
|
1156 convert_eap_type_to_u32_t(type), |
|
1157 eap_header_string_c::get_eap_type_string(type), |
|
1158 convert_eap_type_to_u32_t(tunneling_type), |
|
1159 eap_header_string_c::get_eap_type_string(tunneling_type))); |
|
1160 |
|
1161 eap_status_e status(eap_status_process_general_error); |
|
1162 |
|
1163 #ifdef USE_EAP_EXPANDED_TYPES |
|
1164 |
|
1165 CEapType* eapType = 0; |
|
1166 TInt error(KErrNone); |
|
1167 |
|
1168 // Check if this EAP type has already been loaded |
|
1169 TInt eapArrayIndex = find<eap_type_value_e>( |
|
1170 &m_eap_type_array, |
|
1171 &type, |
|
1172 m_am_tools); |
|
1173 |
|
1174 if (eapArrayIndex >= 0) |
|
1175 { |
|
1176 // We found the entry in the array. |
|
1177 EAP_TRACE_DEBUG( |
|
1178 m_am_tools, |
|
1179 TRACE_FLAGS_DEFAULT, |
|
1180 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module(type %d=%s, tunneling_type %d=%s) already loaded.\n"), |
|
1181 convert_eap_type_to_u32_t(type), |
|
1182 eap_header_string_c::get_eap_type_string(type), |
|
1183 convert_eap_type_to_u32_t(tunneling_type), |
|
1184 eap_header_string_c::get_eap_type_string(tunneling_type))); |
|
1185 |
|
1186 // Yep. It was loaded already. |
|
1187 eapType = m_plugin_if_array[eapArrayIndex]; |
|
1188 } |
|
1189 else |
|
1190 { |
|
1191 TIndexType index_type(ELan); |
|
1192 TUint index(0UL); |
|
1193 |
|
1194 status = read_database_reference_values( |
|
1195 &index_type, |
|
1196 &index); |
|
1197 if (status != eap_status_ok) |
|
1198 { |
|
1199 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1200 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1201 } |
|
1202 |
|
1203 EAP_TRACE_DEBUG( |
|
1204 m_am_tools, |
|
1205 TRACE_FLAGS_DEFAULT, |
|
1206 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module(type %d=%s, tunneling_type %d=%s) load new, index type=%d, index=%d.\n"), |
|
1207 convert_eap_type_to_u32_t(type), |
|
1208 eap_header_string_c::get_eap_type_string(type), |
|
1209 convert_eap_type_to_u32_t(tunneling_type), |
|
1210 eap_header_string_c::get_eap_type_string(tunneling_type), |
|
1211 index_type, |
|
1212 index)); |
|
1213 |
|
1214 TBuf8<KExpandedEAPSize> ExpandedCue; |
|
1215 |
|
1216 // Some indirect way of forming the 8 byte string of an EAP type for the cue is needed here. |
|
1217 TUint8 tmpExpCue[KExpandedEAPSize]; |
|
1218 |
|
1219 // This is to make the tmpExpCue in 8 byte string with correct vendor type and vendor id details. |
|
1220 status = eap_expanded_type_c::write_type(m_am_tools, |
|
1221 0, // index should be zero here. |
|
1222 tmpExpCue, |
|
1223 KExpandedEAPSize, |
|
1224 true, |
|
1225 type); |
|
1226 if (status != eap_status_ok) |
|
1227 { |
|
1228 EAP_TRACE_DEBUG( |
|
1229 m_am_tools, |
|
1230 TRACE_FLAGS_DEFAULT, |
|
1231 (EAPL("load_module: eap_expanded_type_c::write_type failed \n"))); |
|
1232 |
|
1233 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1234 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1235 } |
|
1236 |
|
1237 // Now copy the 8 byte string to the real expanded cue. |
|
1238 ExpandedCue.Copy(tmpExpCue, KExpandedEAPSize); |
|
1239 |
|
1240 EAP_TRACE_DATA_DEBUG( |
|
1241 m_am_tools, |
|
1242 TRACE_FLAGS_DEFAULT, |
|
1243 (EAPL("EAPOL:eapol_am_wlan_authentication_symbian_c::load_module: Expanded CUE:"), |
|
1244 ExpandedCue.Ptr(), |
|
1245 ExpandedCue.Size())); |
|
1246 |
|
1247 |
|
1248 // We must have a trap here since the EAPOL core knows nothing about Symbian. |
|
1249 TRAP(error, (eapType = CEapType::NewL( |
|
1250 ExpandedCue, |
|
1251 index_type, |
|
1252 index))); |
|
1253 if (error != KErrNone |
|
1254 || eapType == 0) |
|
1255 { |
|
1256 // Interface not found or implementation creation function failed |
|
1257 EAP_TRACE_DEBUG( |
|
1258 m_am_tools, |
|
1259 TRACE_FLAGS_DEFAULT, |
|
1260 (EAPL("ECom could not find/initiate implementation.\n"))); |
|
1261 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1262 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1263 } |
|
1264 } |
|
1265 |
|
1266 #else // For normal EAP types |
|
1267 |
|
1268 TBuf8<KMaxEapCueLength> cue; |
|
1269 cue.Num(static_cast<TInt>(convert_eap_type_to_u32_t(type))); |
|
1270 CEapType* eapType = 0; |
|
1271 TInt error(KErrNone); |
|
1272 |
|
1273 // Check if this EAP type has already been loaded |
|
1274 TInt eapArrayIndex = m_eap_type_array.Find(type); |
|
1275 if (eapArrayIndex != KErrNotFound) |
|
1276 { |
|
1277 EAP_TRACE_DEBUG( |
|
1278 m_am_tools, |
|
1279 TRACE_FLAGS_DEFAULT, |
|
1280 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module(type %d=%s, tunneling_type %d=%s) already loaded.\n"), |
|
1281 convert_eap_type_to_u32_t(type), |
|
1282 eap_header_string_c::get_eap_type_string(type), |
|
1283 convert_eap_type_to_u32_t(tunneling_type), |
|
1284 eap_header_string_c::get_eap_type_string(tunneling_type))); |
|
1285 |
|
1286 // Yep. It was loaded already. |
|
1287 eapType = m_plugin_if_array[eapArrayIndex]; |
|
1288 } |
|
1289 else |
|
1290 { |
|
1291 TIndexType index_type(ELan); |
|
1292 TUint index(0UL); |
|
1293 |
|
1294 status = read_database_reference_values( |
|
1295 &index_type, |
|
1296 &index); |
|
1297 if (status != eap_status_ok) |
|
1298 { |
|
1299 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1300 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1301 } |
|
1302 |
|
1303 EAP_TRACE_DEBUG( |
|
1304 m_am_tools, |
|
1305 TRACE_FLAGS_DEFAULT, |
|
1306 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module(type %d=%s, tunneling_type %d=%s) load new, index type=%d, index=%d.\n"), |
|
1307 convert_eap_type_to_u32_t(type), |
|
1308 eap_header_string_c::get_eap_type_string(type), |
|
1309 convert_eap_type_to_u32_t(tunneling_type), |
|
1310 eap_header_string_c::get_eap_type_string(tunneling_type), |
|
1311 index_type, |
|
1312 index)); |
|
1313 |
|
1314 // We must have a trap here since the EAPOL core knows nothing about Symbian. |
|
1315 TRAP(error, (eapType = CEapType::NewL( |
|
1316 cue, |
|
1317 index_type, |
|
1318 index))); |
|
1319 if (error != KErrNone |
|
1320 || eapType == 0) |
|
1321 { |
|
1322 // Interface not found or implementation creation function failed |
|
1323 EAP_TRACE_DEBUG( |
|
1324 m_am_tools, |
|
1325 TRACE_FLAGS_DEFAULT, |
|
1326 (EAPL("ECom could not find/initiate implementation.\n"))); |
|
1327 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1328 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1329 } |
|
1330 } |
|
1331 |
|
1332 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
1333 |
|
1334 // Set the tunneling type |
|
1335 eapType->SetTunnelingType(convert_eap_type_to_u32_t(tunneling_type)); |
|
1336 |
|
1337 // Create the EAP protocol interface implementation. |
|
1338 |
|
1339 #ifdef USE_EAP_SIMPLE_CONFIG |
|
1340 |
|
1341 TRAP(error, (*eap_type_if = eapType->GetStackInterfaceL(m_am_tools, |
|
1342 partner, |
|
1343 is_client_when_true, |
|
1344 receive_network_id, |
|
1345 this))); |
|
1346 |
|
1347 #else |
|
1348 |
|
1349 TRAP(error, (*eap_type_if = eapType->GetStackInterfaceL(m_am_tools, |
|
1350 partner, |
|
1351 is_client_when_true, |
|
1352 receive_network_id))); |
|
1353 |
|
1354 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
|
1355 |
|
1356 |
|
1357 if (error != KErrNone |
|
1358 || *eap_type_if == 0 |
|
1359 || (*eap_type_if)->get_is_valid() == false) |
|
1360 { |
|
1361 EAP_TRACE_DEBUG( |
|
1362 m_am_tools, |
|
1363 TRACE_FLAGS_DEFAULT, |
|
1364 (EAPL("Could not create EAP type interface instance. Error: %d\n"), error)); |
|
1365 |
|
1366 status = eap_status_allocation_error; |
|
1367 // Unload DLL (two ways, depending whether this type was already loaded...) |
|
1368 if (eapArrayIndex == KErrNotFound) |
|
1369 { |
|
1370 // No need to call shutdown here because GetStackInterfaceL has done it. |
|
1371 delete eapType; |
|
1372 } |
|
1373 else |
|
1374 { |
|
1375 unload_module(type); |
|
1376 } |
|
1377 // Note: even in error cases eap_core_c deletes eap_type_if |
|
1378 } |
|
1379 else |
|
1380 { |
|
1381 status = eap_status_ok; |
|
1382 if (eapArrayIndex == KErrNotFound) |
|
1383 { |
|
1384 // Add plugin information to the member arrays. There is no need to store eap_type pointer because |
|
1385 // the stack takes care of its deletion. |
|
1386 if (m_plugin_if_array.Append(eapType) != KErrNone) |
|
1387 { |
|
1388 delete eapType; |
|
1389 status = eap_status_allocation_error; |
|
1390 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1391 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1392 } |
|
1393 |
|
1394 #ifdef USE_EAP_EXPANDED_TYPES |
|
1395 |
|
1396 eap_type_value_e * tmpEAPType = new eap_type_value_e(); |
|
1397 if(tmpEAPType == NULL) |
|
1398 { |
|
1399 EAP_TRACE_DEBUG( |
|
1400 m_am_tools, |
|
1401 TRACE_FLAGS_DEFAULT, |
|
1402 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module() eap_type_value_e creation failed\n"))); |
|
1403 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1404 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1405 } |
|
1406 |
|
1407 *tmpEAPType = type; |
|
1408 |
|
1409 status = m_eap_type_array.add_object(tmpEAPType, true); |
|
1410 |
|
1411 if (status != eap_status_ok) |
|
1412 |
|
1413 #else // For normal EAP type. |
|
1414 |
|
1415 if (m_eap_type_array.Append(type) != KErrNone) |
|
1416 |
|
1417 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
|
1418 { |
|
1419 // Remove the eap type added just previously |
|
1420 m_plugin_if_array.Remove(m_plugin_if_array.Count() - 1); |
|
1421 delete eapType; |
|
1422 status = eap_status_allocation_error; |
|
1423 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1424 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1425 } |
|
1426 } |
|
1427 } |
|
1428 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1429 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1430 } |
|
1431 |
|
1432 //-------------------------------------------------- |
|
1433 |
|
1434 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::unload_module( |
|
1435 const eap_type_value_e type) |
|
1436 { |
|
1437 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1438 |
|
1439 EAP_TRACE_DEBUG( |
|
1440 m_am_tools, |
|
1441 TRACE_FLAGS_DEFAULT, |
|
1442 (EAPL("eapol_am_wlan_authentication_symbian_c::unload_module(): %s, this = 0x%08x => 0x%08x\n"), |
|
1443 (m_is_client == true) ? "client": "server", |
|
1444 this, |
|
1445 dynamic_cast<abs_eap_base_timer_c *>(this))); |
|
1446 |
|
1447 eap_status_e status(eap_status_type_does_not_exists_error); |
|
1448 |
|
1449 #ifdef USE_EAP_EXPANDED_TYPES |
|
1450 |
|
1451 // Check if this EAP type has already been loaded |
|
1452 TInt index = find<eap_type_value_e>( |
|
1453 &m_eap_type_array, |
|
1454 &type, |
|
1455 m_am_tools); |
|
1456 |
|
1457 if (index >= 0) |
|
1458 { |
|
1459 // EAP was loaded before. |
|
1460 |
|
1461 delete m_plugin_if_array[index]; |
|
1462 m_plugin_if_array.Remove(index); |
|
1463 |
|
1464 status = m_eap_type_array.remove_object(index); |
|
1465 } |
|
1466 |
|
1467 #else // For normal EAP types. |
|
1468 |
|
1469 TInt index = m_eap_type_array.Find(type); |
|
1470 if (index != KErrNotFound) |
|
1471 { |
|
1472 delete m_plugin_if_array[index]; |
|
1473 m_plugin_if_array.Remove(index); |
|
1474 m_eap_type_array.Remove(index); |
|
1475 status = eap_status_ok; |
|
1476 } |
|
1477 |
|
1478 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
|
1479 |
|
1480 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1481 return EAP_STATUS_RETURN(m_am_tools, status); |
751 } |
1482 } |
752 |
1483 |
753 //-------------------------------------------------- |
1484 //-------------------------------------------------- |
754 |
1485 |
755 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::read_configure( |
1486 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::read_configure( |
783 false, |
1513 false, |
784 false); |
1514 false); |
785 if (status != eap_status_ok) |
1515 if (status != eap_status_ok) |
786 { |
1516 { |
787 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1517 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
788 return EAP_STATUS_RETURN(m_am_tools, status); |
1518 return status; |
789 } |
1519 } |
790 |
1520 |
791 status = type_field.set_buffer( |
1521 status = type_field.set_buffer( |
792 cf_str_EAP_default_type_hex_data.get_field()->get_field(), |
1522 cf_str_EAP_default_type_hex_data.get_field()->get_field(), |
793 cf_str_EAP_default_type_hex_data.get_field()->get_field_length(), |
1523 cf_str_EAP_default_type_hex_data.get_field()->get_field_length(), |
794 false, |
1524 false, |
795 false); |
1525 false); |
796 if (status != eap_status_ok) |
1526 if (status != eap_status_ok) |
797 { |
1527 { |
798 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1528 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
799 return EAP_STATUS_RETURN(m_am_tools, status); |
1529 return status; |
800 } |
1530 } |
|
1531 |
|
1532 eap_type_value_e aSelectedEapType; |
|
1533 |
|
1534 #ifdef USE_EAP_EXPANDED_TYPES |
|
1535 |
|
1536 if (!wanted_field.compare(&type_field)) |
|
1537 { |
|
1538 TInt ind; |
|
1539 |
|
1540 // First check do we have read configuration from databases. |
|
1541 if (m_enabled_expanded_eap_array.Count() == 0) |
|
1542 { |
|
1543 EAP_TRACE_ERROR( |
|
1544 m_am_tools, |
|
1545 TRACE_FLAGS_DEFAULT, |
|
1546 (EAPL("EAP settings not read from CommsDat\n"))); |
|
1547 |
|
1548 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1549 return EAP_STATUS_RETURN(m_am_tools, eap_status_process_general_error); |
|
1550 } |
|
1551 |
|
1552 // Now we need to return here the next EAP type we should try |
|
1553 for (ind = m_am_partner->get_current_eap_index(); ind < m_enabled_expanded_eap_array.Count(); ind++) |
|
1554 { |
|
1555 // Find the highest priority EAP with index "ind". |
|
1556 |
|
1557 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[ind]->EapExpandedType); |
|
1558 |
|
1559 status = data->set_copy_of_buffer(tmpExpEAP.Ptr(), tmpExpEAP.Size()); |
|
1560 if (status != eap_status_ok) |
|
1561 { |
|
1562 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1563 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1564 } |
|
1565 |
|
1566 EAP_TRACE_DATA_DEBUG( |
|
1567 m_am_tools, |
|
1568 TRACE_FLAGS_DEFAULT, |
|
1569 (EAPL("EAPOL:eapol_am_wlan_authentication_symbian_c::read_configure: Trying EAP type:"), |
|
1570 tmpExpEAP.Ptr(), |
|
1571 tmpExpEAP.Size())); |
|
1572 status = eap_expanded_type_c::read_type(m_am_tools, |
|
1573 0, |
|
1574 tmpExpEAP.Ptr(), |
|
1575 tmpExpEAP.Size(), |
|
1576 &aSelectedEapType); |
|
1577 if (status == eap_status_ok) |
|
1578 { |
|
1579 break; |
|
1580 } |
|
1581 } |
|
1582 |
|
1583 // Set the index of new EAP type we are trying now. |
|
1584 m_am_partner->set_current_eap_index(ind); |
|
1585 |
|
1586 if (ind >= m_enabled_expanded_eap_array.Count()) |
|
1587 { |
|
1588 // Not found any other EAP type as enabled. |
|
1589 // Send WLM notification because there is no way that the authentication |
|
1590 // can be successful if we don't have any EAP types to use... |
|
1591 if (m_is_client) |
|
1592 { |
|
1593 EAP_TRACE_ERROR( |
|
1594 m_am_tools, |
|
1595 TRACE_FLAGS_DEFAULT, |
|
1596 (EAPL("ERROR: read_configure: No configured EAP types or all tried unsuccessfully.\n"))); |
|
1597 } |
|
1598 |
|
1599 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1600 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_configure_field); |
|
1601 } |
|
1602 |
|
1603 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1604 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1605 } |
|
1606 |
|
1607 #else // For normal non-expanded EAP |
|
1608 |
|
1609 if (!wanted_field.compare(&type_field)) |
|
1610 { |
|
1611 TInt ind; |
|
1612 |
|
1613 // First check do we have read configuration from databases. |
|
1614 if (m_iap_eap_array.Count() == 0) |
|
1615 { |
|
1616 EAP_TRACE_ERROR( |
|
1617 m_am_tools, |
|
1618 TRACE_FLAGS_DEFAULT, |
|
1619 (EAPL("EAP settings not read from CommDb\n"))); |
|
1620 |
|
1621 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1622 return EAP_STATUS_RETURN(m_am_tools, eap_status_process_general_error); |
|
1623 } |
|
1624 |
|
1625 // We need to return here the next EAP type we should try |
|
1626 for (ind = m_am_partner->get_current_eap_index(); ind < m_iap_eap_array.Count(); ind++) |
|
1627 { |
|
1628 // Find the first enabled EAP type (highest priority) |
|
1629 TEap *eapType = m_iap_eap_array[ind]; |
|
1630 if (eapType->Enabled == 1) |
|
1631 { |
|
1632 // Convert the string to integer |
|
1633 TLex8 tmp(eapType->UID); |
|
1634 TInt val(0); |
|
1635 tmp.Val(val); |
|
1636 status = data->set_copy_of_buffer(reinterpret_cast<u8_t *>(&val), sizeof(TUint)); |
|
1637 if (status != eap_status_ok) |
|
1638 { |
|
1639 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1640 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1641 } |
|
1642 |
|
1643 EAP_TRACE_DEBUG( |
|
1644 m_am_tools, |
|
1645 TRACE_FLAGS_DEFAULT, |
|
1646 (EAPL("EAPOL: Trying EAP type: %d.\n"), val)); |
|
1647 aSelectedEapType = val; |
|
1648 break; |
|
1649 } |
|
1650 } |
|
1651 |
|
1652 m_am_partner->set_current_eap_index(ind); |
|
1653 if (ind >= m_iap_eap_array.Count()) |
|
1654 { |
|
1655 // Not found |
|
1656 // Send WLM notification because there is no way that the authentication |
|
1657 // can be successful if we don't have any EAP types to use... |
|
1658 if (m_is_client) |
|
1659 { |
|
1660 EAP_TRACE_ERROR( |
|
1661 m_am_tools, |
|
1662 TRACE_FLAGS_DEFAULT, |
|
1663 (EAPL("ERROR: No configured EAP types or all tried unsuccessfully.\n"))); |
|
1664 } |
|
1665 |
|
1666 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1667 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_configure_field); |
|
1668 } |
|
1669 |
|
1670 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1671 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1672 } |
|
1673 |
|
1674 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
801 |
1675 |
802 // It was something else than EAP type. Read it from eapol DB. |
1676 // It was something else than EAP type. Read it from eapol DB. |
803 _LIT( KEapolTableName, "eapol" ); |
1677 _LIT( KEapolTableName, "eapol" ); |
804 |
1678 TRAPD( err, read_configureL( |
805 TFileName aPrivateDatabasePathName; |
1679 KDatabaseName, |
806 |
|
807 TRAPD(err, EapPluginTools::GetPrivatePathL( |
|
808 m_session, |
|
809 aPrivateDatabasePathName)); |
|
810 |
|
811 if (err) |
|
812 { |
|
813 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
814 return EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(err)); |
|
815 } |
|
816 |
|
817 aPrivateDatabasePathName.Append(KEapolDatabaseName); |
|
818 |
|
819 EAP_TRACE_DATA_DEBUG_SYMBIAN(("aPrivateDatabasePathName", |
|
820 aPrivateDatabasePathName.Ptr(), |
|
821 aPrivateDatabasePathName.Size())); |
|
822 |
|
823 TRAPD( error, read_configureL( |
|
824 aPrivateDatabasePathName, |
|
825 KEapolTableName, |
1680 KEapolTableName, |
826 field->get_field(), |
1681 field->get_field(), |
827 field->get_field_length(), |
1682 field->get_field_length(), |
828 data) ); |
1683 data) ); |
829 |
|
830 // Try to read it for eap fast DB |
1684 // Try to read it for eap fast DB |
831 HBufC8* fieldBuf = HBufC8::New( field->get_field_length() ); |
1685 HBufC8* fieldBuf = HBufC8::NewLC( field->get_field_length() ); |
832 |
|
833 eap_automatic_variable_c<HBufC8> automatic_fieldBuf( |
|
834 m_am_tools, |
|
835 fieldBuf); |
|
836 |
|
837 if (fieldBuf == 0) |
|
838 { |
|
839 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
840 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
841 } |
|
842 TPtr8 fieldPtr = fieldBuf->Des(); |
1686 TPtr8 fieldPtr = fieldBuf->Des(); |
843 fieldPtr.Copy( reinterpret_cast<const TUint8 *> ( field->get_field() )); |
1687 fieldPtr.Copy( reinterpret_cast<const TUint8 *> ( field->get_field() )); |
844 |
1688 |
845 if (error != KErrNone) |
1689 _LIT8(cf_str_EAP_TLS_PEAP_use_identity_privacy_literal, "EAP_TLS_PEAP_use_identity_privacy"); |
846 { |
1690 |
847 status = m_am_tools->convert_am_error_to_eapol_error(error); |
1691 if ( err != KErrNone && |
|
1692 fieldPtr.Compare( cf_str_EAP_TLS_PEAP_use_identity_privacy_literal() ) == 0 ) |
|
1693 { |
|
1694 if (aSelectedEapType == eap_type_tls) |
|
1695 { |
|
1696 _LIT(KGeneralSettingsDBTableName, "KTlsDatabaseTableName"); |
|
1697 TRAP( err, read_configureL( |
|
1698 KDatabaseName, |
|
1699 KGeneralSettingsDBTableName, |
|
1700 field->get_field(), |
|
1701 field->get_field_length(), |
|
1702 data) ); |
|
1703 |
|
1704 } |
|
1705 if (aSelectedEapType == eap_type_peap) |
|
1706 { |
|
1707 _LIT(KGeneralSettingsDBTableName, "KPeapDatabaseTableName"); |
|
1708 TRAP( err, read_configureL( |
|
1709 KDatabaseName, |
|
1710 KGeneralSettingsDBTableName, |
|
1711 field->get_field(), |
|
1712 field->get_field_length(), |
|
1713 data) ); |
|
1714 } |
|
1715 if (aSelectedEapType == eap_type_ttls) |
|
1716 { |
|
1717 _LIT(KGeneralSettingsDBTableName, "KTtlsDatabaseTableName"); |
|
1718 TRAP( err, read_configureL( |
|
1719 KDatabaseName, |
|
1720 KGeneralSettingsDBTableName, |
|
1721 field->get_field(), |
|
1722 field->get_field_length(), |
|
1723 data) ); |
|
1724 } |
|
1725 #if defined (USE_FAST_EAP_TYPE) |
|
1726 if ( aSelectedEapType == eap_type_fast) |
|
1727 { |
|
1728 _LIT(KFastGeneralSettingsDBTableName, "eapfast_general_settings"); |
|
1729 TRAP( err, read_configureL( |
|
1730 KFastDatabaseName, |
|
1731 KFastGeneralSettingsDBTableName, |
|
1732 field->get_field(), |
|
1733 field->get_field_length(), |
|
1734 data) ); |
|
1735 } |
|
1736 #endif |
|
1737 } |
|
1738 CleanupStack::PopAndDestroy( fieldBuf ); |
|
1739 |
|
1740 if (err != KErrNone) |
|
1741 { |
|
1742 status = m_am_tools->convert_am_error_to_eapol_error(err); |
848 |
1743 |
849 #if defined(USE_EAP_FILECONFIG) |
1744 #if defined(USE_EAP_FILECONFIG) |
850 if (m_fileconfig != 0 |
1745 if (m_fileconfig != 0 |
851 && m_fileconfig->get_is_valid() == true) |
1746 && m_fileconfig->get_is_valid() == true) |
852 { |
1747 { |
1061 |
1922 |
1062 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::cancel_all_timers() |
1923 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::cancel_all_timers() |
1063 { |
1924 { |
1064 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
1925 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
1065 |
1926 |
|
1927 const eap_status_e status = m_am_tools->am_cancel_all_timers(); |
|
1928 |
|
1929 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1930 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1931 } |
|
1932 |
|
1933 //-------------------------------------------------- |
|
1934 |
|
1935 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::check_is_valid_eap_type(const eap_type_value_e eap_type) |
|
1936 { |
|
1937 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1938 |
|
1939 eap_header_string_c eap_string; |
|
1940 EAP_UNREFERENCED_PARAMETER(eap_string); |
|
1941 |
|
1942 EAP_TRACE_DEBUG( |
|
1943 m_am_tools, |
|
1944 TRACE_FLAGS_DEFAULT, |
|
1945 (EAPL("eapol_am_wlan_authentication_symbian_c::check_is_valid_eap_type(): %s, this = 0x%08x => 0x%08x, EAP-type=0x%08x=%s\n"), |
|
1946 (m_is_client == true) ? "client": "server", |
|
1947 this, |
|
1948 dynamic_cast<abs_eap_base_timer_c *>(this), |
|
1949 convert_eap_type_to_u32_t(eap_type), |
|
1950 eap_string.get_eap_type_string(eap_type))); |
|
1951 |
|
1952 #ifdef USE_EAP_EXPANDED_TYPES |
|
1953 |
|
1954 for (int i = 0; i < m_enabled_expanded_eap_array.Count(); i++) |
|
1955 { |
|
1956 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[i]->EapExpandedType); |
|
1957 |
|
1958 EAP_TRACE_DEBUG( |
|
1959 m_am_tools, |
|
1960 TRACE_FLAGS_DEFAULT, |
|
1961 (EAPL("eapol_am_wlan_authentication_symbian_c::check_is_valid_eap_type:Enabled expanded EAP type at index=%d\n"), |
|
1962 i)); |
|
1963 |
|
1964 EAP_TRACE_DATA_DEBUG( |
|
1965 m_am_tools, |
|
1966 TRACE_FLAGS_DEFAULT, |
|
1967 (EAPL("Enabled expanded EAP type:"), |
|
1968 tmpExpEAP.Ptr(), |
|
1969 tmpExpEAP.Size())); |
|
1970 |
|
1971 // This is for one expanded EAP type (for the above one). |
|
1972 eap_expanded_type_c expandedEAPType; |
|
1973 |
|
1974 // Read the expanded EAP type details for this item in m_enabled_expanded_eap_array. |
|
1975 eap_status_e status = eap_expanded_type_c::read_type(m_am_tools, |
|
1976 0, |
|
1977 tmpExpEAP.Ptr(), |
|
1978 tmpExpEAP.Size(), |
|
1979 &expandedEAPType); |
|
1980 if (status != eap_status_ok) |
|
1981 { |
|
1982 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1983 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1984 } |
|
1985 |
|
1986 if (eap_type == expandedEAPType) |
|
1987 { |
|
1988 // This is Allowed and Valid. |
|
1989 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1990 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
1991 } |
|
1992 } |
|
1993 |
|
1994 #else // For normal unexpanded EAP type |
|
1995 |
|
1996 TEap *eapType = 0; |
|
1997 |
|
1998 for (int i = 0; i < m_iap_eap_array.Count(); i++) |
|
1999 { |
|
2000 // Try next EAP type |
|
2001 eapType = m_iap_eap_array[i]; |
|
2002 if (eapType->Enabled == 1) |
|
2003 { |
|
2004 // Convert the string to integer |
|
2005 TLex8 tmp(eapType->UID); |
|
2006 TInt val(0); |
|
2007 tmp.Val(val); |
|
2008 |
|
2009 if (eap_type == static_cast<eap_type_ietf_values_e>(val)) |
|
2010 { |
|
2011 // Allowed |
|
2012 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2013 return EAP_STATUS_RETURN(m_am_tools, eap_status_ok); |
|
2014 } |
|
2015 } |
|
2016 } |
|
2017 |
|
2018 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
|
2019 |
|
2020 EAP_TRACE_DEBUG( |
|
2021 m_am_tools, |
|
2022 TRACE_FLAGS_DEFAULT, |
|
2023 (EAPL("ERROR: %s: check_is_valid_eap_type(): not supported EAP-type=0x%08x=%s\n"), |
|
2024 (m_is_client == true ? "client": "server"), |
|
2025 convert_eap_type_to_u32_t(eap_type), |
|
2026 eap_string.get_eap_type_string(eap_type))); |
|
2027 |
|
2028 |
|
2029 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2030 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_eap_type); |
|
2031 } |
|
2032 |
|
2033 //-------------------------------------------------- |
|
2034 |
|
2035 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::get_eap_type_list( |
|
2036 eap_array_c<eap_type_value_e> * const eap_type_list) |
|
2037 { |
|
2038 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2039 |
1066 EAP_TRACE_DEBUG( |
2040 EAP_TRACE_DEBUG( |
1067 m_am_tools, |
2041 m_am_tools, |
1068 TRACE_FLAGS_DEFAULT, |
2042 TRACE_FLAGS_DEFAULT, |
1069 (EAPL("eapol_am_wlan_authentication_symbian_c::cancel_all_timers(): this = 0x%08x\n"), |
2043 (EAPL("eapol_am_wlan_authentication_symbian_c::get_eap_type_list(): %s, this = 0x%08x => 0x%08x\n"), |
1070 this)); |
2044 (m_is_client == true) ? "client": "server", |
1071 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::cancel_all_timers()"); |
2045 this, |
1072 |
2046 dynamic_cast<abs_eap_base_timer_c *>(this))); |
1073 const eap_status_e status = m_am_tools->am_cancel_all_timers(); |
2047 |
|
2048 |
|
2049 eap_status_e status(eap_status_illegal_eap_type); |
|
2050 |
|
2051 status = eap_type_list->reset(); |
|
2052 if (status != eap_status_ok) |
|
2053 { |
|
2054 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2055 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2056 } |
|
2057 |
|
2058 eap_header_string_c eap_string; |
|
2059 EAP_UNREFERENCED_PARAMETER(eap_string); |
|
2060 |
|
2061 #ifdef USE_EAP_EXPANDED_TYPES |
|
2062 |
|
2063 // This function is same as get_selected_eap_types in behavior. |
|
2064 |
|
2065 // We need to return only the EAP types available as enabled types. |
|
2066 // It means only the ones available in m_enabled_expanded_eap_array. |
|
2067 |
|
2068 for (TInt i = 0; i < m_enabled_expanded_eap_array.Count(); i++) |
|
2069 { |
|
2070 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[i]->EapExpandedType); |
|
2071 |
|
2072 EAP_TRACE_DEBUG( |
|
2073 m_am_tools, |
|
2074 TRACE_FLAGS_DEFAULT, |
|
2075 (EAPL("eapol_am_wlan_authentication_symbian_c::get_eap_type_list:Enabled expanded EAP type at index=%d\n"), |
|
2076 i)); |
|
2077 |
|
2078 EAP_TRACE_DATA_DEBUG( |
|
2079 m_am_tools, |
|
2080 TRACE_FLAGS_DEFAULT, |
|
2081 (EAPL("Enabled expanded EAP type:"), |
|
2082 tmpExpEAP.Ptr(), |
|
2083 tmpExpEAP.Size())); |
|
2084 |
|
2085 // This is for one expanded EAP type (for the above one). |
|
2086 eap_expanded_type_c * expandedEAPType = new eap_type_value_e(); |
|
2087 |
|
2088 // Read the expanded EAP type details from an item in m_enabled_expanded_eap_array. |
|
2089 status = eap_expanded_type_c::read_type(m_am_tools, |
|
2090 0, |
|
2091 tmpExpEAP.Ptr(), |
|
2092 tmpExpEAP.Size(), |
|
2093 expandedEAPType); |
|
2094 if (status != eap_status_ok) |
|
2095 { |
|
2096 delete expandedEAPType; |
|
2097 expandedEAPType = 0; |
|
2098 |
|
2099 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2100 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2101 } |
|
2102 |
|
2103 // Add EAP-type to list. |
|
2104 status = eap_type_list->add_object(expandedEAPType, true); |
|
2105 if (status != eap_status_ok) |
|
2106 { |
|
2107 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2108 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2109 } |
|
2110 |
|
2111 EAP_TRACE_DEBUG( |
|
2112 m_am_tools, |
|
2113 TRACE_FLAGS_DEFAULT, |
|
2114 (EAPL("get_eap_type_list():added EAP-type=0x%08x=%s\n"), |
|
2115 expandedEAPType->get_vendor_type(), |
|
2116 eap_string.get_eap_type_string(*expandedEAPType))); |
|
2117 } |
|
2118 |
|
2119 #else // for normal EAP types. |
|
2120 |
|
2121 TEap *eapType = 0; |
|
2122 |
|
2123 for (TInt i = 0; i < m_iap_eap_array.Count(); i++) |
|
2124 { |
|
2125 // Check if type is enabled |
|
2126 eapType = m_iap_eap_array[i]; |
|
2127 if (eapType->Enabled == 1) |
|
2128 { |
|
2129 TLex8 tmp(eapType->UID); |
|
2130 TInt val(0); |
|
2131 tmp.Val(val); |
|
2132 |
|
2133 EAP_TRACE_DEBUG( |
|
2134 m_am_tools, |
|
2135 TRACE_FLAGS_DEFAULT, |
|
2136 (EAPL("get_eap_type_list(): adds EAP-type=0x%08x=%s\n"), |
|
2137 static_cast<eap_type_ietf_values_e>(val), |
|
2138 eap_string.get_eap_type_string( |
|
2139 static_cast<eap_type_value_e>( |
|
2140 static_cast<eap_type_ietf_values_e>(val))))); |
|
2141 |
|
2142 eap_type_value_e * const eap_type = new eap_type_value_e( |
|
2143 static_cast<eap_type_ietf_values_e>(val)); |
|
2144 if (eap_type == 0) |
|
2145 { |
|
2146 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2147 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2148 } |
|
2149 |
|
2150 status = eap_type_list->add_object(eap_type, true); |
|
2151 if (status != eap_status_ok) |
|
2152 { |
|
2153 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2154 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2155 } |
|
2156 } |
|
2157 } |
|
2158 |
|
2159 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
1074 |
2160 |
1075 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
2161 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1076 return EAP_STATUS_RETURN(m_am_tools, status); |
2162 return EAP_STATUS_RETURN(m_am_tools, status); |
1077 } |
2163 } |
1078 |
2164 |
1079 //-------------------------------------------------- |
2165 //-------------------------------------------------- |
1080 |
2166 |
|
2167 // |
|
2168 void eapol_am_wlan_authentication_symbian_c::RunL() |
|
2169 { |
|
2170 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2171 EAP_TRACE_DEBUG( |
|
2172 m_am_tools, |
|
2173 TRACE_FLAGS_DEFAULT, |
|
2174 (EAPL("eapol_am_wlan_authentication_symbian_c::RunL(): iStatus.Int() = %d\n"), |
|
2175 iStatus.Int())); |
|
2176 |
|
2177 if (iStatus.Int() != KErrNone) |
|
2178 { |
|
2179 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2180 return; |
|
2181 } |
|
2182 |
|
2183 // Authentication cancelled. |
|
2184 EAP_TRACE_ALWAYS( |
|
2185 m_am_tools, |
|
2186 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
2187 (EAPL("Authentication cancelled.\n"))); |
|
2188 |
|
2189 eap_status_e status = m_am_partner->disassociation( |
|
2190 &m_receive_network_id); |
|
2191 if (status != eap_status_ok) |
|
2192 { |
|
2193 EAP_TRACE_DEBUG( |
|
2194 m_am_tools, |
|
2195 TRACE_FLAGS_DEFAULT, |
|
2196 (EAPL("set_timer(EAPOL_AM_CORE_TIMER_DELETE_STACK_ID) failed in RunL().\n"))); |
|
2197 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2198 return; |
|
2199 } |
|
2200 |
|
2201 // Reset index of current EAP-type. |
|
2202 m_am_partner->set_current_eap_index(0ul); |
|
2203 |
|
2204 EAP_TRACE_ALWAYS( |
|
2205 m_am_tools, |
|
2206 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
2207 (EAPL("Indication sent to WLM: EFailedCompletely.\n"))); |
|
2208 |
|
2209 m_am_partner->eapol_indication( |
|
2210 &m_receive_network_id, |
|
2211 eapol_wlan_authentication_state_failed_completely); |
|
2212 |
|
2213 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2214 } |
|
2215 |
|
2216 //-------------------------------------------------- |
|
2217 |
|
2218 // |
|
2219 void eapol_am_wlan_authentication_symbian_c::DoCancel() |
|
2220 { |
|
2221 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2222 |
|
2223 EAP_TRACE_DEBUG( |
|
2224 m_am_tools, |
|
2225 TRACE_FLAGS_DEFAULT, |
|
2226 (EAPL("eapol_am_wlan_authentication_symbian_c::DoCancel()\n"))); |
|
2227 |
|
2228 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2229 } |
|
2230 |
|
2231 //-------------------------------------------------- |
|
2232 |
1081 void eapol_am_wlan_authentication_symbian_c::RetrievePSKL(TPSKEntry& entry) |
2233 void eapol_am_wlan_authentication_symbian_c::RetrievePSKL(TPSKEntry& entry) |
1082 { |
2234 { |
1083 EAP_TRACE_DEBUG( |
|
1084 m_am_tools, |
|
1085 TRACE_FLAGS_DEFAULT, |
|
1086 (EAPL("eapol_am_wlan_authentication_symbian_c::RetrievePSKL(): this = 0x%08x\n"), |
|
1087 this)); |
|
1088 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::RetrievePSKL()"); |
|
1089 |
2235 |
1090 // Open database |
2236 // Open database |
1091 RDbNamedDatabase db; |
2237 RDbNamedDatabase db; |
1092 |
2238 |
1093 TFileName aPrivateDatabasePathName; |
2239 #ifdef SYMBIAN_SECURE_DBMS |
1094 |
2240 User::LeaveIfError(db.Open(m_session, KDatabaseName, KSecureUIDFormat)); |
1095 EapPluginTools::GetPrivatePathL( |
2241 #else |
1096 m_session, |
2242 User::LeaveIfError(db.Open(m_session, KDatabaseName)); |
1097 aPrivateDatabasePathName); |
2243 #endif // #ifdef SYMBIAN_SECURE_DBMS |
1098 |
|
1099 aPrivateDatabasePathName.Append(KEapolDatabaseName); |
|
1100 |
|
1101 EAP_TRACE_DATA_DEBUG_SYMBIAN(("aPrivateDatabasePathName", |
|
1102 aPrivateDatabasePathName.Ptr(), |
|
1103 aPrivateDatabasePathName.Size())); |
|
1104 |
|
1105 TInt error = db.Open(m_session, aPrivateDatabasePathName); |
|
1106 |
|
1107 EAP_TRACE_DEBUG( |
|
1108 m_am_tools, |
|
1109 TRACE_FLAGS_DEFAULT, |
|
1110 (EAPL("eapol_am_wlan_authentication_symbian_c::RetrievePSKL(): db.Open(), error = %d\n"), |
|
1111 error)); |
|
1112 |
|
1113 User::LeaveIfError(error); |
|
1114 |
2244 |
1115 CleanupClosePushL(db); |
2245 CleanupClosePushL(db); |
1116 |
2246 |
1117 HBufC* sqlbuf = HBufC::NewLC(KMaxSqlQueryLength); |
2247 HBufC* sqlbuf = HBufC::NewLC(KMaxSqlQueryLength); |
1118 TPtr sqlStatement = sqlbuf->Des(); |
2248 TPtr sqlStatement = sqlbuf->Des(); |
1287 if (index_type == ELan) |
2395 if (index_type == ELan) |
1288 { |
2396 { |
1289 EAP_TRACE_DEBUG( |
2397 EAP_TRACE_DEBUG( |
1290 m_am_tools, |
2398 m_am_tools, |
1291 TRACE_FLAGS_DEFAULT, |
2399 TRACE_FLAGS_DEFAULT, |
1292 (EAPL("WLAN settings: m_WPA_override_enabled=%d\n"), |
2400 (EAPL("Beginning to read IAP settings - Type: %d, Index: %d.\n"), index_type, index)); |
|
2401 |
|
2402 CWLanSettings* wlan_settings = new(ELeave) CWLanSettings; |
|
2403 CleanupStack::PushL(wlan_settings); |
|
2404 SWLANSettings wlanSettings; |
|
2405 if (wlan_settings->Connect() != KErrNone) |
|
2406 { |
|
2407 // Could not connect to CommDB |
|
2408 User::Leave(KErrCouldNotConnect); |
|
2409 } |
|
2410 |
|
2411 EAP_TRACE_DEBUG( |
|
2412 m_am_tools, |
|
2413 TRACE_FLAGS_DEFAULT, (EAPL("Connected to CommDbIf.\n"))); |
|
2414 |
|
2415 if (wlan_settings->GetWlanSettingsForService(index, wlanSettings) != KErrNone) |
|
2416 { |
|
2417 wlan_settings->Disconnect(); |
|
2418 User::Leave(KErrUnknown); |
|
2419 } |
|
2420 |
|
2421 EAP_TRACE_DEBUG( |
|
2422 m_am_tools, |
|
2423 TRACE_FLAGS_DEFAULT, |
|
2424 (EAPL("Got WLAN settings: wlanSettings.EnableWpaPsk=%d, m_WPA_override_enabled=%d\n"), |
|
2425 wlanSettings.EnableWpaPsk, |
1293 m_WPA_override_enabled)); |
2426 m_WPA_override_enabled)); |
1294 |
2427 |
1295 EAP_TRACE_DATA_DEBUG( |
2428 EAP_TRACE_DATA_DEBUG( |
1296 m_am_tools, |
2429 m_am_tools, |
1297 TRACE_FLAGS_DEFAULT, |
2430 TRACE_FLAGS_DEFAULT, |
1298 (EAPL("m_wpa_preshared_key"), |
2431 (EAPL("WPA-PSK"), |
1299 m_wpa_preshared_key.get_data(), |
2432 wlanSettings.WPAPreSharedKey.Ptr(), |
1300 m_wpa_preshared_key.get_data_length())); |
2433 wlanSettings.WPAPreSharedKey.Size())); |
1301 |
2434 |
1302 EAP_TRACE_DATA_DEBUG( |
2435 #ifdef USE_EAP_EXPANDED_TYPES |
|
2436 |
|
2437 EAP_TRACE_DEBUG( |
1303 m_am_tools, |
2438 m_am_tools, |
1304 TRACE_FLAGS_DEFAULT, |
2439 TRACE_FLAGS_DEFAULT, |
1305 (EAPL("m_SSID"), |
2440 (EAPL("Beginning to read EAP Data using new Comm_DB_if for expanded eap type\n"))); |
1306 m_SSID.get_data(), |
2441 |
1307 m_SSID.get_data_length())); |
2442 wlan_settings->GetEapDataL(m_enabled_expanded_eap_array, m_disabled_expanded_eap_array); |
|
2443 |
|
2444 EAP_TRACE_DEBUG( |
|
2445 m_am_tools, |
|
2446 TRACE_FLAGS_DEFAULT, |
|
2447 (EAPL("Enabled EAP count=%d, Disabled EAP count=%d\n"), |
|
2448 m_enabled_expanded_eap_array.Count(), m_disabled_expanded_eap_array.Count())); |
|
2449 |
|
2450 |
|
2451 |
|
2452 #else |
|
2453 // Without expanded EAP type. Normal EAP type stuff. |
|
2454 wlan_settings->GetEapDataL(m_iap_eap_array); |
|
2455 |
|
2456 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
2457 |
|
2458 |
|
2459 EAP_TRACE_DEBUG( |
|
2460 m_am_tools, |
|
2461 TRACE_FLAGS_DEFAULT, |
|
2462 (EAPL("Got EAP data:\n"))); |
|
2463 |
|
2464 #ifdef USE_EAP_EXPANDED_TYPES |
|
2465 |
|
2466 // Reading enabled. |
|
2467 for (TInt i = 0; i < m_enabled_expanded_eap_array.Count(); i++) |
|
2468 { |
|
2469 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[i]->EapExpandedType); |
|
2470 |
|
2471 EAP_TRACE_DEBUG( |
|
2472 m_am_tools, |
|
2473 TRACE_FLAGS_DEFAULT, |
|
2474 (EAPL("eapol_am_wlan_authentication_symbian_c::ReadEAPSettingsL:Enabled expanded EAP type at index=%d\n"), |
|
2475 i)); |
|
2476 |
|
2477 EAP_TRACE_DATA_DEBUG( |
|
2478 m_am_tools, |
|
2479 TRACE_FLAGS_DEFAULT, |
|
2480 (EAPL("Enabled expanded EAP type:"), |
|
2481 tmpExpEAP.Ptr(), |
|
2482 tmpExpEAP.Size())); |
|
2483 } |
|
2484 |
|
2485 // Now reading disabled. |
|
2486 for (TInt i = 0; i < m_disabled_expanded_eap_array.Count(); i++) |
|
2487 { |
|
2488 TBuf8<KExpandedEAPSize> tmpExpEAP(m_disabled_expanded_eap_array[i]->EapExpandedType); |
|
2489 |
|
2490 EAP_TRACE_DEBUG( |
|
2491 m_am_tools, |
|
2492 TRACE_FLAGS_DEFAULT, |
|
2493 (EAPL("eapol_am_wlan_authentication_symbian_c::ReadEAPSettingsL:Disabled expanded EAP type at index=%d\n"), |
|
2494 i)); |
|
2495 |
|
2496 EAP_TRACE_DATA_DEBUG( |
|
2497 m_am_tools, |
|
2498 TRACE_FLAGS_DEFAULT, |
|
2499 (EAPL("Disabled expanded EAP type:"), |
|
2500 tmpExpEAP.Ptr(), |
|
2501 tmpExpEAP.Size())); |
|
2502 } |
|
2503 |
|
2504 #else // Normal EAP type. |
|
2505 |
|
2506 for (TInt i = 0; i < m_iap_eap_array.Count(); i++) |
|
2507 { |
|
2508 EAP_TRACE_DEBUG( |
|
2509 m_am_tools, |
|
2510 TRACE_FLAGS_DEFAULT, |
|
2511 (EAPL("EAP type %d\n"), |
|
2512 i)); |
|
2513 |
|
2514 TLex8 tmp(m_iap_eap_array[i]->UID); |
|
2515 TInt val(0); |
|
2516 tmp.Val(val); |
|
2517 |
|
2518 EAP_TRACE_DEBUG( |
|
2519 m_am_tools, |
|
2520 TRACE_FLAGS_DEFAULT, |
|
2521 (EAPL(" UID: %d\n"), val)); |
|
2522 EAP_TRACE_DEBUG( |
|
2523 m_am_tools, |
|
2524 TRACE_FLAGS_DEFAULT, |
|
2525 (EAPL(" Enabled: %d\n"), |
|
2526 m_iap_eap_array[i]->Enabled)); |
|
2527 } |
|
2528 |
|
2529 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
|
2530 |
|
2531 EAP_TRACE_DEBUG( |
|
2532 m_am_tools, |
|
2533 TRACE_FLAGS_DEFAULT, |
|
2534 (EAPL("End EAP data:\n"))); |
|
2535 |
|
2536 |
|
2537 #ifndef USE_EAP_EXPANDED_TYPES |
|
2538 |
|
2539 // There can not be a situation where all EAPs are disabled. |
|
2540 |
|
2541 if (m_iap_eap_array.Count() == 0) |
|
2542 { |
|
2543 |
|
2544 #if defined(USE_EAP_ALLOW_ALL_EAP_TYPES_WHEN_NONE_IS_ACTIVATED_IN_CONFIGURATION) |
|
2545 |
|
2546 // The EAP field was empty. Allow all types. |
|
2547 |
|
2548 EAP_TRACE_DEBUG( |
|
2549 m_am_tools, |
|
2550 TRACE_FLAGS_DEFAULT, |
|
2551 (EAPL("Empty EAP field -> enable all types.\n"))); |
|
2552 |
|
2553 RImplInfoPtrArray eapArray; |
|
2554 |
|
2555 REComSession::ListImplementationsL(KEapTypeInterfaceUid, eapArray); |
|
2556 |
|
2557 TEap *eap; |
|
2558 for (TInt i = 0; i < eapArray.Count(); i++) |
|
2559 { |
|
2560 eap = new(ELeave) TEap; |
|
2561 eap->UID.Copy(eapArray[i]->DataType()); |
|
2562 eap->Enabled = ETrue; |
|
2563 m_iap_eap_array.Append(eap); |
|
2564 } |
|
2565 |
|
2566 eapArray.ResetAndDestroy(); |
|
2567 |
|
2568 #else |
|
2569 |
|
2570 // The EAP field was empty. Allow EAP-SIM only. |
|
2571 |
|
2572 EAP_TRACE_DEBUG( |
|
2573 m_am_tools, |
|
2574 TRACE_FLAGS_DEFAULT, |
|
2575 (EAPL("Empty EAP field -> enable EAP-SIM only.\n"))); |
|
2576 |
|
2577 { |
|
2578 TBuf8<3> eap_sim_uid = _L8("018"); |
|
2579 |
|
2580 TEap *eap = new(ELeave) TEap; |
|
2581 eap->UID.Copy(eap_sim_uid); |
|
2582 eap->Enabled = ETrue; |
|
2583 m_iap_eap_array.Append(eap); |
|
2584 } |
|
2585 |
|
2586 #endif //#if defined(USE_EAP_ALLOW_ALL_EAP_TYPES_WHEN_NONE_IS_ACTIVATED_IN_CONFIGURATION) |
|
2587 |
|
2588 } |
|
2589 |
|
2590 #endif // #ifndef USE_EAP_EXPANDED_TYPES |
|
2591 |
|
2592 // Get security mode |
|
2593 if (m_WPA_override_enabled == false) |
|
2594 { |
|
2595 m_security_mode = static_cast<EWlanSecurityMode>(wlanSettings.SecurityMode); |
|
2596 } |
|
2597 else |
|
2598 { |
|
2599 // WPA override is enabled |
|
2600 m_security_mode = Wpa; |
|
2601 } |
1308 |
2602 |
1309 // Get WPA pre shared key & SSID |
2603 // Get WPA pre shared key & SSID |
1310 if (m_is_client == true |
2604 if (m_is_client == true |
|
2605 && (wlanSettings.EnableWpaPsk |
|
2606 || m_WPA_override_enabled == true) |
1311 && (m_selected_eapol_key_authentication_type == eapol_key_authentication_type_RSNA_PSK |
2607 && (m_selected_eapol_key_authentication_type == eapol_key_authentication_type_RSNA_PSK |
1312 || m_selected_eapol_key_authentication_type == eapol_key_authentication_type_WPA_PSK)) |
2608 || m_selected_eapol_key_authentication_type == eapol_key_authentication_type_WPA_PSK)) |
1313 { |
2609 { |
|
2610 EAP_TRACE_DEBUG( |
|
2611 m_am_tools, |
|
2612 TRACE_FLAGS_DEFAULT, |
|
2613 (EAPL("Uses WPAPSK: wlanSettings.EnableWpaPsk=%d\n"), |
|
2614 wlanSettings.EnableWpaPsk)); |
|
2615 |
|
2616 // When not using easy WLAN there is no WPA PSK override. |
|
2617 if (m_WPA_override_enabled == false) |
|
2618 { |
|
2619 status = m_wpa_preshared_key.set_copy_of_buffer( |
|
2620 wlanSettings.WPAPreSharedKey.Ptr(), |
|
2621 wlanSettings.WPAPreSharedKey.Size()); |
|
2622 if (status != eap_status_ok) |
|
2623 { |
|
2624 send_error_notification(eap_status_key_error); |
|
2625 wlan_settings->Disconnect(); |
|
2626 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2627 User::Leave(m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status))); |
|
2628 } |
|
2629 |
|
2630 // Here we copy the SSID read from IAP. |
|
2631 TBuf8<K_Max_SSID_Length> tmp; |
|
2632 tmp.Copy(wlanSettings.SSID); |
|
2633 status = m_SSID.set_copy_of_buffer(tmp.Ptr(), tmp.Size()); |
|
2634 if (status != eap_status_ok) |
|
2635 { |
|
2636 wlan_settings->Disconnect(); |
|
2637 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2638 User::Leave(m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status))); |
|
2639 } |
|
2640 } |
|
2641 else |
|
2642 { |
|
2643 // In override mode SSID is stored to m_SSID |
|
2644 // and password is stored to m_wpa_preshared_key. |
|
2645 } |
|
2646 |
1314 TPSKEntry pskEntry; |
2647 TPSKEntry pskEntry; |
1315 pskEntry.indexType = index_type; |
2648 pskEntry.indexType = index_type; |
1316 pskEntry.index = index; |
2649 pskEntry.index = index; |
1317 pskEntry.ssid.Zero(); |
2650 pskEntry.ssid.Zero(); |
1318 pskEntry.password.Zero(); |
2651 pskEntry.password.Zero(); |
1319 pskEntry.psk.Zero(); |
2652 pskEntry.psk.Zero(); |
1320 |
2653 |
1321 TInt error(KErrNone); |
2654 TInt err(KErrNone); |
1322 |
2655 |
1323 // Retrieve saved PSK only when override is not in effect |
2656 // Retrieve saved PSK only when override is not in effect |
1324 TRAP(error, RetrievePSKL(pskEntry)); |
2657 TRAP(err, RetrievePSKL(pskEntry)); |
1325 |
2658 |
1326 if (error != KErrNone |
2659 if (err != KErrNone |
1327 || m_SSID.compare(pskEntry.ssid.Ptr(), pskEntry.ssid.Size()) != 0 |
2660 || m_SSID.compare(pskEntry.ssid.Ptr(), pskEntry.ssid.Size()) != 0 |
1328 || m_wpa_preshared_key.compare(pskEntry.password.Ptr(), pskEntry.password.Size()) != 0) |
2661 || m_wpa_preshared_key.compare(pskEntry.password.Ptr(), pskEntry.password.Size()) != 0) |
1329 { |
2662 { |
1330 // No previous PSK or parameters were changed. |
2663 // No previous PSK or parameters were changed. |
1331 // We need to calculate PSK again |
2664 // We need to calculate PSK again |
1457 (EAPL("old WPA-PSK hash"), |
2795 (EAPL("old WPA-PSK hash"), |
1458 m_wpa_preshared_key_hash.get_data(), |
2796 m_wpa_preshared_key_hash.get_data(), |
1459 m_wpa_preshared_key_hash.get_data_length())); |
2797 m_wpa_preshared_key_hash.get_data_length())); |
1460 } |
2798 } |
1461 } |
2799 } |
|
2800 |
|
2801 wlan_settings->Disconnect(); |
|
2802 CleanupStack::PopAndDestroy(wlan_settings); |
|
2803 |
|
2804 if (m_security_mode != Wlan8021x |
|
2805 && m_security_mode != Wpa |
|
2806 && m_security_mode != Wpa2Only) |
|
2807 { |
|
2808 // Unsupported mode |
|
2809 User::Leave(KErrNotSupported); |
|
2810 } |
1462 } |
2811 } |
1463 else |
2812 else |
1464 { |
2813 { |
1465 // At the moment only LAN bearer is supported. |
2814 // At the moment only LAN bearer is supported. |
1466 User::Leave(KErrNotSupported); |
2815 User::Leave(KErrNotSupported); |
1467 } |
2816 } |
1468 |
2817 |
1469 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
2818 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1470 } |
2819 } |
|
2820 |
|
2821 //-------------------------------------------------- |
|
2822 |
|
2823 #ifdef USE_EAP_EXPANDED_TYPES |
|
2824 |
|
2825 void eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL(const eap_type_value_e aEapType) |
|
2826 { |
|
2827 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2828 |
|
2829 EAP_TRACE_DEBUG( |
|
2830 m_am_tools, |
|
2831 TRACE_FLAGS_DEFAULT, |
|
2832 (EAPL("eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL() - for EXP EAP types\n"))); |
|
2833 |
|
2834 TIndexType index_type(ELan); |
|
2835 TUint index(0UL); |
|
2836 TInt priorityIndex (0); |
|
2837 |
|
2838 eap_status_e status = read_database_reference_values( |
|
2839 &index_type, |
|
2840 &index); |
|
2841 if (status != eap_status_ok) |
|
2842 { |
|
2843 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2844 User::Leave(m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status))); |
|
2845 } |
|
2846 |
|
2847 if (index_type == ELan) |
|
2848 { |
|
2849 for (TInt i = 0; i < m_enabled_expanded_eap_array.Count(); i++) |
|
2850 { |
|
2851 TBuf8<KExpandedEAPSize> tmpExpEAP(m_enabled_expanded_eap_array[i]->EapExpandedType); |
|
2852 |
|
2853 EAP_TRACE_DEBUG( |
|
2854 m_am_tools, |
|
2855 TRACE_FLAGS_DEFAULT, |
|
2856 (EAPL("eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL:Enabled expanded EAP type at index=%d\n"), |
|
2857 i)); |
|
2858 |
|
2859 EAP_TRACE_DATA_DEBUG( |
|
2860 m_am_tools, |
|
2861 TRACE_FLAGS_DEFAULT, |
|
2862 (EAPL("Enabled expanded EAP type:"), |
|
2863 tmpExpEAP.Ptr(), |
|
2864 tmpExpEAP.Size())); |
|
2865 |
|
2866 // This is for one expanded EAP type (for the above one). |
|
2867 eap_expanded_type_c expandedEAPType; |
|
2868 |
|
2869 // Read the expanded EAP type details for this item in m_enabled_expanded_eap_array. |
|
2870 eap_status_e status = eap_expanded_type_c::read_type(m_am_tools, |
|
2871 0, |
|
2872 tmpExpEAP.Ptr(), |
|
2873 tmpExpEAP.Size(), |
|
2874 &expandedEAPType); |
|
2875 if (status != eap_status_ok) |
|
2876 { |
|
2877 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2878 User::Leave(m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status))); |
|
2879 } |
|
2880 |
|
2881 if (aEapType == expandedEAPType) |
|
2882 { |
|
2883 // Found it. This is the EAP type which should be at top priority. |
|
2884 priorityIndex = i; |
|
2885 break; |
|
2886 } |
|
2887 } |
|
2888 |
|
2889 if(priorityIndex == 0) |
|
2890 { |
|
2891 // This means this EAP type is already at the top priority. |
|
2892 |
|
2893 EAP_TRACE_DEBUG( |
|
2894 m_am_tools, |
|
2895 TRACE_FLAGS_DEFAULT, |
|
2896 (EAPL("eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL() - This is already at top\n"))); |
|
2897 |
|
2898 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2899 return; |
|
2900 } |
|
2901 |
|
2902 if (priorityIndex >= m_enabled_expanded_eap_array.Count()) |
|
2903 { |
|
2904 // No such EAP type in enabled list. This should never happen. |
|
2905 EAP_TRACE_DEBUG( |
|
2906 m_am_tools, |
|
2907 TRACE_FLAGS_DEFAULT, |
|
2908 (EAPL("ERROR: eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL() - No such EAP in the enabled list\n"))); |
|
2909 |
|
2910 User::Leave(KErrNotFound); |
|
2911 } |
|
2912 |
|
2913 CWLanSettings* wlan = new(ELeave) CWLanSettings; |
|
2914 CleanupStack::PushL(wlan); |
|
2915 SWLANSettings wlanSettings; |
|
2916 if (wlan->Connect() != KErrNone) |
|
2917 { |
|
2918 // Could not connect to CommDB |
|
2919 User::Leave(KErrCouldNotConnect); |
|
2920 } |
|
2921 |
|
2922 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("SetToTopPriorityL():Connected to CommDbIf.\n"))); |
|
2923 |
|
2924 if (wlan->GetWlanSettingsForService(index, wlanSettings) != KErrNone) |
|
2925 { |
|
2926 wlan->Disconnect(); |
|
2927 User::Leave(KErrUnknown); |
|
2928 } |
|
2929 |
|
2930 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("SetToTopPriorityL():Got WLAN settings.\n"))); |
|
2931 |
|
2932 // Change the order |
|
2933 SEapExpandedType* TopPriorityEAP(m_enabled_expanded_eap_array[priorityIndex]); |
|
2934 |
|
2935 m_enabled_expanded_eap_array.Remove(priorityIndex); // This does not delete the object |
|
2936 |
|
2937 m_enabled_expanded_eap_array.Insert(TopPriorityEAP, 0); // Insert in the beginning. |
|
2938 |
|
2939 wlan->SetEapDataL(m_enabled_expanded_eap_array, m_disabled_expanded_eap_array); |
|
2940 |
|
2941 wlan->Disconnect(); |
|
2942 |
|
2943 CleanupStack::PopAndDestroy(wlan); |
|
2944 } |
|
2945 else |
|
2946 { |
|
2947 // At the moment only LAN bearer is supported. |
|
2948 |
|
2949 EAP_TRACE_DEBUG( |
|
2950 m_am_tools, |
|
2951 TRACE_FLAGS_DEFAULT, |
|
2952 (EAPL("eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL() - LEAVE - only LAN bearer is supported\n"))); |
|
2953 |
|
2954 User::Leave(KErrNotSupported); |
|
2955 } |
|
2956 |
|
2957 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2958 } |
|
2959 |
|
2960 #else // For normal EAP types |
|
2961 |
|
2962 void eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL(const TEap* const aEapType) |
|
2963 { |
|
2964 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2965 |
|
2966 EAP_TRACE_DEBUG( |
|
2967 m_am_tools, |
|
2968 TRACE_FLAGS_DEFAULT, |
|
2969 (EAPL("eapol_am_wlan_authentication_symbian_c::SetToTopPriorityL()\n"))); |
|
2970 |
|
2971 TIndexType index_type(ELan); |
|
2972 TUint index(0UL); |
|
2973 |
|
2974 eap_status_e status = read_database_reference_values( |
|
2975 &index_type, |
|
2976 &index); |
|
2977 if (status != eap_status_ok) |
|
2978 { |
|
2979 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2980 User::Leave(m_am_tools->convert_eapol_error_to_am_error(EAP_STATUS_RETURN(m_am_tools, status))); |
|
2981 } |
|
2982 |
|
2983 if (index_type == ELan) |
|
2984 { |
|
2985 TInt i(0); |
|
2986 TBuf8<3> uid; |
|
2987 for (i = 0; i < m_iap_eap_array.Count(); i++) |
|
2988 { |
|
2989 TEap* eap = m_iap_eap_array[i]; |
|
2990 if (eap->UID[0] == '0') |
|
2991 { |
|
2992 // Cut the leading zero |
|
2993 uid.Copy(eap->UID.Right(eap->UID.Length()-1)); |
|
2994 } |
|
2995 else |
|
2996 { |
|
2997 uid.Copy(eap->UID); |
|
2998 } |
|
2999 if (eap->Enabled == aEapType->Enabled |
|
3000 && uid.Compare(aEapType->UID) == 0) |
|
3001 { |
|
3002 // Found |
|
3003 break; |
|
3004 } |
|
3005 } |
|
3006 if (i >= m_iap_eap_array.Count()) |
|
3007 { |
|
3008 // This should never happen |
|
3009 User::Leave(KErrNotFound); |
|
3010 } |
|
3011 |
|
3012 TLex8 tmp(aEapType->UID); |
|
3013 TInt val(0); |
|
3014 tmp.Val(val); |
|
3015 |
|
3016 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Setting to top priority:\n"))); |
|
3017 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Old index: %d\n"), i)); |
|
3018 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL(" UID: %d\n"), val)); |
|
3019 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL(" Enabled: %d\n"), aEapType->Enabled)); |
|
3020 |
|
3021 if (i == 0) |
|
3022 { |
|
3023 // Already at the highest priority |
|
3024 return; |
|
3025 } |
|
3026 |
|
3027 CWLanSettings* wlan = new(ELeave) CWLanSettings; |
|
3028 CleanupStack::PushL(wlan); |
|
3029 SWLANSettings wlanSettings; |
|
3030 if (wlan->Connect() != KErrNone) |
|
3031 { |
|
3032 // Could not connect to CommDB |
|
3033 User::Leave(KErrCouldNotConnect); |
|
3034 } |
|
3035 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Connected to CommDbIf.\n"))); |
|
3036 |
|
3037 if (wlan->GetWlanSettingsForService(index, wlanSettings) != KErrNone) |
|
3038 { |
|
3039 wlan->Disconnect(); |
|
3040 User::Leave(KErrUnknown); |
|
3041 } |
|
3042 EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("Got WLAN settings.\n"))); |
|
3043 |
|
3044 // Change the order |
|
3045 TEap* eap = m_iap_eap_array[i]; |
|
3046 |
|
3047 m_iap_eap_array.Remove(i); // This does not delete the object |
|
3048 |
|
3049 m_iap_eap_array.Insert(eap, 0); |
|
3050 |
|
3051 wlan->SetEapDataL(m_iap_eap_array); |
|
3052 |
|
3053 wlan->Disconnect(); |
|
3054 |
|
3055 CleanupStack::PopAndDestroy(wlan); |
|
3056 } |
|
3057 else |
|
3058 { |
|
3059 // At the moment only LAN bearer is supported. |
|
3060 User::Leave(KErrNotSupported); |
|
3061 } |
|
3062 |
|
3063 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3064 } |
|
3065 |
|
3066 #endif // #ifdef USE_EAP_EXPANDED_TYPES |
1471 |
3067 |
1472 //-------------------------------------------------- |
3068 //-------------------------------------------------- |
1473 |
3069 |
1474 #if defined(USE_EAP_SIMPLE_CONFIG) |
3070 #if defined(USE_EAP_SIMPLE_CONFIG) |
1475 |
3071 |
1502 |
3097 |
1503 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
3098 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
1504 |
3099 |
1505 //-------------------------------------------------- |
3100 //-------------------------------------------------- |
1506 |
3101 |
1507 EAP_FUNC_EXPORT eap_status_e eapol_am_wlan_authentication_symbian_c::set_eap_database_reference_values( |
|
1508 const eap_variable_data_c * const reference) |
|
1509 { |
|
1510 EAP_TRACE_DEBUG( |
|
1511 m_am_tools, |
|
1512 TRACE_FLAGS_DEFAULT, |
|
1513 (EAPL("%s: eapol_am_wlan_authentication_symbian_c::set_eap_database_reference_values()\n"), |
|
1514 (m_is_client == true ? "client": "server"))); |
|
1515 EAP_TRACE_RETURN_STRING(m_am_tools, "returns: eapol_am_wlan_authentication_symbian_c::set_eap_database_reference_values()"); |
|
1516 |
|
1517 EAP_TRACE_DATA_DEBUG( |
|
1518 m_am_tools, |
|
1519 TRACE_FLAGS_DEFAULT, |
|
1520 (EAPL("eapol_am_wlan_authentication_symbian_c::set_eap_database_reference_values(): reference"), |
|
1521 reference->get_data(), |
|
1522 reference->get_data_length())); |
|
1523 |
|
1524 eap_status_e status = m_database_reference.set_copy_of_buffer(reference); |
|
1525 |
|
1526 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1527 } |
|
1528 |
|
1529 //-------------------------------------------------- |
|
1530 |
|
1531 EAP_FUNC_EXPORT eapol_am_wlan_authentication_c * eapol_am_wlan_authentication_c::new_eapol_am_wlan_authentication( |
3102 EAP_FUNC_EXPORT eapol_am_wlan_authentication_c * eapol_am_wlan_authentication_c::new_eapol_am_wlan_authentication( |
1532 abs_eap_am_tools_c * const tools, |
3103 abs_eap_am_tools_c * const tools, |
1533 const bool is_client_when_true) |
3104 const bool is_client_when_true, |
|
3105 const abs_eapol_wlan_database_reference_if_c * const wlan_database_reference) |
1534 { |
3106 { |
1535 EAP_TRACE_BEGIN(tools, TRACE_FLAGS_DEFAULT); |
3107 EAP_TRACE_BEGIN(tools, TRACE_FLAGS_DEFAULT); |
1536 |
|
1537 EAP_TRACE_DEBUG( |
|
1538 tools, |
|
1539 TRACE_FLAGS_DEFAULT, |
|
1540 (EAPL("eapol_am_wlan_authentication_symbian_c::new_eapol_am_wlan_authentication()\n"))); |
|
1541 EAP_TRACE_RETURN_STRING(tools, "returns: eapol_am_wlan_authentication_symbian_c::new_eapol_am_wlan_authentication()"); |
|
1542 |
3108 |
1543 eapol_am_wlan_authentication_c * const wauth = new eapol_am_wlan_authentication_symbian_c( |
3109 eapol_am_wlan_authentication_c * const wauth = new eapol_am_wlan_authentication_symbian_c( |
1544 tools, |
3110 tools, |
1545 is_client_when_true); |
3111 is_client_when_true, |
|
3112 wlan_database_reference); |
1546 |
3113 |
1547 EAP_TRACE_END(tools, TRACE_FLAGS_DEFAULT); |
3114 EAP_TRACE_END(tools, TRACE_FLAGS_DEFAULT); |
1548 return wauth; |
3115 return wauth; |
1549 } |
3116 } |
1550 |
3117 |
1551 |
3118 |
1552 //-------------------------------------------------- |
3119 //-------------------------------------------------- |
1553 |
|
1554 // |
|
1555 eap_session_core_base_c * new_eap_core_client_message_if_c( |
|
1556 abs_eap_am_tools_c * const tools, |
|
1557 abs_eap_session_core_c * const partner, |
|
1558 const bool is_client_when_true, |
|
1559 const u32_t MTU) |
|
1560 { |
|
1561 EAP_TRACE_DEBUG( |
|
1562 tools, |
|
1563 TRACE_FLAGS_DEFAULT, |
|
1564 (EAPL("new_eap_core_client_message_if_c()\n"))); |
|
1565 EAP_TRACE_RETURN_STRING(tools, "returns: new_eap_core_client_message_if_c()"); |
|
1566 |
|
1567 eap_am_message_if_c *client_if = new_eap_am_client_message_if_c( |
|
1568 tools, |
|
1569 is_client_when_true, |
|
1570 MTU); |
|
1571 |
|
1572 eap_automatic_variable_c<eap_am_message_if_c> automatic_server_if( |
|
1573 tools, |
|
1574 client_if); |
|
1575 |
|
1576 if (client_if == 0 |
|
1577 || client_if->get_is_valid() == false) |
|
1578 { |
|
1579 // ERROR. |
|
1580 if (client_if != 0) |
|
1581 { |
|
1582 EAP_TRACE_DEBUG( |
|
1583 tools, |
|
1584 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
1585 (EAPL("ERROR: calls: eap_session_core_base_c::new_eap_core_client_message_if_c(): client_if->shutdown(): %s.\n"), |
|
1586 (is_client_when_true == true) ? "client": "server")); |
|
1587 |
|
1588 (void) client_if->shutdown(); |
|
1589 } |
|
1590 |
|
1591 return 0; |
|
1592 } |
|
1593 |
|
1594 eap_core_client_message_if_c * new_session_core = new eap_core_client_message_if_c(tools, client_if, partner, is_client_when_true); |
|
1595 |
|
1596 eap_automatic_variable_c<eap_core_client_message_if_c> automatic_new_session_core( |
|
1597 tools, |
|
1598 new_session_core); |
|
1599 |
|
1600 if (new_session_core == 0 |
|
1601 || new_session_core->get_is_valid() == false) |
|
1602 { |
|
1603 // ERROR. |
|
1604 if (new_session_core != 0) |
|
1605 { |
|
1606 EAP_TRACE_DEBUG( |
|
1607 tools, |
|
1608 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
1609 (EAPL("ERROR: calls: eap_session_core_base_c::new_eap_core_client_message_if_c(): new_session_core->shutdown(): %s.\n"), |
|
1610 (is_client_when_true == true) ? "client": "server")); |
|
1611 |
|
1612 new_session_core->shutdown(); |
|
1613 } |
|
1614 |
|
1615 (void) client_if->shutdown(); |
|
1616 |
|
1617 return 0; |
|
1618 } |
|
1619 |
|
1620 client_if->set_partner(new_session_core); |
|
1621 |
|
1622 automatic_server_if.do_not_free_variable(); |
|
1623 automatic_new_session_core.do_not_free_variable(); |
|
1624 |
|
1625 return new_session_core; |
|
1626 } |
|
1627 |
|
1628 //-------------------------------------------------- |
|
1629 //-------------------------------------------------- |
3120 //-------------------------------------------------- |
1630 //-------------------------------------------------- |
3121 //-------------------------------------------------- |
1631 // End. |
3122 // End. |