33 #include "EapTlsPeap.h" |
33 #include "EapTlsPeap.h" |
34 #include "eap_base_type.h" |
34 #include "eap_base_type.h" |
35 #include "EapTlsPeapGlobal.h" |
35 #include "EapTlsPeapGlobal.h" |
36 #include <EapTypeInfo.h> |
36 #include <EapTypeInfo.h> |
37 |
37 |
38 |
|
39 #if defined(USE_FAST_EAP_TYPE) |
38 #if defined(USE_FAST_EAP_TYPE) |
40 #include "tls_application_eap_fast.h" |
39 #include "tls_application_eap_fast.h" |
41 #endif |
40 #endif |
42 |
41 |
43 #include "eap_am_type_tls_peap_symbian.h" |
42 #include "eap_am_type_tls_peap_symbian.h" |
44 #include "eap_type_tls_peap.h" |
43 #include "eap_type_tls_peap.h" |
45 #include "tls_record.h" |
44 #include "tls_record.h" |
|
45 #include "dummy_eap_core.h" |
46 #include "eap_core.h" |
46 #include "eap_core.h" |
47 #include "tls_application_eap_core.h" |
47 #include "tls_application_eap_core.h" |
48 #include "eap_am_tools_symbian.h" |
48 #include "eap_am_tools_symbian.h" |
49 #include "eap_am_trace_symbian.h" |
49 #include "EapTraceSymbian.h" |
|
50 #include "EapConversion.h" |
|
51 #include "EapExpandedType.h" |
50 |
52 |
51 #ifdef USE_PAC_STORE |
53 #ifdef USE_PAC_STORE |
52 #include "pac_store_db_symbian.h" |
54 #include "pac_store_db_symbian.h" |
53 #endif |
55 #endif |
54 |
56 |
|
57 #include "eapol_key_types.h" |
55 |
58 |
56 // LOCAL CONSTANTS |
59 // LOCAL CONSTANTS |
57 |
60 |
58 // The version number of this interface. At the moment this version number is |
61 // The version number of this interface. At the moment this version number is |
59 // common for all three plug-in interfaces. |
62 // common for all three plug-in interfaces. |
60 const TUint KInterfaceVersion = 1; |
63 const TUint KInterfaceVersion = 1; |
|
64 const u8_t EAP_RAS_SOURCE[] = "ras_src"; |
|
65 const u8_t EAP_RAS_DESTINATION[] = "ras_des"; |
61 |
66 |
62 |
67 |
63 // ================= MEMBER FUNCTIONS ======================= |
68 // ================= MEMBER FUNCTIONS ======================= |
64 |
69 |
65 |
70 |
68 const eap_type_value_e aEapType) |
73 const eap_type_value_e aEapType) |
69 : iIndexType(aIndexType) |
74 : iIndexType(aIndexType) |
70 , iIndex(aIndex) |
75 , iIndex(aIndex) |
71 , iEapType(aEapType) |
76 , iEapType(aEapType) |
72 , iTunnelingType(eap_type_none) |
77 , iTunnelingType(eap_type_none) |
73 { |
78 #if defined(USE_FAST_EAP_TYPE) |
74 |
79 , iApplication(NULL) |
75 #ifdef USE_EAP_EXPANDED_TYPES |
80 #endif |
|
81 , m_am_tools(abs_eap_am_tools_c::new_abs_eap_am_tools_c()) |
|
82 { |
|
83 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CEapTlsPeap()\n"))); |
|
84 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::CEapTlsPeap()\n")); |
|
85 |
|
86 if (m_am_tools == 0) |
|
87 { |
|
88 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
89 return; |
|
90 } |
76 |
91 |
77 ASSERT(iEapType.get_vendor_id() == eap_type_vendor_id_ietf); |
92 ASSERT(iEapType.get_vendor_id() == eap_type_vendor_id_ietf); |
78 ASSERT(iTunnelingType.get_vendor_id() == eap_type_vendor_id_ietf); |
93 ASSERT(iTunnelingType.get_vendor_id() == eap_type_vendor_id_ietf); |
79 |
94 |
80 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
95 #if defined(USE_FAST_EAP_TYPE) |
|
96 if(iEapType == eap_type_fast) |
|
97 { |
|
98 eap_variable_data_c source(m_am_tools); |
|
99 |
|
100 eap_status_e status = source.set_copy_of_buffer( |
|
101 EAP_RAS_SOURCE, |
|
102 sizeof(EAP_RAS_SOURCE)); |
|
103 if (status != eap_status_ok) |
|
104 { |
|
105 EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: CEapTlsPeap::CEapTlsPeap(): status = %s\n"), |
|
106 eap_status_string_c::get_status_string(status))); |
|
107 return; |
|
108 } |
|
109 |
|
110 eap_variable_data_c destination(m_am_tools); |
|
111 |
|
112 status = destination.set_copy_of_buffer( |
|
113 EAP_RAS_DESTINATION, |
|
114 sizeof(EAP_RAS_DESTINATION)); |
|
115 if (status != eap_status_ok) |
|
116 { |
|
117 EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: CEapTlsPeap::CEapTlsPeap(): status = %s\n"), |
|
118 eap_status_string_c::get_status_string(status))); |
|
119 return; |
|
120 } |
|
121 |
|
122 eap_am_network_id_c dummy_id(m_am_tools, &source, &destination, eapol_ethernet_type_pae); |
|
123 |
|
124 if (dummy_id.get_is_valid() == false) |
|
125 { |
|
126 EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: CEapTlsPeap::NewPeapL() dummy_id not valid\n"))); |
|
127 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
128 return; |
|
129 } |
|
130 |
|
131 if (dummy_id.get_is_valid_data() == false) |
|
132 { |
|
133 EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: CEapTlsPeap::NewPeapL() dummy_id data not valid\n"))); |
|
134 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
135 return; |
|
136 } |
|
137 |
|
138 |
|
139 TRAPD(err, iApplication = GetTlsInterfaceL( |
|
140 m_am_tools, |
|
141 true, |
|
142 &dummy_id)); |
|
143 if (err) |
|
144 { |
|
145 EAP_TRACE_DEBUG_SYMBIAN((_L("ERROR: CEapTlsPeap::NewPeapL() iApplication couldn't be created\n"))); |
|
146 |
|
147 } |
|
148 } |
|
149 #endif //#if defined(USE_FAST_EAP_TYPE) |
|
150 |
|
151 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
81 |
152 |
82 } |
153 } |
83 |
154 |
84 // ---------------------------------------------------------- |
155 // ---------------------------------------------------------- |
85 |
156 |
86 CEapTlsPeap* CEapTlsPeap::NewTlsL(SIapInfo *aIapInfo) |
157 CEapTlsPeap* CEapTlsPeap::NewTlsL(SIapInfo *aIapInfo) |
87 { |
158 { |
|
159 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::NewTlsL()\n"))); |
|
160 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::NewTlsL()\n")); |
|
161 |
88 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_tls); |
162 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_tls); |
89 } |
163 } |
90 |
164 |
91 // ---------------------------------------------------------- |
165 // ---------------------------------------------------------- |
92 |
166 |
93 CEapTlsPeap* CEapTlsPeap::NewPeapL(SIapInfo *aIapInfo) |
167 CEapTlsPeap* CEapTlsPeap::NewPeapL(SIapInfo *aIapInfo) |
94 { |
168 { |
|
169 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::NewPeapL()\n"))); |
|
170 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::NewPeapL()\n")); |
|
171 |
95 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_peap); |
172 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_peap); |
96 } |
173 } |
97 |
174 |
98 // ---------------------------------------------------------- |
175 // ---------------------------------------------------------- |
99 |
176 |
100 #if defined(USE_TTLS_EAP_TYPE) |
177 #if defined(USE_TTLS_EAP_TYPE) |
101 |
178 |
102 CEapTlsPeap* CEapTlsPeap::NewTtlsL(SIapInfo *aIapInfo) |
179 CEapTlsPeap* CEapTlsPeap::NewTtlsL(SIapInfo *aIapInfo) |
103 { |
180 { |
|
181 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::NewTtlsL()\n"))); |
|
182 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::NewTtlsL()\n")); |
|
183 |
104 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_ttls); |
184 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_ttls); |
105 } |
185 } |
106 |
186 |
107 #endif // #if defined(USE_TTLS_EAP_TYPE) |
187 #endif // #if defined(USE_TTLS_EAP_TYPE) |
108 |
188 |
125 |
208 |
126 #if defined(USE_FAST_EAP_TYPE) |
209 #if defined(USE_FAST_EAP_TYPE) |
127 |
210 |
128 CEapTlsPeap* CEapTlsPeap::NewFastL(SIapInfo *aIapInfo) |
211 CEapTlsPeap* CEapTlsPeap::NewFastL(SIapInfo *aIapInfo) |
129 { |
212 { |
|
213 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::NewFastL()\n"))); |
|
214 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::NewFastL()\n")); |
|
215 |
130 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_fast); |
216 return new (ELeave) CEapTlsPeap(aIapInfo->indexType, aIapInfo->index, eap_type_fast); |
131 } |
217 } |
132 |
218 |
133 #endif // #if defined(USE_FAST_EAP_TYPE) |
219 #endif // #if defined(USE_FAST_EAP_TYPE) |
134 |
220 |
135 // ---------------------------------------------------------- |
221 // ---------------------------------------------------------- |
136 |
222 |
137 CEapTlsPeap::~CEapTlsPeap() |
223 CEapTlsPeap::~CEapTlsPeap() |
138 { |
224 { |
|
225 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::~CEapTlsPeap()\n"))); |
|
226 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::~CEapTlsPeap()\n")); |
|
227 |
139 iEapArray.ResetAndDestroy(); |
228 iEapArray.ResetAndDestroy(); |
140 } |
229 |
141 |
230 if (iType != NULL) |
|
231 { |
|
232 iType->shutdown(); |
|
233 // type deletes all |
|
234 delete iType; |
|
235 iType = NULL; |
|
236 } |
|
237 |
|
238 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::~CEapTlsPeap() iType deleted\n"))); |
|
239 |
|
240 #if defined(USE_FAST_EAP_TYPE) |
|
241 if (iApplication != NULL) |
|
242 { |
|
243 // iApplication->shutdown(); |
|
244 // delete iApplication; |
|
245 iApplication = NULL; |
|
246 } |
|
247 #endif //#if defined(USE_FAST_EAP_TYPE) |
|
248 |
|
249 abs_eap_am_tools_c::delete_abs_eap_am_tools_c(m_am_tools); |
|
250 } |
|
251 |
|
252 #if defined(USE_FAST_EAP_TYPE) |
|
253 // ---------------------------------------------------------- |
|
254 tls_application_eap_fast_c* CEapTlsPeap::GetTlsInterfaceL(abs_eap_am_tools_c* const aTools, |
|
255 const bool is_client_when_true, |
|
256 const eap_am_network_id_c * const receive_network_id) |
|
257 { |
|
258 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::GetTlsInterfaceL()\n"))); |
|
259 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::GetTlsInterfaceL()\n")); |
|
260 |
|
261 EAP_TRACE_DEBUG_SYMBIAN( |
|
262 (_L("CEapTlsPeap::GetTlsInterfaceL -Start- iIndexType=%d, iIndex=%d, Tunneling vendor type=%d, Eap vendor type=%d \n"), |
|
263 iIndexType,iIndex, iTunnelingType.get_vendor_type(), iEapType.get_vendor_type())); |
|
264 |
|
265 // Create adaptation layer |
|
266 eap_am_type_tls_peap_symbian_c* amEapType; |
|
267 tls_record_c* record; |
|
268 |
|
269 eap_core_c* const eap_core = reinterpret_cast<eap_core_c *> (new dummy_eap_core_c( |
|
270 aTools, |
|
271 0, |
|
272 is_client_when_true, |
|
273 receive_network_id, |
|
274 true)); |
|
275 if (eap_core == 0) |
|
276 { |
|
277 // Out of memory |
|
278 User::Leave(KErrNoMemory); |
|
279 } |
|
280 else if (eap_core->get_is_valid() == false) |
|
281 { |
|
282 // Out of memory |
|
283 eap_core->shutdown(); |
|
284 delete eap_core; |
|
285 User::Leave(KErrGeneral); |
|
286 } |
|
287 |
|
288 EAP_TRACE_DEBUG_SYMBIAN( |
|
289 (_L("CEapTlsPeap::GetTlsInterfaceL - created eap_core_c \n"))); |
|
290 |
|
291 amEapType = eap_am_type_tls_peap_symbian_c::NewL( |
|
292 aTools, |
|
293 eap_core, |
|
294 iIndexType, |
|
295 iIndex, |
|
296 iTunnelingType, |
|
297 iEapType, |
|
298 is_client_when_true, |
|
299 receive_network_id); |
|
300 if (amEapType->get_is_valid() == false) |
|
301 { |
|
302 amEapType->shutdown(); |
|
303 delete amEapType; |
|
304 User::Leave(KErrGeneral); |
|
305 } |
|
306 |
|
307 EAP_TRACE_DEBUG_SYMBIAN( |
|
308 (_L("CEapTlsPeap::GetTlsInterfaceL - created eap_am_type_tls_peap_symbian_c \n"))); |
|
309 |
|
310 tls_application_eap_fast_c* application = 0; |
|
311 |
|
312 if(iEapType == eap_type_fast) |
|
313 { |
|
314 application = new tls_application_eap_fast_c( |
|
315 aTools, |
|
316 eap_core, |
|
317 true, |
|
318 is_client_when_true, |
|
319 iEapType, |
|
320 receive_network_id, |
|
321 amEapType); |
|
322 |
|
323 EAP_TRACE_DEBUG_SYMBIAN( |
|
324 (_L("CEapTlsPeap::GetTlsInterfaceL - created tls_application_eap_fast_c \n"))); |
|
325 application->start_initialize_PAC_store(); |
|
326 } |
|
327 |
|
328 |
|
329 /* |
|
330 { |
|
331 // PEAP, TTLS and FAST. |
|
332 |
|
333 eap_core_c* eap_core = new eap_core_c( |
|
334 aTools, |
|
335 0, |
|
336 is_client_when_true, |
|
337 receive_network_id, |
|
338 true); |
|
339 if (eap_core == 0) |
|
340 { |
|
341 // Out of memory |
|
342 amEapType->shutdown(); |
|
343 delete amEapType; |
|
344 User::Leave(KErrNoMemory); |
|
345 } |
|
346 else if (eap_core->get_is_valid() == false) |
|
347 { |
|
348 // Out of memory |
|
349 eap_core->shutdown(); |
|
350 delete eap_core; |
|
351 amEapType->shutdown(); |
|
352 delete amEapType; |
|
353 User::Leave(KErrGeneral); |
|
354 } |
|
355 |
|
356 EAP_TRACE_DEBUG_SYMBIAN( |
|
357 (_L("CEapTlsPeap::GetTlsInterfaceL - created eap_core_c \n"))); |
|
358 */ |
|
359 |
|
360 EAP_TRACE_DEBUG_SYMBIAN( |
|
361 (_L("CEapTlsPeap::GetTlsInterfaceL - Creating tls_record_c \n"))); |
|
362 |
|
363 record = new tls_record_c( |
|
364 aTools, |
|
365 amEapType, |
|
366 false, |
|
367 application, |
|
368 true, |
|
369 is_client_when_true, |
|
370 iEapType, |
|
371 receive_network_id); |
|
372 if (record == 0) |
|
373 { |
|
374 // Out of memory |
|
375 // application takes care of eap_core_c deletion |
|
376 application->shutdown(); |
|
377 delete application; |
|
378 amEapType->shutdown(); |
|
379 delete amEapType; |
|
380 User::Leave(KErrGeneral); |
|
381 } |
|
382 else if (record->get_is_valid() == false) |
|
383 { |
|
384 // Out of memory |
|
385 // record takes care of application deletion |
|
386 record->shutdown(); |
|
387 delete record; |
|
388 amEapType->shutdown(); |
|
389 delete amEapType; |
|
390 User::Leave(KErrGeneral); |
|
391 } |
|
392 |
|
393 EAP_TRACE_DEBUG_SYMBIAN( |
|
394 (_L("CEapTlsPeap::GetTlsInterfaceL - Creating the OS independent portion - eap_type_tls_peap_c \n"))); |
|
395 |
|
396 // Create the OS independent portion |
|
397 |
|
398 iType = new eap_type_tls_peap_c( |
|
399 aTools, |
|
400 eap_core, |
|
401 amEapType, |
|
402 true, |
|
403 record, |
|
404 true, |
|
405 is_client_when_true, |
|
406 iEapType, |
|
407 receive_network_id); |
|
408 if (iType == 0) |
|
409 { |
|
410 // Out of memory |
|
411 // record takes care of application deletion |
|
412 record->shutdown(); |
|
413 delete record; |
|
414 amEapType->shutdown(); |
|
415 delete amEapType; |
|
416 User::Leave(KErrNoMemory); |
|
417 } |
|
418 else if(iType->get_is_valid() == false) |
|
419 { |
|
420 iType->shutdown(); |
|
421 // type deletes all |
|
422 delete iType; |
|
423 iType = NULL; |
|
424 User::Leave(KErrGeneral); |
|
425 } |
|
426 |
|
427 return application; |
|
428 } |
|
429 #endif |
142 // ---------------------------------------------------------- |
430 // ---------------------------------------------------------- |
143 |
431 |
144 #ifdef USE_EAP_SIMPLE_CONFIG |
432 #ifdef USE_EAP_SIMPLE_CONFIG |
145 |
433 |
146 eap_base_type_c* CEapTlsPeap::GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
434 eap_base_type_c* CEapTlsPeap::GetStackInterfaceL(abs_eap_am_tools_c* const aTools, |
156 const bool is_client_when_true, |
444 const bool is_client_when_true, |
157 const eap_am_network_id_c * const receive_network_id) |
445 const eap_am_network_id_c * const receive_network_id) |
158 |
446 |
159 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
447 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
160 { |
448 { |
161 #ifdef USE_EAP_EXPANDED_TYPES |
449 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::GetStackInterfaceL()\n"))); |
162 |
450 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::GetStackInterfaceL()\n")); |
|
451 |
163 EAP_TRACE_DEBUG_SYMBIAN( |
452 EAP_TRACE_DEBUG_SYMBIAN( |
164 (_L("CEapTlsPeap::GetStackInterfaceL -Start- iIndexType=%d, iIndex=%d, Tunneling vendor type=%d, Eap vendor type=%d \n"), |
453 (_L("CEapTlsPeap::GetStackInterfaceL -Start- iIndexType=%d, iIndex=%d, Tunneling vendor type=%d, Eap vendor type=%d \n"), |
165 iIndexType,iIndex, iTunnelingType.get_vendor_type(), iEapType.get_vendor_type())); |
454 iIndexType,iIndex, iTunnelingType.get_vendor_type(), iEapType.get_vendor_type())); |
166 |
|
167 #else |
|
168 |
|
169 EAP_TRACE_DEBUG_SYMBIAN( |
|
170 (_L("CEapTlsPeap::GetStackInterfaceL -Start- iIndexType=%d, iIndex=%d, iTunnelingType=%d, iEapType=%d \n"), |
|
171 iIndexType, iIndex, iTunnelingType, iEapType)); |
|
172 |
|
173 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
174 |
455 |
175 // Create adaptation layer |
456 // Create adaptation layer |
176 eap_am_type_tls_peap_symbian_c* amEapType; |
457 eap_am_type_tls_peap_symbian_c* amEapType; |
177 eap_base_type_c* type; |
458 eap_base_type_c* type; |
178 tls_record_c* record; |
459 tls_record_c* record; |
375 |
656 |
376 return type; |
657 return type; |
377 } |
658 } |
378 |
659 |
379 // ---------------------------------------------------------- |
660 // ---------------------------------------------------------- |
380 TInt CEapTlsPeap::InvokeUiL() |
661 |
381 { |
662 CEapTypeInfo* CEapTlsPeap::GetInfoL() |
382 TInt buttonId(0); |
663 { |
383 return buttonId; |
664 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::GetInfoL()\n"))); |
384 } |
665 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::GetInfoL()\n")); |
385 // ---------------------------------------------------------- |
666 |
386 CEapTypeInfo* CEapTlsPeap::GetInfoLC() |
|
387 { |
|
388 CEapTypeInfo* info = new(ELeave) CEapTypeInfo((TDesC&)KReleaseDate, (TDesC&)KEapTypeVersion, |
667 CEapTypeInfo* info = new(ELeave) CEapTypeInfo((TDesC&)KReleaseDate, (TDesC&)KEapTypeVersion, |
389 (TDesC&)KManufacturer); |
668 (TDesC&)KManufacturer); |
390 CleanupStack::PushL(info); |
669 |
391 return info; |
670 return info; |
392 } |
671 } |
393 |
672 |
394 // ---------------------------------------------------------- |
673 // ---------------------------------------------------------- |
395 |
674 |
396 void CEapTlsPeap::DeleteConfigurationL() |
675 void CEapTlsPeap::DeleteConfigurationL() |
397 { |
676 { |
398 #ifdef USE_EAP_EXPANDED_TYPES |
677 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL()\n"))); |
399 |
678 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::DeleteConfigurationL()\n")); |
|
679 |
400 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
680 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
401 TUint aEapVendorType = iEapType.get_vendor_type(); |
681 TUint aEapVendorType = iEapType.get_vendor_type(); |
402 |
|
403 #else |
|
404 |
|
405 TUint aTunnelingVendorType = static_cast<TUint>(iTunnelingType); |
|
406 TUint aEapVendorType = static_cast<TUint>(iEapType); |
|
407 |
|
408 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
409 |
682 |
410 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL:Start:iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
683 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL:Start:iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
411 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
684 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
412 |
685 |
413 EapTlsPeapUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType, iEapType); |
686 EapTlsPeapUtils::DeleteConfigurationL(iIndexType, iIndex, iTunnelingType, iEapType); |
429 iEapArray.ResetAndDestroy(); |
702 iEapArray.ResetAndDestroy(); |
430 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
703 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
431 |
704 |
432 for (TInt i = 0; i < iEapArray.Count(); i++) |
705 for (TInt i = 0; i < iEapArray.Count(); i++) |
433 { |
706 { |
434 if ((iEapType == eap_type_peap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
707 if ((iEapType == eap_type_peap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
435 || (iEapType == eap_type_ttls && !CEapType::IsDisallowedInsideTTLS(*iEapArray[i])) |
708 || (iEapType == eap_type_ttls && !CEapTypePlugin::IsDisallowedInsideTTLS(*iEapArray[i])) |
436 |
709 |
437 #ifdef USE_FAST_EAP_TYPE |
710 #ifdef USE_FAST_EAP_TYPE |
438 || (iEapType == eap_type_fast && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
711 || (iEapType == eap_type_fast && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
439 #endif |
712 #endif |
440 |
713 |
441 || (iEapType == eap_type_ttls_plain_pap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
714 || (iEapType == eap_type_ttls_plain_pap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
442 |
715 |
443 |
716 |
444 ) |
717 ) |
445 { |
718 { |
446 // Deleting the encapsulated EAP type configurations possible inside PEAP, TTLS and FAST. |
719 // Deleting the encapsulated EAP type configurations possible inside PEAP, TTLS and FAST. |
447 |
720 |
448 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL: Deleting encapsulated types for EAP type=%d"), |
721 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL: Deleting encapsulated types for EAP type=%d"), |
449 aEapVendorType)); |
722 aEapVendorType)); |
450 |
723 |
451 CEapType* eapType; |
724 CEapTypePlugin* eapType; |
452 |
725 |
453 #ifdef USE_EAP_EXPANDED_TYPES |
726 TEapExpandedType expandedCue = iEapArray[i]->DataType(); |
454 |
|
455 TBuf8<KExpandedEAPTypeSize> expandedCue = iEapArray[i]->DataType(); |
|
456 |
727 |
457 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::DeleteConfigurationL: Expanded cue:", |
728 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::DeleteConfigurationL: Expanded cue:", |
458 expandedCue.Ptr(), expandedCue.Size())); |
729 expandedCue.GetValue().Ptr(), expandedCue.GetValue().Size())); |
459 |
730 |
460 eapType = CEapType::NewL(expandedCue, iIndexType, iIndex); |
731 eapType = CEapTypePlugin::NewL(expandedCue.GetValue(), iIndexType, iIndex); |
461 |
732 |
462 if(eapType == NULL) |
733 if(eapType == NULL) |
463 { |
734 { |
464 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL: Ecom Error - No specified Expanded EAP plugin")) ); |
735 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL: Ecom Error - No specified Expanded EAP plugin")) ); |
465 User::Leave(KErrNotFound); |
736 User::Leave(KErrNotFound); |
466 } |
737 } |
467 |
738 |
468 eapType->SetTunnelingType(iEapType.get_vendor_type()); |
739 // eapType->SetTunnelingType(iEapType.get_vendor_type()); |
|
740 TEapExpandedType aExpandedType; |
|
741 |
|
742 TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType( |
|
743 &iEapType, |
|
744 &aExpandedType); |
|
745 |
|
746 eapType->SetTunnelingType(aExpandedType); |
469 |
747 |
470 #ifdef USE_FAST_EAP_TYPE |
748 #ifdef USE_FAST_EAP_TYPE |
471 |
749 |
472 // This IAP is deleted. Update the PAC store cleanup table if this IAP is |
750 // This IAP is deleted. Update the PAC store cleanup table if this IAP is |
473 // for EAP-FAST. |
751 // for EAP-FAST. |
494 #endif // #ifdef USE_PAC_STORE |
772 #endif // #ifdef USE_PAC_STORE |
495 |
773 |
496 } |
774 } |
497 |
775 |
498 #endif // #ifdef USE_FAST_EAP_TYPE |
776 #endif // #ifdef USE_FAST_EAP_TYPE |
499 #endif // USE_EAP_EXPANDED_TYPES |
777 |
500 |
|
501 |
|
502 #ifndef USE_EAP_EXPANDED_TYPES |
|
503 //#else // For normal EAP types. |
|
504 |
|
505 TBuf8<3> cue = iEapArray[i]->DataType(); |
|
506 |
|
507 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::DeleteConfigurationL: cue:", |
|
508 cue.Ptr(), cue.Size())); |
|
509 |
|
510 eapType = CEapType::NewL(cue, iIndexType, iIndex); |
|
511 |
|
512 if(eapType == NULL) |
|
513 { |
|
514 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::DeleteConfigurationL: Ecom Error - No specified EAP plugin")) ); |
|
515 User::Leave(KErrNotFound); |
|
516 } |
|
517 |
|
518 eapType->SetTunnelingType(iEapType); |
|
519 |
|
520 #endif //#ifndef USE_EAP_EXPANDED_TYPES |
|
521 |
|
522 EAP_TRACE_DEBUG_SYMBIAN( |
778 EAP_TRACE_DEBUG_SYMBIAN( |
523 (_L("CEapTlsPeap::DeleteConfigurationL: PushL(...)"))); |
779 (_L("CEapTlsPeap::DeleteConfigurationL: PushL(...)"))); |
524 |
780 |
525 CleanupStack::PushL(eapType); |
781 CleanupStack::PushL(eapType); |
526 |
782 |
539 |
795 |
540 // ---------------------------------------------------------- |
796 // ---------------------------------------------------------- |
541 |
797 |
542 TUint CEapTlsPeap::GetInterfaceVersion() |
798 TUint CEapTlsPeap::GetInterfaceVersion() |
543 { |
799 { |
|
800 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::GetInterfaceVersion()\n"))); |
|
801 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::GetInterfaceVersion()\n")); |
|
802 |
544 return KInterfaceVersion; |
803 return KInterfaceVersion; |
545 } |
804 } |
546 |
805 |
547 // ---------------------------------------------------------- |
806 // ---------------------------------------------------------- |
548 |
807 |
549 void CEapTlsPeap::SetTunnelingType(const TInt aTunnelingType) |
808 void CEapTlsPeap::SetTunnelingType(const TEapExpandedType aTunnelingType) |
550 { |
809 { |
551 #ifdef USE_EAP_EXPANDED_TYPES |
810 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetTunnelingType()\n"))); |
552 |
811 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::SetTunnelingType()\n")); |
553 // Vendor id is eap_type_vendor_id_ietf always in this plugin. |
812 |
554 iTunnelingType.set_eap_type_values(eap_type_vendor_id_ietf, aTunnelingType); |
813 EAP_TRACE_DATA_DEBUG_SYMBIAN( |
555 |
814 (EAPL("CEapTlsPeap::SetTunnelingType - tunneling type"), |
556 #else |
815 aTunnelingType.GetValue().Ptr(), aTunnelingType.GetValue().Length())); |
557 |
816 |
558 iTunnelingType = static_cast<eap_type_value_e>(aTunnelingType); |
817 eap_type_value_e aInternalType; |
559 |
818 |
560 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
819 TInt err = CEapConversion::ConvertExpandedEAPTypeToInternalType( |
561 } |
820 &aTunnelingType, |
562 |
821 &aInternalType); |
563 // ---------------------------------------------------------- |
822 |
|
823 iTunnelingType = aInternalType; |
|
824 } |
|
825 |
|
826 // ---------------------------------------------------------- |
|
827 |
564 void CEapTlsPeap::SetIndexL( |
828 void CEapTlsPeap::SetIndexL( |
565 const TIndexType aIndexType, |
829 const TIndexType aIndexType, |
566 const TInt aIndex) |
830 const TInt aIndex) |
567 { |
831 { |
568 #ifdef USE_EAP_EXPANDED_TYPES |
832 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL()\n"))); |
569 |
833 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::SetIndexL()\n")); |
|
834 |
570 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
835 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
571 TUint aEapVendorType = iEapType.get_vendor_type(); |
836 TUint aEapVendorType = iEapType.get_vendor_type(); |
572 |
|
573 #else |
|
574 |
|
575 TUint aTunnelingVendorType = static_cast<TUint>(iTunnelingType); |
|
576 TUint aEapVendorType = static_cast<TUint>(iEapType); |
|
577 |
|
578 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
579 |
837 |
580 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL:Start: Old: iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
838 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL:Start: Old: iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
581 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
839 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
582 |
840 |
583 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL: New: IndexType=%d,Index=%d"), |
841 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL: New: IndexType=%d,Index=%d"), |
614 |
872 |
615 #ifdef USE_FAST_EAP_TYPE |
873 #ifdef USE_FAST_EAP_TYPE |
616 TPtrC fastSpecialSettings; |
874 TPtrC fastSpecialSettings; |
617 #endif |
875 #endif |
618 |
876 |
619 #ifdef USE_EAP_EXPANDED_TYPES |
877 if (iEapType == eap_type_tls) |
620 |
878 { |
621 switch (iEapType.get_vendor_type()) |
879 settings.Set(KTlsDatabaseTableName); |
622 |
880 usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
623 #else |
881 cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
624 |
882 ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
625 switch (iEapType) |
883 } |
626 |
884 else if (iEapType == eap_type_peap) |
627 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
885 { |
628 { |
886 settings.Set(KPeapDatabaseTableName); |
629 case eap_type_tls: |
887 usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
630 { |
888 cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
631 settings.Set(KTlsDatabaseTableName); |
889 ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
632 usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
890 } |
633 cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
|
634 ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
|
635 } |
|
636 break; |
|
637 |
|
638 case eap_type_peap: |
|
639 { |
|
640 settings.Set(KPeapDatabaseTableName); |
|
641 usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
|
642 cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
|
643 ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
|
644 } |
|
645 break; |
|
646 |
|
647 #if defined (USE_TTLS_EAP_TYPE) |
891 #if defined (USE_TTLS_EAP_TYPE) |
648 case eap_type_ttls: |
892 else if (iEapType == eap_type_ttls) |
649 { |
893 { |
650 settings.Set(KTtlsDatabaseTableName); |
894 settings.Set(KTtlsDatabaseTableName); |
651 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
895 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
652 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
896 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
653 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
897 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
654 } |
898 } |
655 break; |
|
656 #endif |
899 #endif |
657 |
|
658 #ifdef USE_FAST_EAP_TYPE |
900 #ifdef USE_FAST_EAP_TYPE |
659 case eap_type_fast: |
901 else if (iEapType == eap_type_fast) |
660 { |
902 { |
661 settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
903 settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
662 fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
904 fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
663 |
905 |
664 usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
906 usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
665 cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
907 cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
666 ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
908 ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
667 } |
909 } |
668 break; |
|
669 #endif |
910 #endif |
670 |
911 else if (iEapType == eap_type_ttls_plain_pap) |
671 case eap_type_ttls_plain_pap: |
912 { |
672 { |
913 settings.Set(KTtlsDatabaseTableName); |
673 settings.Set(KTtlsDatabaseTableName); |
914 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
674 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
915 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
675 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
916 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
676 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
917 } |
677 } |
918 else |
678 break; |
919 { |
679 |
|
680 default: |
|
681 // Should never happen |
920 // Should never happen |
682 User::Leave(KErrArgument); |
921 User::Leave(KErrArgument); |
683 } |
922 } |
684 |
923 |
685 EAP_TRACE_DEBUG_SYMBIAN( |
924 EAP_TRACE_DEBUG_SYMBIAN( |
782 iEapArray.ResetAndDestroy(); |
1022 iEapArray.ResetAndDestroy(); |
783 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
1023 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
784 |
1024 |
785 for (TInt i = 0; i < iEapArray.Count(); i++) |
1025 for (TInt i = 0; i < iEapArray.Count(); i++) |
786 { |
1026 { |
787 if ((iEapType == eap_type_peap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1027 if ((iEapType == eap_type_peap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
788 || (iEapType == eap_type_ttls && !CEapType::IsDisallowedInsideTTLS(*iEapArray[i])) |
1028 || (iEapType == eap_type_ttls && !CEapTypePlugin::IsDisallowedInsideTTLS(*iEapArray[i])) |
789 |
1029 |
790 #ifdef USE_FAST_EAP_TYPE |
1030 #ifdef USE_FAST_EAP_TYPE |
791 || (iEapType == eap_type_fast && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1031 || (iEapType == eap_type_fast && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
792 #endif |
1032 #endif |
793 |
1033 |
794 || (iEapType == eap_type_ttls_plain_pap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1034 || (iEapType == eap_type_ttls_plain_pap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
795 |
1035 |
796 |
1036 |
797 ) |
1037 ) |
798 { |
1038 { |
799 // Setting the index for encapsulated EAP type configurations possible |
1039 // Setting the index for encapsulated EAP type configurations possible |
800 // inside PEAP, TTLS and FAST. |
1040 // inside PEAP, TTLS and FAST. |
801 |
1041 |
802 EAP_TRACE_DEBUG_SYMBIAN( |
1042 EAP_TRACE_DEBUG_SYMBIAN( |
803 (_L("EapTlsPeapUtils::SetIndexL - Setting the index to encapsulated EAP types\n"))); |
1043 (_L("EapTlsPeapUtils::SetIndexL - Setting the index to encapsulated EAP types\n"))); |
804 |
1044 |
805 CEapType* eapType; |
1045 CEapTypePlugin* eapType; |
806 |
1046 |
807 #ifdef USE_EAP_EXPANDED_TYPES |
1047 TEapExpandedType expandedCue = iEapArray[i]->DataType(); |
808 |
|
809 TBuf8<KExpandedEAPTypeSize> expandedCue = iEapArray[i]->DataType(); |
|
810 |
1048 |
811 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::SetIndexL: Expanded cue:", |
1049 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::SetIndexL: Expanded cue:", |
812 expandedCue.Ptr(), expandedCue.Size())); |
1050 expandedCue.GetValue().Ptr(), expandedCue.GetValue().Size())); |
813 |
1051 |
814 eapType = CEapType::NewL(expandedCue, iIndexType, iIndex); |
1052 eapType = CEapTypePlugin::NewL(expandedCue.GetValue(), iIndexType, iIndex); |
815 |
1053 |
816 if(eapType == NULL) |
1054 if(eapType == NULL) |
817 { |
1055 { |
818 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL: Ecom Error - No specified Expanded EAP plugin")) ); |
1056 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetIndexL: Ecom Error - No specified Expanded EAP plugin")) ); |
819 User::Leave(KErrNotFound); |
1057 User::Leave(KErrNotFound); |
820 } |
1058 } |
821 |
1059 |
822 eapType->SetTunnelingType(iEapType.get_vendor_type()); |
1060 TEapExpandedType aExpandedType; |
823 |
1061 |
824 #else // For normal EAP types. |
1062 eap_type_value_e value = iEapType;//.get_vendor_type(); |
825 |
1063 TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType( |
826 TBuf8<3> cue = iEapArray[i]->DataType(); |
1064 &value, |
827 |
1065 &aExpandedType); |
828 eapType = CEapType::NewL(cue, iIndexType, iIndex); |
1066 |
829 |
1067 eapType->SetTunnelingType(aExpandedType); |
830 eapType->SetTunnelingType(iEapType); |
|
831 |
|
832 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
833 |
1068 |
834 CleanupStack::PushL(eapType); |
1069 CleanupStack::PushL(eapType); |
835 |
1070 |
836 eapType->SetIndexL(aIndexType, aIndex); |
1071 eapType->SetIndexL(aIndexType, aIndex); |
837 |
1072 |
847 |
1082 |
848 EAP_TRACE_DEBUG_SYMBIAN( |
1083 EAP_TRACE_DEBUG_SYMBIAN( |
849 (_L("EapTlsPeapUtils::SetIndexL - End\n"))); |
1084 (_L("EapTlsPeapUtils::SetIndexL - End\n"))); |
850 } |
1085 } |
851 |
1086 |
|
1087 // ---------------------------------------------------------- |
|
1088 |
852 void CEapTlsPeap::SetConfigurationL(const EAPSettings& aSettings) |
1089 void CEapTlsPeap::SetConfigurationL(const EAPSettings& aSettings) |
853 { |
1090 { |
|
1091 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::SetConfigurationL()\n"))); |
|
1092 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::SetConfigurationL()\n")); |
|
1093 |
854 RDbNamedDatabase db; |
1094 RDbNamedDatabase db; |
855 |
1095 |
856 RDbs session; |
1096 RFs session; |
857 |
1097 |
858 // This also creates the IAP entry if it doesn't exist |
1098 // This also creates the IAP entry if it doesn't exist |
859 EapTlsPeapUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType, iEapType); |
1099 EapTlsPeapUtils::OpenDatabaseL(db, session, iIndexType, iIndex, iTunnelingType, iEapType); |
860 |
1100 |
861 CleanupClosePushL(session); |
1101 CleanupClosePushL(session); |
891 iIndex, |
1137 iIndex, |
892 iTunnelingType, |
1138 iTunnelingType, |
893 iEapType); |
1139 iEapType); |
894 |
1140 |
895 db.Close(); |
1141 db.Close(); |
896 CleanupStack::PopAndDestroy(2); // db, session |
1142 CleanupStack::PopAndDestroy(&db); |
897 } |
1143 CleanupStack::PopAndDestroy(&session); |
|
1144 } |
|
1145 |
|
1146 // ---------------------------------------------------------- |
898 |
1147 |
899 void CEapTlsPeap::CopySettingsL( |
1148 void CEapTlsPeap::CopySettingsL( |
900 const TIndexType aDestinationIndexType, |
1149 const TIndexType aDestinationIndexType, |
901 const TInt aDestinationIndex) |
1150 const TInt aDestinationIndex) |
902 { |
1151 { |
903 #ifdef USE_EAP_EXPANDED_TYPES |
1152 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL()\n"))); |
904 |
1153 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::CopySettingsL()\n")); |
|
1154 |
905 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
1155 TUint aTunnelingVendorType = iTunnelingType.get_vendor_type(); |
906 TUint aEapVendorType = iEapType.get_vendor_type(); |
1156 TUint aEapVendorType = iEapType.get_vendor_type(); |
907 |
|
908 #else |
|
909 |
|
910 TUint aTunnelingVendorType = static_cast<TUint>(iTunnelingType); |
|
911 TUint aEapVendorType = static_cast<TUint>(iEapType); |
|
912 |
|
913 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
914 |
1157 |
915 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL:Start:iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
1158 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL:Start:iIndexType=%d,iIndex=%d,TunnelingType=%d,EapType=%d"), |
916 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
1159 iIndexType, iIndex, aTunnelingVendorType, aEapVendorType)); |
917 |
1160 |
918 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL: DestinationIndexType=%d,DestinationIndex=%d"), |
1161 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL: DestinationIndexType=%d,DestinationIndex=%d"), |
945 |
1188 |
946 #ifdef USE_FAST_EAP_TYPE |
1189 #ifdef USE_FAST_EAP_TYPE |
947 TPtrC fastSpecialSettings; |
1190 TPtrC fastSpecialSettings; |
948 #endif |
1191 #endif |
949 |
1192 |
950 #ifdef USE_EAP_EXPANDED_TYPES |
1193 if (iEapType == eap_type_tls) |
951 |
1194 { |
952 switch (iEapType.get_vendor_type()) |
1195 settings.Set(KTlsDatabaseTableName); |
953 |
1196 usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
954 #else |
1197 cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
955 |
1198 ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
956 switch (iEapType) |
1199 } |
957 |
1200 else if (iEapType == eap_type_peap) |
958 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
1201 { |
959 { |
1202 settings.Set(KPeapDatabaseTableName); |
960 case eap_type_tls: |
1203 usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
961 { |
1204 cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
962 settings.Set(KTlsDatabaseTableName); |
1205 ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
963 usercerts.Set(KTlsAllowedUserCertsDatabaseTableName); |
1206 } |
964 cacerts.Set(KTlsAllowedCACertsDatabaseTableName); |
|
965 ciphersuites.Set(KTlsAllowedCipherSuitesDatabaseTableName); |
|
966 } |
|
967 break; |
|
968 |
|
969 case eap_type_peap: |
|
970 { |
|
971 settings.Set(KPeapDatabaseTableName); |
|
972 usercerts.Set(KPeapAllowedUserCertsDatabaseTableName); |
|
973 cacerts.Set(KPeapAllowedCACertsDatabaseTableName); |
|
974 ciphersuites.Set(KPeapAllowedCipherSuitesDatabaseTableName); |
|
975 } |
|
976 break; |
|
977 |
|
978 #if defined (USE_TTLS_EAP_TYPE) |
1207 #if defined (USE_TTLS_EAP_TYPE) |
979 case eap_type_ttls: |
1208 else if (iEapType == eap_type_ttls) |
980 { |
1209 { |
981 settings.Set(KTtlsDatabaseTableName); |
1210 settings.Set(KTtlsDatabaseTableName); |
982 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
1211 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
983 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
1212 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
984 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
1213 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
985 } |
1214 } |
986 break; |
|
987 #endif |
1215 #endif |
988 |
1216 else if (iEapType == eap_type_ttls_plain_pap) |
989 case eap_type_ttls_plain_pap: |
1217 { |
990 { |
1218 settings.Set(KTtlsDatabaseTableName); |
991 settings.Set(KTtlsDatabaseTableName); |
1219 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
992 usercerts.Set(KTtlsAllowedUserCertsDatabaseTableName); |
1220 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
993 cacerts.Set(KTtlsAllowedCACertsDatabaseTableName); |
1221 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
994 ciphersuites.Set(KTtlsAllowedCipherSuitesDatabaseTableName); |
1222 } |
995 } |
|
996 break; |
|
997 |
|
998 #ifdef USE_FAST_EAP_TYPE |
1223 #ifdef USE_FAST_EAP_TYPE |
999 case eap_type_fast: |
1224 else if (iEapType == eap_type_fast) |
1000 { |
1225 { |
1001 settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
1226 settings.Set(KFastGeneralSettingsDBTableName); // This is general settings for FAST. |
1002 fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
1227 fastSpecialSettings.Set(KFastSpecialSettingsDBTableName); |
1003 |
1228 |
1004 usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
1229 usercerts.Set(KFastAllowedUserCertsDatabaseTableName); |
1005 cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
1230 cacerts.Set(KFastAllowedCACertsDatabaseTableName); |
1006 ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
1231 ciphersuites.Set(KFastAllowedCipherSuitesDatabaseTableName); |
1007 } |
1232 } |
1008 break; |
|
1009 #endif |
1233 #endif |
1010 |
1234 else |
1011 default: |
1235 { |
1012 // Should never happen |
1236 // Should never happen |
1013 User::Leave(KErrArgument); |
1237 User::Leave(KErrArgument); |
1014 } |
1238 } |
1015 |
1239 |
1016 EAP_TRACE_DEBUG_SYMBIAN( |
1240 EAP_TRACE_DEBUG_SYMBIAN( |
1117 iEapArray.ResetAndDestroy(); |
1342 iEapArray.ResetAndDestroy(); |
1118 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
1343 REComSession::ListImplementationsL(KEapTypeInterfaceUid, iEapArray); |
1119 |
1344 |
1120 for (TInt i = 0; i < iEapArray.Count(); i++) |
1345 for (TInt i = 0; i < iEapArray.Count(); i++) |
1121 { |
1346 { |
1122 if ((iEapType == eap_type_peap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1347 if ((iEapType == eap_type_peap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
1123 || (iEapType == eap_type_ttls && !CEapType::IsDisallowedInsideTTLS(*iEapArray[i])) |
1348 || (iEapType == eap_type_ttls && !CEapTypePlugin::IsDisallowedInsideTTLS(*iEapArray[i])) |
1124 |
1349 |
1125 #ifdef USE_FAST_EAP_TYPE |
1350 #ifdef USE_FAST_EAP_TYPE |
1126 || (iEapType == eap_type_fast && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1351 || (iEapType == eap_type_fast && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
1127 #endif |
1352 #endif |
1128 |
1353 |
1129 || (iEapType == eap_type_ttls_plain_pap && !CEapType::IsDisallowedInsidePEAP(*iEapArray[i])) |
1354 || (iEapType == eap_type_ttls_plain_pap && !CEapTypePlugin::IsDisallowedInsidePEAP(*iEapArray[i])) |
1130 |
1355 |
1131 ) |
1356 ) |
1132 { |
1357 { |
1133 // Copying the settings of encapsulated EAP type configurations possible inside PEAP and TTLS. |
1358 // Copying the settings of encapsulated EAP type configurations possible inside PEAP and TTLS. |
1134 |
1359 |
1135 CEapType* eapType; |
1360 CEapTypePlugin* eapType; |
1136 |
1361 |
1137 #ifdef USE_EAP_EXPANDED_TYPES |
1362 TEapExpandedType expandedCue = iEapArray[i]->DataType(); |
1138 |
|
1139 TBuf8<KExpandedEAPTypeSize> expandedCue = iEapArray[i]->DataType(); |
|
1140 |
1363 |
1141 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::CopySettingsL: Expanded cue:", |
1364 EAP_TRACE_DATA_DEBUG_SYMBIAN(("CEapTlsPeap::CopySettingsL: Expanded cue:", |
1142 expandedCue.Ptr(), expandedCue.Size())); |
1365 expandedCue.GetValue().Ptr(), expandedCue.GetValue().Size())); |
1143 |
1366 |
1144 eapType = CEapType::NewL(expandedCue, iIndexType, iIndex); |
1367 eapType = CEapTypePlugin::NewL(expandedCue.GetValue(), iIndexType, iIndex); |
1145 |
1368 |
1146 if(eapType == NULL) |
1369 if(eapType == NULL) |
1147 { |
1370 { |
1148 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL: Ecom Error - No specified Expanded EAP plugin")) ); |
1371 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::CopySettingsL: Ecom Error - No specified Expanded EAP plugin")) ); |
1149 User::Leave(KErrNotFound); |
1372 User::Leave(KErrNotFound); |
1150 } |
1373 } |
1151 |
1374 |
1152 eapType->SetTunnelingType(iEapType.get_vendor_type()); |
1375 TEapExpandedType aExpandedType; |
1153 |
1376 |
1154 #else // For normal EAP types. |
1377 TInt err = CEapConversion::ConvertInternalTypeToExpandedEAPType( |
1155 |
1378 &iEapType, |
1156 TBuf8<3> cue = iEapArray[i]->DataType(); |
1379 &aExpandedType); |
1157 |
1380 |
1158 eapType = CEapType::NewL(cue, iIndexType, iIndex); |
1381 eapType->SetTunnelingType(aExpandedType); |
1159 |
1382 |
1160 eapType->SetTunnelingType(iEapType); |
1383 //eapType->SetTunnelingType(iEapType.get_vendor_type()); |
1161 |
1384 |
1162 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
|
1163 |
|
1164 CleanupStack::PushL(eapType); |
1385 CleanupStack::PushL(eapType); |
1165 |
1386 |
1166 eapType->CopySettingsL(aDestinationIndexType, aDestinationIndex); |
1387 eapType->CopySettingsL(aDestinationIndexType, aDestinationIndex); |
1167 |
1388 |
1168 EAP_TRACE_DEBUG_SYMBIAN( |
1389 EAP_TRACE_DEBUG_SYMBIAN( |
1176 EAP_TRACE_DEBUG_SYMBIAN( |
1397 EAP_TRACE_DEBUG_SYMBIAN( |
1177 (_L("EapTlsPeapUtils::CopySettingsL - End \n"))); |
1398 (_L("EapTlsPeapUtils::CopySettingsL - End \n"))); |
1178 |
1399 |
1179 } |
1400 } |
1180 |
1401 |
|
1402 // ---------------------------------------------------------- |
|
1403 |
1181 #ifdef USE_PAC_STORE |
1404 #ifdef USE_PAC_STORE |
1182 |
1405 |
1183 void CEapTlsPeap::UpdatePacStoreCleanupTableL(const TIndexType aIndexType, |
1406 void CEapTlsPeap::UpdatePacStoreCleanupTableL(const TIndexType aIndexType, |
1184 const TInt aIndex, |
1407 const TInt aIndex, |
1185 const eap_type_value_e aTunnelingType) |
1408 const eap_type_value_e aTunnelingType) |
1186 { |
1409 { |
|
1410 EAP_TRACE_DEBUG_SYMBIAN((_L("CEapTlsPeap::UpdatePacStoreCleanupTableL()\n"))); |
|
1411 EAP_TRACE_RETURN_STRING_SYMBIAN(_L("returns: CEapTlsPeap::UpdatePacStoreCleanupTableL()\n")); |
|
1412 |
1187 EAP_TRACE_DEBUG_SYMBIAN( |
1413 EAP_TRACE_DEBUG_SYMBIAN( |
1188 (_L("CEapTlsPeap::UpdatePacStoreCleanupTableL: Start"))); |
1414 (_L("CEapTlsPeap::UpdatePacStoreCleanupTableL: Start"))); |
1189 |
1415 |
1190 CPacStoreDatabase * pacStoreDb = CPacStoreDatabase::NewL(); |
1416 CPacStoreDatabase * pacStoreDb = CPacStoreDatabase::NewL(); |
1191 User::LeaveIfNull(pacStoreDb); |
1417 User::LeaveIfNull(pacStoreDb); |