1 /* |
1 /* |
2 * Copyright (c) 2001-2006 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2001-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of the License "Eclipse Public License v1.0" |
5 * under the terms of the License "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
9 * Initial Contributors: |
9 * Initial Contributors: |
10 * Nokia Corporation - initial contribution. |
10 * Nokia Corporation - initial contribution. |
11 * |
11 * |
12 * Contributors: |
12 * Contributors: |
13 * |
13 * |
14 * Description: EAP and WLAN authentication protocols. |
14 * Description: Conversion functions between common code and Symbian code. |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 /* |
18 /* |
19 * %version: 41 % |
19 * %version: 50 % |
20 */ |
20 */ |
21 |
21 |
22 // This is enumeration of EAPOL source code. |
22 // This is enumeration of EAPOL source code. |
23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
23 #if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
24 #undef EAP_FILE_NUMBER_ENUM |
24 #undef EAP_FILE_NUMBER_ENUM |
25 #define EAP_FILE_NUMBER_ENUM 605 |
25 #define EAP_FILE_NUMBER_ENUM 738 |
26 #undef EAP_FILE_NUMBER_DATE |
26 #undef EAP_FILE_NUMBER_DATE |
27 #define EAP_FILE_NUMBER_DATE 1127594498 |
27 #define EAP_FILE_NUMBER_DATE 1127594498 |
28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
28 #endif //#if defined(USE_EAP_MINIMUM_RELEASE_TRACES) |
29 |
29 |
30 |
30 |
188 |
188 |
189 // convert utf8 -> unicode, |
189 // convert utf8 -> unicode, |
190 // aInBuf8 is UTF8 string, unicode max length is |
190 // aInBuf8 is UTF8 string, unicode max length is |
191 // then the length of UTF8 string. |
191 // then the length of UTF8 string. |
192 // NOTE, HBufC16 length means count of 16-bit objects. |
192 // NOTE, HBufC16 length means count of 16-bit objects. |
193 HBufC16 * aOutBuf16 = HBufC16::New(inBufPtrC8.Size()); |
193 HBufC16 * outBuf16 = HBufC16::New(inBufPtrC8.Size()); |
194 if (aOutBuf16 == 0) |
194 if (outBuf16 == 0) |
195 { |
195 { |
196 EAP_UNREFERENCED_PARAMETER(tools); |
196 EAP_UNREFERENCED_PARAMETER(tools); |
197 return KErrNoMemory; |
197 return KErrNoMemory; |
198 } |
198 } |
199 |
199 |
200 TPtr16 outBufPtr16 = aOutBuf16->Des(); |
200 TPtr16 outBufPtr16 = outBuf16->Des(); |
201 |
201 |
202 CnvUtfConverter::ConvertToUnicodeFromUtf8(outBufPtr16, inBufPtrC8); |
202 CnvUtfConverter::ConvertToUnicodeFromUtf8(outBufPtr16, inBufPtrC8); |
203 |
203 |
204 target16->Copy(outBufPtr16); |
204 target16->Copy(outBufPtr16); |
205 |
205 |
230 input16->Ptr(), |
230 input16->Ptr(), |
231 input16->Size())); |
231 input16->Size())); |
232 |
232 |
233 EAP_TRACE_RETURN_STRING(tools, "returns: CEapConversion::ConvertFromBuf16ToInternal()"); |
233 EAP_TRACE_RETURN_STRING(tools, "returns: CEapConversion::ConvertFromBuf16ToInternal()"); |
234 |
234 |
|
235 if (tools == 0) |
|
236 { |
|
237 return KErrArgument; |
|
238 } |
|
239 |
235 // "In UTF-8, characters are encoded using sequences of 1 to 6 octets." |
240 // "In UTF-8, characters are encoded using sequences of 1 to 6 octets." |
236 // RFC2279 - UTF-8 |
241 // RFC2279 - UTF-8 |
237 const TUint KMaxNumberOfOctetsPerUtf8Char = 6; |
242 const TUint KMaxNumberOfOctetsPerUtf8Char = 6; |
238 // Convert unicode -> utf8. |
243 // Convert unicode -> utf8. |
239 // Note, HBufC16 length means the number of 16-bit values or |
244 // Note, HBufC16 length means the number of 16-bit values or |
252 eap_status_e status = target8->set_copy_of_buffer(aOutBuf8->Ptr(), aOutBuf8->Length()); |
257 eap_status_e status = target8->set_copy_of_buffer(aOutBuf8->Ptr(), aOutBuf8->Length()); |
253 |
258 |
254 delete aOutBuf8; |
259 delete aOutBuf8; |
255 aOutBuf8 = NULL; |
260 aOutBuf8 = NULL; |
256 |
261 |
257 if (status != eap_status_ok) |
|
258 { |
|
259 return (tools->convert_eapol_error_to_am_error( |
|
260 EAP_STATUS_RETURN(tools, status))); |
|
261 } |
|
262 |
|
263 EAP_TRACE_DATA_DEBUG( |
262 EAP_TRACE_DATA_DEBUG( |
264 tools, |
263 tools, |
265 TRACE_FLAGS_DEFAULT, |
264 TRACE_FLAGS_DEFAULT, |
266 (EAPL("CEapConversion::ConvertFromBuf16ToInternal(): target8"), |
265 (EAPL("CEapConversion::ConvertFromBuf16ToInternal(): target8"), |
267 target8->get_data(), |
266 target8->get_data(), |
268 target8->get_data_length())); |
267 target8->get_data_length())); |
269 |
268 |
270 return KErrNone; |
269 return (tools->convert_eapol_error_to_am_error( |
|
270 EAP_STATUS_RETURN(tools, status))); |
271 } |
271 } |
272 |
272 |
273 // ---------------------------------------------------------- |
273 // ---------------------------------------------------------- |
274 |
274 |
275 EAP_FUNC_EXPORT TInt CEapConversion::ConvertEAPTypesToInternalTypes( |
275 EAP_FUNC_EXPORT TInt CEapConversion::ConvertEAPTypesToInternalTypes( |
284 |
284 |
285 EAP_TRACE_RETURN_STRING(tools, "returns: CEapConversion::ConvertEAPTypesToInternalTypes()"); |
285 EAP_TRACE_RETURN_STRING(tools, "returns: CEapConversion::ConvertEAPTypesToInternalTypes()"); |
286 |
286 |
287 eap_status_e status(eap_status_ok); |
287 eap_status_e status(eap_status_ok); |
288 |
288 |
289 if (EncapsulatedEAPTypes == 0 |
289 if (tools == 0) |
|
290 { |
|
291 return KErrGeneral; |
|
292 } |
|
293 if (EncapsulatedEAPTypes == 0 |
290 || target == 0) |
294 || target == 0) |
291 { |
295 { |
292 return (tools->convert_eapol_error_to_am_error( |
296 return (tools->convert_eapol_error_to_am_error( |
293 EAP_STATUS_RETURN(tools, eap_status_illegal_parameter))); |
297 EAP_STATUS_RETURN(tools, eap_status_illegal_parameter))); |
294 } |
298 } |
396 EAP_TRACE_RETURN_STRING_SYMBIAN((_L("returns: CEapConversion::ConvertInternalTypeToExpandedEAPType()\n"))); |
400 EAP_TRACE_RETURN_STRING_SYMBIAN((_L("returns: CEapConversion::ConvertInternalTypeToExpandedEAPType()\n"))); |
397 |
401 |
398 TInt error = EncapsulatedExpandedEAPType->SetValue( |
402 TInt error = EncapsulatedExpandedEAPType->SetValue( |
399 source->get_vendor_id(), |
403 source->get_vendor_id(), |
400 source->get_vendor_type()); |
404 source->get_vendor_type()); |
401 if (error != KErrNone) |
405 |
402 { |
406 return error; |
403 return error; |
|
404 } |
|
405 |
|
406 return KErrNone; |
|
407 } |
407 } |
408 |
408 |
409 // ---------------------------------------------------------- |
409 // ---------------------------------------------------------- |
410 |
410 |
411 EAP_FUNC_EXPORT TInt CEapConversion::ConvertExpandedEAPTypesToInternalTypes( |
411 EAP_FUNC_EXPORT TInt CEapConversion::ConvertExpandedEAPTypesToInternalTypes( |
545 return (tools->convert_eapol_error_to_am_error( |
545 return (tools->convert_eapol_error_to_am_error( |
546 EAP_STATUS_RETURN(tools, eap_status_illegal_parameter))); |
546 EAP_STATUS_RETURN(tools, eap_status_illegal_parameter))); |
547 } |
547 } |
548 |
548 |
549 *EncapsulatedExpandedEAPTypesData = HBufC8::New(source->get_object_count()*KEapExpandedTypeLength); |
549 *EncapsulatedExpandedEAPTypesData = HBufC8::New(source->get_object_count()*KEapExpandedTypeLength); |
|
550 |
|
551 eap_automatic_variable_c<HBufC8> automatic_EncapsulatedExpandedEAPTypesData( |
|
552 tools, |
|
553 *EncapsulatedExpandedEAPTypesData); |
|
554 |
550 TPtr8 aDbBinaryColumnValuePtr = (*EncapsulatedExpandedEAPTypesData)->Des(); |
555 TPtr8 aDbBinaryColumnValuePtr = (*EncapsulatedExpandedEAPTypesData)->Des(); |
551 |
556 |
552 TEapExpandedType EapType; |
557 TEapExpandedType EapType; |
553 |
558 |
554 for (u32_t ind = 0; ind < source->get_object_count(); ind++) |
559 for (u32_t ind = 0; ind < source->get_object_count(); ind++) |
1061 |
1069 |
1062 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1070 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1063 |
1071 |
1064 if (aSettings->iUsernamePresent) |
1072 if (aSettings->iUsernamePresent) |
1065 { |
1073 { |
|
1074 TInt error = ConvertFromBuf16ToInternal(tools, &(aSettings->iUsername), &(internal_settings->m_Username_fix)); |
|
1075 if (error) |
|
1076 { |
|
1077 return error; |
|
1078 } |
|
1079 |
1066 internal_settings->m_UsernamePresent = true; |
1080 internal_settings->m_UsernamePresent = true; |
1067 |
|
1068 ConvertFromBuf16ToInternal(tools, &(aSettings->iUsername), &(internal_settings->m_Username_fix)); |
|
1069 } |
1081 } |
1070 |
1082 |
1071 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1083 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1072 |
1084 |
1073 if (aSettings->iPasswordExistPresent) |
1085 if (aSettings->iPasswordExistPresent) |
1086 |
1098 |
1087 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1099 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1088 |
1100 |
1089 if (aSettings->iPasswordPresent) |
1101 if (aSettings->iPasswordPresent) |
1090 { |
1102 { |
|
1103 TInt error = ConvertFromBuf16ToInternal(tools, &(aSettings->iPassword), &(internal_settings->m_Password)); |
|
1104 if (error) |
|
1105 { |
|
1106 return error; |
|
1107 } |
|
1108 |
1091 internal_settings->m_PasswordPresent = true; |
1109 internal_settings->m_PasswordPresent = true; |
1092 |
|
1093 ConvertFromBuf16ToInternal(tools, &(aSettings->iPassword), &(internal_settings->m_Password)); |
|
1094 } |
1110 } |
1095 |
1111 |
1096 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1112 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1097 |
1113 |
1098 if (aSettings->iRealmPresent) |
1114 if (aSettings->iRealmPresent) |
1099 { |
1115 { |
|
1116 TInt error = ConvertFromBuf16ToInternal(tools, &(aSettings->iRealm), &(internal_settings->m_Realm)); |
|
1117 if (error) |
|
1118 { |
|
1119 return error; |
|
1120 } |
|
1121 |
1100 internal_settings->m_RealmPresent = true; |
1122 internal_settings->m_RealmPresent = true; |
1101 |
|
1102 ConvertFromBuf16ToInternal(tools, &(aSettings->iRealm), &(internal_settings->m_Realm)); |
|
1103 } |
1123 } |
1104 |
1124 |
1105 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1125 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1106 |
1126 |
1107 if (aSettings->iUsePseudonymsPresent) |
1127 if (aSettings->iUsePseudonymsPresent) |
1161 |
1181 |
1162 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1182 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1163 |
1183 |
1164 if (aSettings->iCipherSuitesPresent) |
1184 if (aSettings->iCipherSuitesPresent) |
1165 { |
1185 { |
1166 ConvertCipherSuitesToInternalType( |
1186 TInt error = ConvertCipherSuitesToInternalType( |
1167 tools, |
1187 tools, |
1168 &(aSettings->iCipherSuites), |
1188 &(aSettings->iCipherSuites), |
1169 &(internal_settings->m_CipherSuites)); |
1189 &(internal_settings->m_CipherSuites)); |
|
1190 if (error) |
|
1191 { |
|
1192 return error; |
|
1193 } |
1170 |
1194 |
1171 internal_settings->m_CipherSuitesPresent = true; |
1195 internal_settings->m_CipherSuitesPresent = true; |
1172 } |
1196 } |
1173 |
1197 |
1174 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1198 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1207 |
1231 |
1208 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1232 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1209 |
1233 |
1210 if (aSettings->iCertificatesPresent) |
1234 if (aSettings->iCertificatesPresent) |
1211 { |
1235 { |
1212 ConvertCertificatesToInternalType( |
1236 TInt error = ConvertCertificatesToInternalType( |
1213 tools, |
1237 tools, |
1214 &(aSettings->iCertificates), |
1238 &(aSettings->iCertificates), |
1215 &(internal_settings->m_Certificates)); |
1239 &(internal_settings->m_Certificates)); |
|
1240 if (error) |
|
1241 { |
|
1242 return error; |
|
1243 } |
1216 |
1244 |
1217 internal_settings->m_CertificatesPresent = true; |
1245 internal_settings->m_CertificatesPresent = true; |
1218 } |
1246 } |
1219 |
1247 |
1220 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1248 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1221 |
1249 |
1222 if (aSettings->iEnabledEncapsulatedEAPExpandedTypesPresent) |
1250 if (aSettings->iEnabledEncapsulatedEAPExpandedTypesPresent) |
1223 { |
1251 { |
1224 ConvertExpandedEAPTypesToInternalTypes( |
1252 TInt error = ConvertExpandedEAPTypesToInternalTypes( |
1225 tools, |
1253 tools, |
1226 &(aSettings->iEnabledEncapsulatedEAPExpandedTypes), |
1254 &(aSettings->iEnabledEncapsulatedEAPExpandedTypes), |
1227 &(internal_settings->m_EnabledEncapsulatedEAPTypes)); |
1255 &(internal_settings->m_EnabledEncapsulatedEAPTypes)); |
|
1256 if (error) |
|
1257 { |
|
1258 return error; |
|
1259 } |
1228 |
1260 |
1229 internal_settings->m_EnabledEncapsulatedEAPTypesPresent = true; |
1261 internal_settings->m_EnabledEncapsulatedEAPTypesPresent = true; |
1230 } |
1262 } |
1231 |
1263 |
1232 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1264 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1233 |
1265 |
1234 if (aSettings->iDisabledEncapsulatedEAPExpandedTypesPresent) |
1266 if (aSettings->iDisabledEncapsulatedEAPExpandedTypesPresent) |
1235 { |
1267 { |
1236 ConvertExpandedEAPTypesToInternalTypes( |
1268 TInt error = ConvertExpandedEAPTypesToInternalTypes( |
1237 tools, |
1269 tools, |
1238 &(aSettings->iDisabledEncapsulatedEAPExpandedTypes), |
1270 &(aSettings->iDisabledEncapsulatedEAPExpandedTypes), |
1239 &(internal_settings->m_DisabledEncapsulatedEAPTypes)); |
1271 &(internal_settings->m_DisabledEncapsulatedEAPTypes)); |
|
1272 if (error) |
|
1273 { |
|
1274 return error; |
|
1275 } |
1240 |
1276 |
1241 internal_settings->m_DisabledEncapsulatedEAPTypesPresent = true; |
1277 internal_settings->m_DisabledEncapsulatedEAPTypesPresent = true; |
1242 } |
1278 } |
1243 |
1279 |
1244 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1280 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1275 |
1311 |
1276 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1312 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1277 |
1313 |
1278 if (aSettings->iPACGroupReferencePresent) |
1314 if (aSettings->iPACGroupReferencePresent) |
1279 { |
1315 { |
|
1316 TInt error = ConvertFromBuf16ToInternal(tools, &(aSettings->iPACGroupReference), &(internal_settings->m_PACGroupReference)); |
|
1317 if (error) |
|
1318 { |
|
1319 return error; |
|
1320 } |
|
1321 |
1280 internal_settings->m_RealmPresent = true; |
1322 internal_settings->m_RealmPresent = true; |
1281 |
|
1282 ConvertFromBuf16ToInternal(tools, &(aSettings->iPACGroupReference), &(internal_settings->m_PACGroupReference)); |
|
1283 } |
1323 } |
1284 |
1324 |
1285 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1325 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1286 |
1326 |
1287 if (aSettings->iWarnADHPNoPACPresent) |
1327 if (aSettings->iWarnADHPNoPACPresent) |
1461 |
1501 |
1462 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1502 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1463 |
1503 |
1464 if (internal_settings->m_UsernamePresent == true) |
1504 if (internal_settings->m_UsernamePresent == true) |
1465 { |
1505 { |
|
1506 TInt error = ConvertFromInternalToBuf16(tools, &(internal_settings->m_Username_fix), &(aSettings->iUsername)); |
|
1507 if (error) |
|
1508 { |
|
1509 return error; |
|
1510 } |
|
1511 |
1466 aSettings->iUsernamePresent = ETrue; |
1512 aSettings->iUsernamePresent = ETrue; |
1467 |
|
1468 ConvertFromInternalToBuf16(tools, &(internal_settings->m_Username_fix), &(aSettings->iUsername)); |
|
1469 } |
1513 } |
1470 |
1514 |
1471 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1515 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1472 |
1516 |
1473 if (internal_settings->m_PasswordExistPresent == true) |
1517 if (internal_settings->m_PasswordExistPresent == true) |
1486 |
1530 |
1487 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1531 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1488 |
1532 |
1489 if (internal_settings->m_PasswordPresent == true) |
1533 if (internal_settings->m_PasswordPresent == true) |
1490 { |
1534 { |
|
1535 TInt error = ConvertFromInternalToBuf16(tools, &(internal_settings->m_Password), &(aSettings->iPassword)); |
|
1536 if (error) |
|
1537 { |
|
1538 return error; |
|
1539 } |
|
1540 |
1491 aSettings->iPasswordPresent = ETrue; |
1541 aSettings->iPasswordPresent = ETrue; |
1492 |
|
1493 ConvertFromInternalToBuf16(tools, &(internal_settings->m_Password), &(aSettings->iPassword)); |
|
1494 } |
1542 } |
1495 |
1543 |
1496 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1544 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1497 |
1545 |
1498 if (internal_settings->m_RealmPresent == true) |
1546 if (internal_settings->m_RealmPresent == true) |
1499 { |
1547 { |
|
1548 TInt error = ConvertFromInternalToBuf16(tools, &(internal_settings->m_Realm), &(aSettings->iRealm)); |
|
1549 if (error) |
|
1550 { |
|
1551 return error; |
|
1552 } |
|
1553 |
1500 aSettings->iRealmPresent = ETrue; |
1554 aSettings->iRealmPresent = ETrue; |
1501 |
|
1502 ConvertFromInternalToBuf16(tools, &(internal_settings->m_Realm), &(aSettings->iRealm)); |
|
1503 } |
1555 } |
1504 |
1556 |
1505 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1557 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1506 |
1558 |
1507 if (internal_settings->m_UsePseudonymsPresent == true) |
1559 if (internal_settings->m_UsePseudonymsPresent == true) |
1561 |
1613 |
1562 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1614 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1563 |
1615 |
1564 if (internal_settings->m_CipherSuitesPresent == true) |
1616 if (internal_settings->m_CipherSuitesPresent == true) |
1565 { |
1617 { |
1566 ConvertInternalTypeToCipherSuites( |
1618 TInt error = ConvertInternalTypeToCipherSuites( |
1567 tools, |
1619 tools, |
1568 &(internal_settings->m_CipherSuites), |
1620 &(internal_settings->m_CipherSuites), |
1569 &(aSettings->iCipherSuites)); |
1621 &(aSettings->iCipherSuites)); |
|
1622 if (error) |
|
1623 { |
|
1624 return error; |
|
1625 } |
1570 |
1626 |
1571 aSettings->iCipherSuitesPresent = ETrue; |
1627 aSettings->iCipherSuitesPresent = ETrue; |
1572 } |
1628 } |
1573 |
1629 |
1574 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1630 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1607 |
1663 |
1608 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1664 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1609 |
1665 |
1610 if (internal_settings->m_CertificatesPresent == true) |
1666 if (internal_settings->m_CertificatesPresent == true) |
1611 { |
1667 { |
1612 ConvertInternalTypeToCertificates( |
1668 TInt error = KErrNone; |
|
1669 |
|
1670 error = ConvertInternalTypeToCertificates( |
1613 tools, |
1671 tools, |
1614 eap_certificate_entry_c::eap_certificate_type_user, |
1672 eap_certificate_entry_c::eap_certificate_type_user, |
1615 &(internal_settings->m_Certificates), |
1673 &(internal_settings->m_Certificates), |
1616 &(aSettings->iCertificates)); |
1674 &(aSettings->iCertificates)); |
1617 |
1675 |
1618 ConvertInternalTypeToCertificates( |
1676 if (error) |
|
1677 { |
|
1678 return error; |
|
1679 } |
|
1680 |
|
1681 error = ConvertInternalTypeToCertificates( |
1619 tools, |
1682 tools, |
1620 eap_certificate_entry_c::eap_certificate_type_CA, |
1683 eap_certificate_entry_c::eap_certificate_type_CA, |
1621 &(internal_settings->m_Certificates), |
1684 &(internal_settings->m_Certificates), |
1622 &(aSettings->iCertificates)); |
1685 &(aSettings->iCertificates)); |
1623 |
1686 |
|
1687 if (error) |
|
1688 { |
|
1689 return error; |
|
1690 } |
|
1691 |
1624 aSettings->iCertificatesPresent = ETrue; |
1692 aSettings->iCertificatesPresent = ETrue; |
1625 } |
1693 } |
1626 |
1694 |
1627 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1695 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1628 |
1696 |
1629 if (internal_settings->m_EnabledEncapsulatedEAPTypesPresent == true) |
1697 if (internal_settings->m_EnabledEncapsulatedEAPTypesPresent == true) |
1630 { |
1698 { |
1631 ConvertInternalTypesToExpandedEAPTypes( |
1699 TInt error = ConvertInternalTypesToExpandedEAPTypes( |
1632 tools, |
1700 tools, |
1633 &(internal_settings->m_EnabledEncapsulatedEAPTypes), |
1701 &(internal_settings->m_EnabledEncapsulatedEAPTypes), |
1634 &(aSettings->iEnabledEncapsulatedEAPExpandedTypes)); |
1702 &(aSettings->iEnabledEncapsulatedEAPExpandedTypes)); |
|
1703 if (error) |
|
1704 { |
|
1705 return error; |
|
1706 } |
1635 |
1707 |
1636 aSettings->iEnabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
1708 aSettings->iEnabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
1637 } |
1709 } |
1638 |
1710 |
1639 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1711 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1640 |
1712 |
1641 if (internal_settings->m_DisabledEncapsulatedEAPTypesPresent == true) |
1713 if (internal_settings->m_DisabledEncapsulatedEAPTypesPresent == true) |
1642 { |
1714 { |
1643 ConvertInternalTypesToExpandedEAPTypes( |
1715 TInt error = ConvertInternalTypesToExpandedEAPTypes( |
1644 tools, |
1716 tools, |
1645 &(internal_settings->m_DisabledEncapsulatedEAPTypes), |
1717 &(internal_settings->m_DisabledEncapsulatedEAPTypes), |
1646 &(aSettings->iDisabledEncapsulatedEAPExpandedTypes)); |
1718 &(aSettings->iDisabledEncapsulatedEAPExpandedTypes)); |
|
1719 if (error) |
|
1720 { |
|
1721 return error; |
|
1722 } |
1647 |
1723 |
1648 aSettings->iDisabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
1724 aSettings->iDisabledEncapsulatedEAPExpandedTypesPresent = ETrue; |
1649 } |
1725 } |
1650 |
1726 |
1651 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1727 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1682 |
1758 |
1683 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1759 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1684 |
1760 |
1685 if (internal_settings->m_PACGroupReferencePresent == true) |
1761 if (internal_settings->m_PACGroupReferencePresent == true) |
1686 { |
1762 { |
|
1763 TInt error = ConvertFromInternalToBuf16(tools, &(internal_settings->m_PACGroupReference), &(aSettings->iPACGroupReference)); |
|
1764 if (error) |
|
1765 { |
|
1766 return error; |
|
1767 } |
|
1768 |
1687 aSettings->iPACGroupReferencePresent = ETrue; |
1769 aSettings->iPACGroupReferencePresent = ETrue; |
1688 |
|
1689 ConvertFromInternalToBuf16(tools, &(internal_settings->m_PACGroupReference), &(aSettings->iPACGroupReference)); |
|
1690 } |
1770 } |
1691 |
1771 |
1692 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1772 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |
1693 |
1773 |
1694 if (internal_settings->m_WarnADHPNoPACPresent == true) |
1774 if (internal_settings->m_WarnADHPNoPACPresent == true) |