1265 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_eap_type); |
1321 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_eap_type); |
1266 } |
1322 } |
1267 |
1323 |
1268 EAP_ASSERT_TOOLS(m_am_tools, (type == iRequestedEapType)); |
1324 EAP_ASSERT_TOOLS(m_am_tools, (type == iRequestedEapType)); |
1269 |
1325 |
1270 TEapExpandedType aEapType; |
1326 #ifdef USE_EAP_EXPANDED_TYPES |
1271 |
1327 |
1272 TInt error = CEapConversion::ConvertInternalTypeToExpandedEAPType( |
1328 TBuf8<KExpandedEapTypeSize> cue; |
1273 &iRequestedEapType, |
1329 |
1274 &aEapType); |
1330 // Some indirect way of forming the 8 byte string of an EAP type for the cue is needed here. |
1275 if (error != KErrNone) |
1331 TUint8 tmpExpCue[KExpandedEapTypeSize]; |
1276 { |
1332 |
1277 EAP_TRACE_DEBUG_SYMBIAN( |
1333 // This is to make the tmpExpCue in 8 byte string with correct vendor type and vendor id details. |
1278 (_L("ERROR: CEapVpnInterfaceImplementation::load_module(): Error from CEapConversion::ConvertExpandedEAPTypeToInternalType()=%d\n"), |
1334 status = eap_expanded_type_c::write_type(m_am_tools, |
1279 error)); |
1335 0, // index should be zero here. |
1280 |
1336 tmpExpCue, |
1281 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1337 KExpandedEapTypeSize, |
1282 return EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(error)); |
1338 true, |
1283 } |
1339 iRequestedEapType); |
1284 |
1340 if (status != eap_status_ok) |
1285 i32_t eapArrayIndex = -1; |
1341 { |
1286 |
|
1287 { |
|
1288 CEapType* eapType = 0; |
|
1289 |
|
1290 // Check if this EAP type has already been loaded |
|
1291 eapArrayIndex = find<eap_type_value_e>( |
|
1292 m_eap_type_array, |
|
1293 &iRequestedEapType, |
|
1294 m_am_tools); |
|
1295 |
|
1296 if (eapArrayIndex >= 0) |
|
1297 { |
|
1298 // Yep. It was loaded already. |
|
1299 EAP_TRACE_DEBUG( |
1342 EAP_TRACE_DEBUG( |
1300 m_am_tools, |
1343 m_am_tools, |
1301 TRACE_FLAGS_DEFAULT, |
1344 TRACE_FLAGS_DEFAULT, |
1302 (EAPL("CEapVpnInterfaceImplementation: EAP Type Already loaded\n"))); |
1345 (EAPL("load_module: eap_expanded_type_c::write_type failed \n"))); |
1303 |
|
1304 eapType = m_eap_if_array[eapArrayIndex]; |
|
1305 } |
|
1306 else |
|
1307 { |
|
1308 // We must have a trap here since the EAP core knows nothing about Symbian. |
|
1309 EAP_TRACE_DEBUG( |
|
1310 m_am_tools, |
|
1311 TRACE_FLAGS_DEFAULT, |
|
1312 (EAPL("CEapVpnInterfaceImplementation: EAP Type new\n"))); |
|
1313 |
|
1314 TRAP(error, (eapType = CEapType::NewL(m_index_type, m_index, aEapType))); |
|
1315 |
|
1316 if (error != KErrNone |
|
1317 || eapType == 0) |
|
1318 { |
|
1319 // Interface not found or implementation creation function failed |
|
1320 |
|
1321 delete eapType; |
|
1322 eapType = 0; |
|
1323 |
|
1324 EAP_TRACE_DEBUG( |
|
1325 m_am_tools, |
|
1326 TRACE_FLAGS_DEFAULT, |
|
1327 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, unable to load\n"))); |
|
1328 EAP_TRACE_ALWAYS( |
|
1329 m_am_tools, |
|
1330 TRACE_FLAGS_DEFAULT, |
|
1331 (EAPL("ECom could not find/initiate implementation.\n"))); |
|
1332 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1333 } |
|
1334 |
|
1335 // Add EAP-interface information to the member arrays. |
|
1336 if (m_eap_if_array.Append(eapType) != KErrNone) |
|
1337 { |
|
1338 delete eapType; |
|
1339 status = eap_status_allocation_error; |
|
1340 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1341 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1342 } |
|
1343 } |
|
1344 |
|
1345 //-------------------------------------------------------- |
|
1346 //-------------------------------------------------------- |
|
1347 // Set the values for realm and user name if there is any. |
|
1348 // If there is no values the default settings will be used( automatic realm and username). |
|
1349 |
|
1350 |
|
1351 { |
|
1352 EAP_TRACE_DEBUG( |
|
1353 m_am_tools, |
|
1354 TRACE_FLAGS_DEFAULT, |
|
1355 (EAPL("CEapVpnInterfaceImplementation::load_module - About to configure manual/auto username and manual/auto realm \n"))); |
|
1356 |
1346 |
1357 EAPSettings* setSettings = new EAPSettings; |
1347 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1358 if( setSettings == NULL ) |
1348 return EAP_STATUS_RETURN(m_am_tools, status); |
1359 { |
1349 } |
1360 EAP_TRACE_DEBUG( |
1350 |
1361 m_am_tools, |
1351 // Now copy the 8 byte string to the real expanded cue. |
1362 TRACE_FLAGS_DEFAULT, |
1352 cue.Copy(tmpExpCue, KExpandedEapTypeSize); |
1363 (EAPL("CEapVpnInterfaceImplementation::load_module - EAPSettings allocation error \n"))); |
1353 |
1364 |
1354 EAP_TRACE_DATA_DEBUG( |
1365 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1355 m_am_tools, |
1366 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
1356 TRACE_FLAGS_DEFAULT, |
1367 } |
1357 (EAPL("EAPOL:CEapVpnInterfaceImplementation::load_module: Expanded CUE:"), |
1368 |
1358 cue.Ptr(), |
1369 if(iRequestedEapType == eap_type_aka) |
1359 cue.Size())); |
1370 { |
1360 |
1371 setSettings->iEAPExpandedType = *EapExpandedTypeAka.GetType(); |
1361 #else |
1372 |
1362 |
1373 } |
1363 TBuf8<KMaxEapCueLength> cue; |
1374 else if(iRequestedEapType == eap_type_gsmsim) |
1364 cue.Num(static_cast<TInt>(iRequestedEapType)); |
1375 { |
1365 |
1376 setSettings->iEAPExpandedType = *EapExpandedTypeSim.GetType(); |
1366 #endif //#ifdef USE_EAP_EXPANDED_TYPES |
1377 } |
1367 |
1378 else |
1368 CEapType* eapType = 0; |
1379 { |
1369 TInt error(KErrNone); |
1380 delete setSettings; |
1370 |
1381 setSettings = 0; |
1371 #ifdef USE_EAP_EXPANDED_TYPES |
1382 |
1372 |
1383 // Only EAP-SIM and AKA are possible now. |
1373 // Check if this EAP type has already been loaded |
1384 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1374 TInt eapArrayIndex = find<eap_type_value_e>( |
1385 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_eap_type); |
1375 m_eap_type_array, |
1386 } |
1376 &iRequestedEapType, |
1387 |
1377 m_am_tools); |
1388 if(iManualUsername && iManualUsername->Length() != 0) |
1378 |
1389 { |
1379 if (eapArrayIndex >= 0) |
1390 setSettings->iUsernamePresent = ETrue; // Same value for both SIM and AKA. |
1380 |
1391 setSettings->iUsername.Copy(iManualUsername->Des()); |
1381 #else // For normal EAP type. |
1392 } |
1382 |
1393 else |
1383 // Check if this EAP type has already been loaded |
1394 { |
1384 TInt eapArrayIndex = m_eap_type_array.Find(iRequestedEapType); |
1395 // No user name. we have to set automatic now. |
1385 |
1396 setSettings->iUsernamePresent = EFalse; // Same value for both SIM and AKA. |
1386 if (eapArrayIndex != KErrNotFound) |
1397 setSettings->iUseAutomaticUsernamePresent = ETrue; // Same value for both SIM and AKA. |
1387 |
1398 setSettings->iUseAutomaticUsername = ETrue; // Same value for both SIM and AKA. |
1388 #endif |
1399 } |
1389 |
1400 |
1390 { |
1401 if(iManualRealm && iManualRealm->Length() != 0) |
1391 // Yep. It was loaded already. |
1402 { |
1392 EAP_TRACE_DEBUG( |
1403 setSettings->iRealmPresent = ETrue; // Same value for both SIM and AKA. |
1393 m_am_tools, |
1404 setSettings->iRealm.Copy(iManualRealm->Des()); |
1394 TRACE_FLAGS_DEFAULT, |
1405 } |
1395 (EAPL("CEapVpnInterfaceImplementation: EAP Type Already loaded\n"))); |
1406 else |
1396 |
1407 { |
1397 eapType = m_plugin_if_array[eapArrayIndex]; |
1408 // No realm. we have to set automatic now. |
1398 } |
1409 setSettings->iRealmPresent = EFalse; // Same value for both SIM and AKA. |
1399 else |
1410 setSettings->iUseAutomaticRealmPresent = ETrue; // Same value for both SIM and AKA. |
1400 { |
1411 setSettings->iUseAutomaticRealm = ETrue; // Same value for both SIM and AKA. |
1401 // We must have a trap here since the EAP core knows nothing about Symbian. |
1412 } |
1402 EAP_TRACE_DEBUG( |
1413 |
1403 m_am_tools, |
1414 TRAP(error, eapType->SetConfigurationL(*setSettings) ); |
1404 TRACE_FLAGS_DEFAULT, |
1415 if ( error != KErrNone ) |
1405 (EAPL("CEapVpnInterfaceImplementation: EAP Type new\n"))); |
1416 { |
1406 |
1417 EAP_TRACE_DEBUG( |
1407 TRAP(error, (eapType = CEapType::NewL(cue, m_index_type, m_index))); |
1418 m_am_tools, |
|
1419 TRACE_FLAGS_DEFAULT, |
|
1420 (EAPL("CEapVpnInterfaceImplementation::load_module - Setting Manual Username and Realm failed.error=%d, Continuing \n"))); |
|
1421 } |
|
1422 |
|
1423 delete setSettings; |
|
1424 setSettings = 0; |
|
1425 } |
|
1426 } |
|
1427 |
|
1428 //-------------------------------------------------------- |
|
1429 //-------------------------------------------------------- |
|
1430 |
|
1431 // Create the EAP protocol interface implementation. |
|
1432 EAP_TRACE_DEBUG( |
|
1433 m_am_tools, |
|
1434 TRACE_FLAGS_DEFAULT, |
|
1435 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL()\n"))); |
|
1436 |
|
1437 |
|
1438 { |
|
1439 CEapTypePlugin* eapPlugin = 0; |
|
1440 |
|
1441 TRAP(error, (eapPlugin = CEapTypePlugin::NewL(aEapType.GetValue(), m_index_type, m_index))); |
|
1442 |
1408 |
1443 if (error != KErrNone |
1409 if (error != KErrNone |
1444 || eapPlugin == 0) |
1410 || eapType == 0) |
1445 { |
1411 { |
1446 // Interface not found or implementation creation function failed |
1412 // Interface not found or implementation creation function failed |
1447 |
1413 |
1448 delete eapPlugin; |
1414 delete eapType; |
1449 eapPlugin = 0; |
1415 eapType = 0; |
1450 |
1416 |
1451 EAP_TRACE_DEBUG( |
1417 EAP_TRACE_DEBUG( |
1452 m_am_tools, |
1418 m_am_tools, |
1453 TRACE_FLAGS_DEFAULT, |
1419 TRACE_FLAGS_DEFAULT, |
1454 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, unable to load\n"))); |
1420 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, unable to load\n"))); |
1456 m_am_tools, |
1422 m_am_tools, |
1457 TRACE_FLAGS_DEFAULT, |
1423 TRACE_FLAGS_DEFAULT, |
1458 (EAPL("ECom could not find/initiate implementation.\n"))); |
1424 (EAPL("ECom could not find/initiate implementation.\n"))); |
1459 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
1425 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
1460 } |
1426 } |
1461 |
1427 } |
1462 #ifdef USE_EAP_SIMPLE_CONFIG |
1428 |
1463 |
1429 //-------------------------------------------------------- |
1464 TRAP(error, (*eap_type_if = eapPlugin->GetStackInterfaceL( |
1430 //-------------------------------------------------------- |
1465 m_am_tools, |
1431 // Set the values for realm and user name if there is any. |
1466 partner, |
1432 // If there is no values the default settings will be used( automatic realm and username). |
1467 is_client_when_true, |
1433 |
1468 receive_network_id, |
1434 |
1469 0))); // Check this up. |
1435 { |
1470 |
1436 EAP_TRACE_DEBUG( |
1471 #else |
1437 m_am_tools, |
1472 |
1438 TRACE_FLAGS_DEFAULT, |
1473 TRAP(error, (*eap_type_if = eapPlugin->GetStackInterfaceL( |
1439 (EAPL("CEapVpnInterfaceImplementation::load_module - About to configure manual/auto username and manual/auto realm \n"))); |
1474 m_am_tools, |
1440 |
1475 partner, |
1441 EAPSettings* setSettings = new EAPSettings; |
1476 is_client_when_true, |
1442 if( setSettings == NULL ) |
1477 receive_network_id))); |
|
1478 |
|
1479 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
|
1480 |
|
1481 if (error != KErrNone |
|
1482 || *eap_type_if == 0 |
|
1483 || (*eap_type_if)->get_is_valid() == false) |
|
1484 { |
1443 { |
1485 EAP_TRACE_DEBUG( |
1444 EAP_TRACE_DEBUG( |
1486 m_am_tools, |
1445 m_am_tools, |
1487 TRACE_FLAGS_DEFAULT, |
1446 TRACE_FLAGS_DEFAULT, |
1488 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL(), failed = %d\n"), error)); |
1447 (EAPL("CEapVpnInterfaceImplementation::load_module - EAPSettings allocation error \n"))); |
1489 |
1448 |
1490 EAP_TRACE_ALWAYS( |
1449 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1491 m_am_tools, |
1450 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
1492 TRACE_FLAGS_DEFAULT, |
1451 } |
1493 (EAPL("Could not create EAP type interface instance. Error: %d\n"), error)); |
1452 |
1494 |
1453 if(iRequestedEapType == eap_type_aka) |
1495 status = eap_status_allocation_error; |
1454 { |
1496 |
1455 setSettings->iEAPType = EAPSettings::EEapAka; |
1497 // Unload DLL (two ways, depending whether this type was already loaded...) |
1456 |
1498 if (eapArrayIndex < 0) |
1457 } |
1499 { |
1458 else if(iRequestedEapType == eap_type_gsmsim) |
1500 // No need to call shutdown here because GetStackInterfaceL has done it. |
1459 { |
1501 delete m_eap_if_array[m_eap_if_array.Count() - 1]; |
1460 setSettings->iEAPType = EAPSettings::EEapSim; |
1502 m_eap_if_array.Remove(m_eap_if_array.Count() - 1); |
|
1503 |
|
1504 delete eapPlugin; |
|
1505 } |
|
1506 else |
|
1507 { |
|
1508 unload_module((eap_type_value_e)iRequestedEapType); |
|
1509 } |
|
1510 // Note: even in error cases eap_core_c deletes eap_type_if |
|
1511 } |
1461 } |
1512 else |
1462 else |
1513 { |
1463 { |
|
1464 delete setSettings; |
|
1465 setSettings = 0; |
|
1466 |
|
1467 // Only EAP-SIM and AKA are possible now. |
|
1468 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1469 return EAP_STATUS_RETURN(m_am_tools, eap_status_illegal_eap_type); |
|
1470 } |
|
1471 |
|
1472 if(iManualUsername && iManualUsername->Length() != 0) |
|
1473 { |
|
1474 setSettings->iUsernamePresent = EGSMSIMUseManualUsernameYes; // Same value for both SIM and AKA. |
|
1475 setSettings->iUsername.Copy(iManualUsername->Des()); |
|
1476 } |
|
1477 else |
|
1478 { |
|
1479 // No user name. we have to set automatic now. |
|
1480 setSettings->iUsernamePresent = EGSMSIMUseManualUsernameNo; // Same value for both SIM and AKA. |
|
1481 } |
|
1482 |
|
1483 if(iManualRealm && iManualRealm->Length() != 0) |
|
1484 { |
|
1485 setSettings->iRealmPresent = EGSMSIMUseManualRealmYes; // Same value for both SIM and AKA. |
|
1486 setSettings->iRealm.Copy(iManualRealm->Des()); |
|
1487 } |
|
1488 else |
|
1489 { |
|
1490 // No realm. we have to set automatic now. |
|
1491 setSettings->iRealmPresent = EGSMSIMUseManualRealmNo; // Same value for both SIM and AKA. |
|
1492 } |
|
1493 |
|
1494 TRAP(error, eapType->SetConfigurationL(*setSettings) ); |
|
1495 if ( error != KErrNone ) |
|
1496 { |
1514 EAP_TRACE_DEBUG( |
1497 EAP_TRACE_DEBUG( |
1515 m_am_tools, |
1498 m_am_tools, |
1516 TRACE_FLAGS_DEFAULT, |
1499 TRACE_FLAGS_DEFAULT, |
1517 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL(), success\n"))); |
1500 (EAPL("CEapVpnInterfaceImplementation::load_module - Setting Manual Username and Realm failed.error=%d, Continuing \n"))); |
1518 |
1501 } |
1519 status = eap_status_ok; |
1502 |
1520 |
1503 delete setSettings; |
1521 if (eapArrayIndex < 0) |
1504 setSettings = 0; |
1522 { |
1505 } |
1523 // Add plugin information to the member arrays. There is no need to store eap_type pointer because |
1506 |
1524 // the stack takes care of its deletion. |
1507 //-------------------------------------------------------- |
1525 if (m_eap_plugin_if_array.Append(eapPlugin) != KErrNone) |
1508 //-------------------------------------------------------- |
1526 { |
1509 |
1527 delete m_eap_if_array[m_eap_if_array.Count() - 1]; |
1510 // Create the EAP protocol interface implementation. |
1528 m_eap_if_array.Remove(m_eap_if_array.Count() - 1); |
1511 EAP_TRACE_DEBUG( |
1529 |
1512 m_am_tools, |
1530 delete eapPlugin; |
1513 TRACE_FLAGS_DEFAULT, |
1531 status = eap_status_allocation_error; |
1514 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL()\n"))); |
1532 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1515 |
1533 return EAP_STATUS_RETURN(m_am_tools, status); |
1516 #ifdef USE_EAP_SIMPLE_CONFIG |
1534 } |
1517 |
1535 |
1518 TRAP(error, (*eap_type_if = eapType->GetStackInterfaceL( |
1536 eap_type_value_e * tmpEAPType = new eap_type_value_e(); |
1519 m_am_tools, |
1537 if(tmpEAPType == NULL) |
1520 partner, |
1538 { |
1521 is_client_when_true, |
1539 EAP_TRACE_DEBUG( |
1522 receive_network_id, |
1540 m_am_tools, |
1523 0))); // Check this up. |
1541 TRACE_FLAGS_DEFAULT, |
1524 |
1542 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module() eap_type_value_e creation failed\n"))); |
1525 #else |
1543 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1526 |
1544 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
1527 TRAP(error, (*eap_type_if = eapType->GetStackInterfaceL( |
1545 } |
1528 m_am_tools, |
1546 |
1529 partner, |
1547 *tmpEAPType = type; |
1530 is_client_when_true, |
1548 |
1531 receive_network_id))); |
1549 status = m_eap_type_array->add_object(tmpEAPType, true); |
1532 |
1550 |
1533 #endif // #ifdef USE_EAP_SIMPLE_CONFIG |
1551 if (status != eap_status_ok) |
1534 |
1552 { |
1535 if (error != KErrNone |
1553 delete m_eap_if_array[m_eap_if_array.Count() - 1]; |
1536 || *eap_type_if == 0 |
1554 m_eap_if_array.Remove(m_eap_if_array.Count() - 1); |
1537 || (*eap_type_if)->get_is_valid() == false) |
1555 |
1538 { |
1556 // Remove the eap type added just previously |
1539 EAP_TRACE_DEBUG( |
1557 m_eap_plugin_if_array.Remove(m_eap_plugin_if_array.Count() - 1); |
1540 m_am_tools, |
1558 delete eapPlugin; |
1541 TRACE_FLAGS_DEFAULT, |
1559 |
1542 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL(), failed = %d\n"), error)); |
1560 status = eap_status_allocation_error; |
1543 |
1561 |
1544 EAP_TRACE_ALWAYS( |
1562 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1545 m_am_tools, |
1563 return EAP_STATUS_RETURN(m_am_tools, status); |
1546 TRACE_FLAGS_DEFAULT, |
1564 } |
1547 (EAPL("Could not create EAP type interface instance. Error: %d\n"), error)); |
1565 } |
1548 |
1566 } |
1549 status = eap_status_allocation_error; |
|
1550 |
|
1551 // Unload DLL (two ways, depending whether this type was already loaded...) |
|
1552 if (eapArrayIndex == KErrNotFound) |
|
1553 { |
|
1554 // No need to call shutdown here because GetStackInterfaceL has done it. |
|
1555 delete eapType; |
|
1556 } |
|
1557 else |
|
1558 { |
|
1559 unload_module((eap_type_value_e)iRequestedEapType); |
|
1560 } |
|
1561 // Note: even in error cases eap_core_c deletes eap_type_if |
|
1562 } |
|
1563 else |
|
1564 { |
|
1565 EAP_TRACE_DEBUG( |
|
1566 m_am_tools, |
|
1567 TRACE_FLAGS_DEFAULT, |
|
1568 (EAPL("CEapVpnInterfaceImplementation: EAP Type new, GetStackInterfaceL(), success\n"))); |
|
1569 |
|
1570 status = eap_status_ok; |
|
1571 |
|
1572 if (eapArrayIndex == KErrNotFound) |
|
1573 { |
|
1574 // Add plugin information to the member arrays. There is no need to store eap_type pointer because |
|
1575 // the stack takes care of its deletion. |
|
1576 if (m_plugin_if_array.Append(eapType) != KErrNone) |
|
1577 { |
|
1578 delete eapType; |
|
1579 status = eap_status_allocation_error; |
|
1580 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1581 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1582 } |
|
1583 |
|
1584 #ifdef USE_EAP_EXPANDED_TYPES |
|
1585 |
|
1586 eap_type_value_e * tmpEAPType = new eap_type_value_e(); |
|
1587 if(tmpEAPType == NULL) |
|
1588 { |
|
1589 EAP_TRACE_DEBUG( |
|
1590 m_am_tools, |
|
1591 TRACE_FLAGS_DEFAULT, |
|
1592 (EAPL("eapol_am_wlan_authentication_symbian_c::load_module() eap_type_value_e creation failed\n"))); |
|
1593 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1594 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1595 } |
|
1596 |
|
1597 *tmpEAPType = type; |
|
1598 |
|
1599 status = m_eap_type_array->add_object(tmpEAPType, true); |
|
1600 |
|
1601 if (status != eap_status_ok) |
|
1602 |
|
1603 #else // For normal EAP type. |
|
1604 |
|
1605 if (m_eap_type_array.Append(iRequestedEapType) != KErrNone) |
|
1606 |
|
1607 #endif |
|
1608 { |
|
1609 // Remove the eap type added just previously |
|
1610 m_plugin_if_array.Remove(m_plugin_if_array.Count() - 1); |
|
1611 delete eapType; |
|
1612 status = eap_status_allocation_error; |
|
1613 |
|
1614 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1615 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1616 } |
|
1617 } |
1567 } |
1618 } |
1568 |
1619 |
1569 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1620 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1570 return EAP_STATUS_RETURN(m_am_tools, status); |
1621 return EAP_STATUS_RETURN(m_am_tools, status); |
1571 } |
1622 } |
1692 |
1756 |
1693 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1757 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
1694 return EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(status)); |
1758 return EAP_STATUS_RETURN(m_am_tools, m_am_tools->convert_am_error_to_eapol_error(status)); |
1695 } |
1759 } |
1696 |
1760 |
1697 |
|
1698 eap_status_e CEapVpnInterfaceImplementation::add_configuration_data( |
|
1699 eap_process_tlv_message_data_c * const message, |
|
1700 const eap_configuration_field_c * field, |
|
1701 const eap_configure_type_e /* type */, |
|
1702 const eap_variable_data_c * const value_data |
|
1703 ) |
|
1704 { |
|
1705 eap_variable_data_c selector(m_am_tools); |
|
1706 |
|
1707 eap_status_e status = selector.set_buffer( |
|
1708 field->get_field(), |
|
1709 field->get_field_length(), |
|
1710 false, |
|
1711 false); |
|
1712 if (status != eap_status_ok) |
|
1713 { |
|
1714 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1715 return status; |
|
1716 } |
|
1717 |
|
1718 eap_config_value_c config(m_am_tools); |
|
1719 |
|
1720 if (config.get_is_valid() == false) |
|
1721 { |
|
1722 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1723 } |
|
1724 |
|
1725 config.set_type(eap_configure_type_hex_data); |
|
1726 |
|
1727 status = config.get_data()->set_copy_of_buffer( |
|
1728 value_data); |
|
1729 if (status != eap_status_ok) |
|
1730 { |
|
1731 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1732 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1733 } |
|
1734 |
|
1735 status = message->add_parameter_data( |
|
1736 &selector, |
|
1737 &config); |
|
1738 if (status != eap_status_ok) |
|
1739 { |
|
1740 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1741 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1742 } |
|
1743 |
|
1744 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1745 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1746 } |
|
1747 |
|
1748 |
|
1749 const TUint32 K2DigitMncMccList[] |
|
1750 = { |
|
1751 202,204,206,208,213,214,216,218, |
|
1752 219,220,222,226,228,230,231,232, |
|
1753 234,238,240,242,244,246,247,248, |
|
1754 250,255,257,259,260,262,266,268, |
|
1755 270,272,274,276,278,280,282,284, |
|
1756 286,288,290,293,294,295,308,340, |
|
1757 362,363,400,401,402,404,410,413, |
|
1758 414,415,416,417,419,420,421,422, |
|
1759 424,425,426,427,428,429,432,434, |
|
1760 436,437,438,440,441,452,454,455, |
|
1761 456,457,460,470,472,502,505,510, |
|
1762 515,520,525,528,530,537,539,541, |
|
1763 546,547,549,602,603,604,605,607, |
|
1764 608,609,610,611,612,613,614,615, |
|
1765 616,617,619,620,621,622,623,624, |
|
1766 625,626,628,629,630,631,633,634, |
|
1767 635,636,638,639,640,641,642,643, |
|
1768 645,646,647,648,649,650,651,652, |
|
1769 653,654,655,702,704,706,710,712, |
|
1770 714,716,724,730,734,744,746,901 |
|
1771 }; |
|
1772 |
|
1773 /** |
1761 /** |
1774 * The read_configure() function reads the configuration data identified |
1762 * The read_configure() function reads the configuration data identified |
1775 * by the field string of field_length bytes length. Adaptation module must direct |
1763 * by the field string of field_length bytes length. Adaptation module must direct |
1776 * the query to some persistent store. |
1764 * the query to some persistent store. |
1777 * @see abs_eap_base_type_c::read_configure(). |
1765 * @see abs_eap_base_type_c::read_configure(). |
1799 data); |
1787 data); |
1800 |
1788 |
1801 |
1789 |
1802 // Check if the wanted parameter is default type |
1790 // Check if the wanted parameter is default type |
1803 |
1791 |
1804 if (field->get_type() == eap_configure_type_all_configurations |
|
1805 && field->compare( |
|
1806 m_am_tools, |
|
1807 cf_str_EAP_read_all_configurations.get_field()) == true) |
|
1808 { |
|
1809 // Copy all special configurations to data. |
|
1810 |
|
1811 eap_process_tlv_message_data_c message(m_am_tools); |
|
1812 |
|
1813 if (message.get_is_valid() == false) |
|
1814 { |
|
1815 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1816 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1817 } |
|
1818 |
|
1819 { |
|
1820 // cf_str_EAP_default_type_hex_data and cf_str_EAP_server_default_type_hex_data |
|
1821 |
|
1822 eap_variable_data_c value_data(m_am_tools); |
|
1823 if (value_data.get_is_valid() == false) |
|
1824 { |
|
1825 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1826 } |
|
1827 |
|
1828 // Now there are enabled EAP type, we need to take the first EAP type from the arrary. |
|
1829 SEapExpandedType * expandedEAPType = m_enabled_expanded_eap_array[0]; //First item. |
|
1830 |
|
1831 status = value_data.set_copy_of_buffer( |
|
1832 expandedEAPType->EapExpandedType.Ptr(), |
|
1833 KExpandedEapTypeSize); |
|
1834 if (status != eap_status_ok) |
|
1835 { |
|
1836 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1837 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1838 } |
|
1839 |
|
1840 status = add_configuration_data( |
|
1841 &message, |
|
1842 cf_str_EAP_default_type_hex_data.get_field(), |
|
1843 eap_configure_type_hex_data, |
|
1844 &value_data); |
|
1845 if (status != eap_status_ok) |
|
1846 { |
|
1847 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1848 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1849 } |
|
1850 |
|
1851 status = add_configuration_data( |
|
1852 &message, |
|
1853 cf_str_EAP_server_default_type_hex_data.get_field(), |
|
1854 eap_configure_type_hex_data, |
|
1855 &value_data); |
|
1856 if (status != eap_status_ok) |
|
1857 { |
|
1858 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1859 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1860 } |
|
1861 } |
|
1862 |
|
1863 { |
|
1864 // cf_str_EAP_GSMSIM_UMA_profile, cf_str_EAP_AKA_UMA_profile, |
|
1865 // cf_str_EAP_GSMSIM_wait_eap_success_packet and cf_str_EAP_AKA_wait_eap_success_packet |
|
1866 |
|
1867 TInt val(1); |
|
1868 |
|
1869 eap_variable_data_c value_data(m_am_tools); |
|
1870 if (value_data.get_is_valid() == false) |
|
1871 { |
|
1872 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1873 } |
|
1874 |
|
1875 status = value_data.set_copy_of_buffer((u8_t*) &val, sizeof(TUint)); |
|
1876 if (status != eap_status_ok) |
|
1877 { |
|
1878 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1879 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1880 } |
|
1881 |
|
1882 status = add_configuration_data( |
|
1883 &message, |
|
1884 cf_str_EAP_GSMSIM_UMA_profile.get_field(), |
|
1885 eap_configure_type_boolean, |
|
1886 &value_data); |
|
1887 if (status != eap_status_ok) |
|
1888 { |
|
1889 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1890 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1891 } |
|
1892 |
|
1893 status = add_configuration_data( |
|
1894 &message, |
|
1895 cf_str_EAP_AKA_UMA_profile.get_field(), |
|
1896 eap_configure_type_boolean, |
|
1897 &value_data); |
|
1898 if (status != eap_status_ok) |
|
1899 { |
|
1900 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1901 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1902 } |
|
1903 |
|
1904 status = add_configuration_data( |
|
1905 &message, |
|
1906 cf_str_EAP_GSMSIM_wait_eap_success_packet.get_field(), |
|
1907 eap_configure_type_boolean, |
|
1908 &value_data); |
|
1909 if (status != eap_status_ok) |
|
1910 { |
|
1911 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1912 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1913 } |
|
1914 |
|
1915 status = add_configuration_data( |
|
1916 &message, |
|
1917 cf_str_EAP_AKA_wait_eap_success_packet.get_field(), |
|
1918 eap_configure_type_boolean, |
|
1919 &value_data); |
|
1920 if (status != eap_status_ok) |
|
1921 { |
|
1922 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1923 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1924 } |
|
1925 } |
|
1926 |
|
1927 { |
|
1928 // cf_str_EAP_GSMSIM_UMA_realm_prefix and cf_str_EAP_AKA_UMA_realm_prefix |
|
1929 |
|
1930 eap_variable_data_c value_data(m_am_tools); |
|
1931 if (value_data.get_is_valid() == false) |
|
1932 { |
|
1933 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1934 } |
|
1935 |
|
1936 // Set uma realm prefix of EAP-SIM and EAP-AKA. |
|
1937 status = value_data.set_copy_of_buffer(iRealmPrefix->Ptr(), iRealmPrefix->Length()); |
|
1938 if (status != eap_status_ok) |
|
1939 { |
|
1940 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1941 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1942 } |
|
1943 |
|
1944 status = add_configuration_data( |
|
1945 &message, |
|
1946 cf_str_EAP_GSMSIM_UMA_realm_prefix.get_field(), |
|
1947 eap_configure_type_string, |
|
1948 &value_data); |
|
1949 if (status != eap_status_ok) |
|
1950 { |
|
1951 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1952 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1953 } |
|
1954 |
|
1955 status = add_configuration_data( |
|
1956 &message, |
|
1957 cf_str_EAP_AKA_UMA_realm_prefix.get_field(), |
|
1958 eap_configure_type_string, |
|
1959 &value_data); |
|
1960 if (status != eap_status_ok) |
|
1961 { |
|
1962 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1963 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1964 } |
|
1965 } |
|
1966 |
|
1967 { |
|
1968 // cf_str_EAP_GSMSIM_use_manual_realm, cf_str_EAP_AKA_use_manual_realm |
|
1969 |
|
1970 TInt val(1); |
|
1971 |
|
1972 if(iManualRealm == NULL || (iManualRealm && (iManualRealm->Length() == 0))) |
|
1973 { |
|
1974 val = 0; |
|
1975 } |
|
1976 |
|
1977 eap_variable_data_c value_data(m_am_tools); |
|
1978 if (value_data.get_is_valid() == false) |
|
1979 { |
|
1980 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
1981 } |
|
1982 |
|
1983 status = value_data.set_copy_of_buffer((u8_t*) &val, sizeof(TUint)); |
|
1984 if (status != eap_status_ok) |
|
1985 { |
|
1986 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1987 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1988 } |
|
1989 |
|
1990 status = add_configuration_data( |
|
1991 &message, |
|
1992 cf_str_EAP_GSMSIM_use_manual_realm.get_field(), |
|
1993 eap_configure_type_boolean, |
|
1994 &value_data); |
|
1995 if (status != eap_status_ok) |
|
1996 { |
|
1997 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
1998 return EAP_STATUS_RETURN(m_am_tools, status); |
|
1999 } |
|
2000 |
|
2001 status = add_configuration_data( |
|
2002 &message, |
|
2003 cf_str_EAP_AKA_use_manual_realm.get_field(), |
|
2004 eap_configure_type_boolean, |
|
2005 &value_data); |
|
2006 if (status != eap_status_ok) |
|
2007 { |
|
2008 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2009 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2010 } |
|
2011 } |
|
2012 |
|
2013 { |
|
2014 // cf_str_EAP_GSMSIM_manual_realm and cf_str_EAP_AKA_manual_realm |
|
2015 |
|
2016 eap_variable_data_c value_data(m_am_tools); |
|
2017 if (value_data.get_is_valid() == false) |
|
2018 { |
|
2019 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2020 } |
|
2021 |
|
2022 if(iManualRealm != NULL) |
|
2023 { |
|
2024 // ManualRealm of EAP-SIM and EAP-AKA. |
|
2025 status = value_data.set_copy_of_buffer(iManualRealm->Ptr(), iManualRealm->Length()); |
|
2026 if (status != eap_status_ok) |
|
2027 { |
|
2028 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2029 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2030 } |
|
2031 } |
|
2032 |
|
2033 status = add_configuration_data( |
|
2034 &message, |
|
2035 cf_str_EAP_GSMSIM_manual_realm.get_field(), |
|
2036 eap_configure_type_string, |
|
2037 &value_data); |
|
2038 if (status != eap_status_ok) |
|
2039 { |
|
2040 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2041 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2042 } |
|
2043 |
|
2044 status = add_configuration_data( |
|
2045 &message, |
|
2046 cf_str_EAP_AKA_manual_realm.get_field(), |
|
2047 eap_configure_type_string, |
|
2048 &value_data); |
|
2049 if (status != eap_status_ok) |
|
2050 { |
|
2051 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2052 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2053 } |
|
2054 } |
|
2055 |
|
2056 { |
|
2057 // cf_str_EAP_GSMSIM_use_manual_username, cf_str_EAP_AKA_use_manual_username |
|
2058 |
|
2059 // Use ManualUsername of EAP-SIM and EAP-AKA. |
|
2060 TInt val(1); |
|
2061 if (iManualUsername == NULL || (iManualUsername->Length() == 0)) |
|
2062 { |
|
2063 val = 0; |
|
2064 } |
|
2065 |
|
2066 eap_variable_data_c value_data(m_am_tools); |
|
2067 if (value_data.get_is_valid() == false) |
|
2068 { |
|
2069 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2070 } |
|
2071 |
|
2072 status = value_data.set_copy_of_buffer((u8_t*) &val, sizeof(TUint)); |
|
2073 if (status != eap_status_ok) |
|
2074 { |
|
2075 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2076 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2077 } |
|
2078 |
|
2079 status = add_configuration_data( |
|
2080 &message, |
|
2081 cf_str_EAP_GSMSIM_use_manual_username.get_field(), |
|
2082 eap_configure_type_boolean, |
|
2083 &value_data); |
|
2084 if (status != eap_status_ok) |
|
2085 { |
|
2086 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2087 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2088 } |
|
2089 |
|
2090 status = add_configuration_data( |
|
2091 &message, |
|
2092 cf_str_EAP_AKA_use_manual_username.get_field(), |
|
2093 eap_configure_type_boolean, |
|
2094 &value_data); |
|
2095 if (status != eap_status_ok) |
|
2096 { |
|
2097 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2098 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2099 } |
|
2100 } |
|
2101 |
|
2102 { |
|
2103 // cf_str_EAP_GSMSIM_manual_username and cf_str_EAP_AKA_manual_username |
|
2104 |
|
2105 eap_variable_data_c value_data(m_am_tools); |
|
2106 if (value_data.get_is_valid() == false) |
|
2107 { |
|
2108 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2109 } |
|
2110 |
|
2111 // ManualUsername of EAP-SIM and EAP-AKA. |
|
2112 if (iManualUsername != NULL) |
|
2113 { |
|
2114 status = value_data.set_copy_of_buffer(iManualUsername->Ptr(), iManualUsername->Length()); |
|
2115 if (status != eap_status_ok) |
|
2116 { |
|
2117 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2118 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2119 } |
|
2120 } |
|
2121 status = add_configuration_data( |
|
2122 &message, |
|
2123 cf_str_EAP_GSMSIM_manual_username.get_field(), |
|
2124 eap_configure_type_string, |
|
2125 &value_data); |
|
2126 if (status != eap_status_ok) |
|
2127 { |
|
2128 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2129 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2130 } |
|
2131 |
|
2132 status = add_configuration_data( |
|
2133 &message, |
|
2134 cf_str_EAP_AKA_manual_username.get_field(), |
|
2135 eap_configure_type_string, |
|
2136 &value_data); |
|
2137 if (status != eap_status_ok) |
|
2138 { |
|
2139 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2140 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2141 } |
|
2142 } |
|
2143 |
|
2144 { |
|
2145 // cf_str_EAP_TRACE_output_file_name |
|
2146 |
|
2147 eap_variable_data_c value_data(m_am_tools); |
|
2148 if (value_data.get_is_valid() == false) |
|
2149 { |
|
2150 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2151 } |
|
2152 |
|
2153 status = value_data.set_copy_of_buffer(m_trace_log_file_name); |
|
2154 if (status != eap_status_ok) |
|
2155 { |
|
2156 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2157 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2158 } |
|
2159 |
|
2160 status = add_configuration_data( |
|
2161 &message, |
|
2162 cf_str_EAP_TRACE_output_file_name.get_field(), |
|
2163 eap_configure_type_string, |
|
2164 &value_data); |
|
2165 if (status != eap_status_ok) |
|
2166 { |
|
2167 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2168 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2169 } |
|
2170 } |
|
2171 |
|
2172 { |
|
2173 // cf_str_EAP_GSMSIM_max_session_validity_time and cf_str_EAP_AKA_max_session_validity_time |
|
2174 |
|
2175 u32_t session_validity_time_in_seconds(43200ul); |
|
2176 |
|
2177 eap_variable_data_c value_data(m_am_tools); |
|
2178 if (value_data.get_is_valid() == false) |
|
2179 { |
|
2180 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2181 } |
|
2182 |
|
2183 status = value_data.set_copy_of_buffer(reinterpret_cast<u8_t*>(&session_validity_time_in_seconds), sizeof(session_validity_time_in_seconds)); |
|
2184 if (status != eap_status_ok) |
|
2185 { |
|
2186 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2187 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2188 } |
|
2189 |
|
2190 status = add_configuration_data( |
|
2191 &message, |
|
2192 cf_str_EAP_GSMSIM_max_session_validity_time.get_field(), |
|
2193 eap_configure_type_u32_t, |
|
2194 &value_data); |
|
2195 if (status != eap_status_ok) |
|
2196 { |
|
2197 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2198 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2199 } |
|
2200 |
|
2201 status = add_configuration_data( |
|
2202 &message, |
|
2203 cf_str_EAP_AKA_max_session_validity_time.get_field(), |
|
2204 eap_configure_type_u32_t, |
|
2205 &value_data); |
|
2206 if (status != eap_status_ok) |
|
2207 { |
|
2208 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2209 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2210 } |
|
2211 } |
|
2212 |
|
2213 { |
|
2214 // cf_str_EAP_CORE_wait_eap_request_type_timeout |
|
2215 |
|
2216 u32_t wait_eap_request_type_timeout_in_milli_seconds(30000ul); |
|
2217 |
|
2218 eap_variable_data_c value_data(m_am_tools); |
|
2219 if (value_data.get_is_valid() == false) |
|
2220 { |
|
2221 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2222 } |
|
2223 |
|
2224 status = value_data.set_copy_of_buffer(reinterpret_cast<u8_t*>(&wait_eap_request_type_timeout_in_milli_seconds), sizeof(wait_eap_request_type_timeout_in_milli_seconds)); |
|
2225 if (status != eap_status_ok) |
|
2226 { |
|
2227 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2228 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2229 } |
|
2230 |
|
2231 status = add_configuration_data( |
|
2232 &message, |
|
2233 cf_str_EAP_CORE_wait_eap_request_type_timeout.get_field(), |
|
2234 eap_configure_type_u32_t, |
|
2235 &value_data); |
|
2236 if (status != eap_status_ok) |
|
2237 { |
|
2238 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2239 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2240 } |
|
2241 } |
|
2242 |
|
2243 { |
|
2244 // cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array and cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array |
|
2245 |
|
2246 eap_variable_data_c value_data(m_am_tools); |
|
2247 if (value_data.get_is_valid() == false) |
|
2248 { |
|
2249 return EAP_STATUS_RETURN(m_am_tools, eap_status_allocation_error); |
|
2250 } |
|
2251 |
|
2252 // 2-digit MNC configuration of EAP-SIM and EAP-AKA. |
|
2253 status = value_data.set_copy_of_buffer((u32_t*) K2DigitMncMccList, sizeof(K2DigitMncMccList)); |
|
2254 if (status != eap_status_ok) |
|
2255 { |
|
2256 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2257 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2258 } |
|
2259 |
|
2260 status = add_configuration_data( |
|
2261 &message, |
|
2262 cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array.get_field(), |
|
2263 eap_configure_type_u32array, |
|
2264 &value_data); |
|
2265 if (status != eap_status_ok) |
|
2266 { |
|
2267 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2268 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2269 } |
|
2270 |
|
2271 status = add_configuration_data( |
|
2272 &message, |
|
2273 cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array.get_field(), |
|
2274 eap_configure_type_u32array, |
|
2275 &value_data); |
|
2276 if (status != eap_status_ok) |
|
2277 { |
|
2278 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2279 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2280 } |
|
2281 } |
|
2282 |
|
2283 status = data->set_copy_of_buffer( |
|
2284 message.get_message_data(), |
|
2285 message.get_message_data_length()); |
|
2286 if (status != eap_status_ok) |
|
2287 { |
|
2288 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2289 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2290 } |
|
2291 } |
|
2292 else |
|
2293 { |
1792 { |
2294 eap_variable_data_c wanted_field(m_am_tools); |
1793 eap_variable_data_c wanted_field(m_am_tools); |
2295 |
1794 |
2296 status = wanted_field.set_buffer( |
1795 status = wanted_field.set_buffer( |
2297 field->get_field(), |
1796 field->get_field(), |
2470 || wanted_field.compare( |
2023 || wanted_field.compare( |
2471 cf_str_EAP_AKA_manual_username.get_field()->get_field(), |
2024 cf_str_EAP_AKA_manual_username.get_field()->get_field(), |
2472 cf_str_EAP_AKA_manual_username.get_field()->get_field_length()) == 0) |
2025 cf_str_EAP_AKA_manual_username.get_field()->get_field_length()) == 0) |
2473 { |
2026 { |
2474 // ManualUsername of EAP-SIM and EAP-AKA. |
2027 // ManualUsername of EAP-SIM and EAP-AKA. |
2475 if(iManualUsername != NULL) |
2028 status = data->set_copy_of_buffer(iManualUsername->Ptr(), iManualUsername->Length()); |
2476 { |
2029 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
2477 status = data->set_copy_of_buffer(iManualUsername->Ptr(), iManualUsername->Length()); |
2030 return EAP_STATUS_RETURN(m_am_tools, status); |
2478 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
2479 return EAP_STATUS_RETURN(m_am_tools, status); |
|
2480 } |
|
2481 } |
2031 } |
2482 else if (wanted_field.compare( |
2032 else if (wanted_field.compare( |
2483 cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field(), |
2033 cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field(), |
2484 cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field_length()) == 0 |
2034 cf_str_EAP_GSMSIM_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field_length()) == 0 |
2485 || wanted_field.compare( |
2035 || wanted_field.compare( |
2486 cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field(), |
2036 cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field(), |
2487 cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field_length()) == 0) |
2037 cf_str_EAP_AKA_2_digit_mnc_map_of_mcc_of_imsi_array.get_field()->get_field_length()) == 0) |
2488 { |
2038 { |
2489 // 2-digit MNC configuration of EAP-SIM and EAP-AKA. |
2039 // 2-digit MNC configuration of EAP-SIM and EAP-AKA. |
|
2040 const TUint32 K2DigitMncMccList[] |
|
2041 = { |
|
2042 202,204,206,208,213,214,216,218, |
|
2043 219,220,222,226,228,230,231,232, |
|
2044 234,238,240,242,244,246,247,248, |
|
2045 250,255,257,259,260,262,266,268, |
|
2046 270,272,274,276,278,280,282,284, |
|
2047 286,288,290,293,294,295,308,340, |
|
2048 362,363,400,401,402,404,410,413, |
|
2049 414,415,416,417,419,420,421,422, |
|
2050 424,425,426,427,428,429,432,434, |
|
2051 436,437,438,440,441,452,454,455, |
|
2052 456,457,460,470,472,502,505,510, |
|
2053 515,520,525,528,530,537,539,541, |
|
2054 546,547,549,602,603,604,605,607, |
|
2055 608,609,610,611,612,613,614,615, |
|
2056 616,617,619,620,621,622,623,624, |
|
2057 625,626,628,629,630,631,633,634, |
|
2058 635,636,638,639,640,641,642,643, |
|
2059 645,646,647,648,649,650,651,652, |
|
2060 653,654,655,702,704,706,710,712, |
|
2061 714,716,724,730,734,744,746,901 |
|
2062 }; |
|
2063 |
2490 status = data->set_copy_of_buffer((u32_t*) K2DigitMncMccList, sizeof(K2DigitMncMccList)); |
2064 status = data->set_copy_of_buffer((u32_t*) K2DigitMncMccList, sizeof(K2DigitMncMccList)); |
2491 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
2065 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
2492 return EAP_STATUS_RETURN(m_am_tools, status); |
2066 return EAP_STATUS_RETURN(m_am_tools, status); |
2493 } |
2067 } |
2494 else if (wanted_field.compare( |
2068 else if (wanted_field.compare( |
3033 implArray->Close(); |
2654 implArray->Close(); |
3034 } |
2655 } |
3035 |
2656 |
3036 //-------------------------------------------------- |
2657 //-------------------------------------------------- |
3037 |
2658 |
3038 eap_status_e CEapVpnInterfaceImplementation::complete_get_802_11_authentication_mode( |
|
3039 const eap_status_e /* completion_status */, |
|
3040 const eap_am_network_id_c * /* const receive_network_id */, |
|
3041 const eapol_key_802_11_authentication_mode_e /* mode */) |
|
3042 { |
|
3043 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3044 |
|
3045 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
3046 |
|
3047 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3048 return EAP_STATUS_RETURN(m_am_tools, eap_status_not_supported); |
|
3049 } |
|
3050 |
|
3051 //-------------------------------------------------- |
|
3052 |
|
3053 eap_status_e CEapVpnInterfaceImplementation::complete_remove_eap_session( |
|
3054 const bool /* complete_to_lower_layer */, |
|
3055 const eap_am_network_id_c * const /* receive_network_id */) |
|
3056 { |
|
3057 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3058 |
|
3059 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
3060 |
|
3061 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3062 return EAP_STATUS_RETURN(m_am_tools, eap_status_not_supported); |
|
3063 } |
|
3064 |
|
3065 //-------------------------------------------------- |
|
3066 |
|
3067 #if defined(USE_EAP_SIMPLE_CONFIG) |
|
3068 |
|
3069 eap_status_e CEapVpnInterfaceImplementation::save_simple_config_session( |
|
3070 const simple_config_state_e /* state */, |
|
3071 EAP_TEMPLATE_CONST eap_array_c<simple_config_credential_c> * const /* credential_array */, |
|
3072 const eap_variable_data_c * const /* new_password */, |
|
3073 const simple_config_Device_Password_ID_e /* Device_Password_ID */, |
|
3074 const simple_config_payloads_c * const /* other_configuration */ |
|
3075 ) |
|
3076 { |
|
3077 EAP_TRACE_BEGIN(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3078 |
|
3079 EAP_ASSERT(m_am_tools->get_global_mutex()->get_is_reserved() == true); |
|
3080 |
|
3081 EAP_TRACE_END(m_am_tools, TRACE_FLAGS_DEFAULT); |
|
3082 return EAP_STATUS_RETURN(m_am_tools, eap_status_not_supported); |
|
3083 } |
|
3084 |
|
3085 #endif // #if defined(USE_EAP_SIMPLE_CONFIG) |
|
3086 |
|
3087 //-------------------------------------------------- |
|
3088 |
|
3089 // |
|
3090 eap_session_core_base_c * CEapVpnInterfaceImplementation::new_eap_core_client_message_if_c( |
|
3091 abs_eap_am_tools_c * const tools, |
|
3092 abs_eap_session_core_c * const partner, |
|
3093 const bool is_client_when_true, |
|
3094 const u32_t MTU) |
|
3095 { |
|
3096 eap_am_message_if_c *client_if = new_eap_am_client_message_if_c( |
|
3097 tools, |
|
3098 is_client_when_true, |
|
3099 MTU); |
|
3100 |
|
3101 eap_automatic_variable_c<eap_am_message_if_c> automatic_server_if( |
|
3102 tools, |
|
3103 client_if); |
|
3104 |
|
3105 if (client_if == 0 |
|
3106 || client_if->get_is_valid() == false) |
|
3107 { |
|
3108 // ERROR. |
|
3109 if (client_if != 0) |
|
3110 { |
|
3111 EAP_TRACE_DEBUG( |
|
3112 tools, |
|
3113 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
3114 (EAPL("ERROR: calls: eap_session_core_base_c::new_eap_core_client_message_if_c(): client_if->shutdown(): %s.\n"), |
|
3115 (is_client_when_true == true) ? "client": "server")); |
|
3116 |
|
3117 (void) client_if->shutdown(); |
|
3118 } |
|
3119 |
|
3120 return 0; |
|
3121 } |
|
3122 |
|
3123 eap_core_client_message_if_c * new_session_core = new eap_core_client_message_if_c(tools, client_if, partner, is_client_when_true); |
|
3124 |
|
3125 eap_automatic_variable_c<eap_core_client_message_if_c> automatic_new_session_core( |
|
3126 tools, |
|
3127 new_session_core); |
|
3128 |
|
3129 if (new_session_core == 0 |
|
3130 || new_session_core->get_is_valid() == false) |
|
3131 { |
|
3132 // ERROR. |
|
3133 if (new_session_core != 0) |
|
3134 { |
|
3135 EAP_TRACE_DEBUG( |
|
3136 tools, |
|
3137 TRACE_FLAGS_ALWAYS|TRACE_FLAGS_DEFAULT, |
|
3138 (EAPL("ERROR: calls: eap_session_core_base_c::new_eap_core_client_message_if_c(): new_session_core->shutdown(): %s.\n"), |
|
3139 (is_client_when_true == true) ? "client": "server")); |
|
3140 |
|
3141 new_session_core->shutdown(); |
|
3142 } |
|
3143 |
|
3144 (void) client_if->shutdown(); |
|
3145 |
|
3146 return 0; |
|
3147 } |
|
3148 |
|
3149 client_if->set_partner(new_session_core); |
|
3150 |
|
3151 automatic_server_if.do_not_free_variable(); |
|
3152 automatic_new_session_core.do_not_free_variable(); |
|
3153 |
|
3154 return new_session_core; |
|
3155 } |
|
3156 |
|
3157 //-------------------------------------------------- |
|
3158 |
|
3159 // End |
2659 // End |