eapol/eapol_framework/eapol_symbian/am/type/aka/symbian/EapAkaInterface.cpp
branchRCL_3
changeset 46 c74b3d9f6b9e
parent 45 bad0cc58d154
equal deleted inserted replaced
45:bad0cc58d154 46:c74b3d9f6b9e
    14 * Description:  EAP and WLAN authentication protocols.
    14 * Description:  EAP and WLAN authentication protocols.
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 /*
    18 /*
    19 * %version: 18 %
    19 * %version: 17.1.3 %
    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
   189 		iQueryId) );
   189 		iQueryId) );
   190 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapAkaInterface::DoCancel()");
   190 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapAkaInterface::DoCancel()");
   191 
   191 
   192 	if (iQueryId == EQueryRES)
   192 	if (iQueryId == EQueryRES)
   193 	{
   193 	{
       
   194 		iQueryId = EQueryNone;
       
   195 
   194 		// Cancel the request.
   196 		// Cancel the request.
   195 		iCustomAPI.CancelAsyncRequest( ECustomGetSimAuthenticationDataIPC );
   197 		iCustomAPI.CancelAsyncRequest( ECustomGetSimAuthenticationDataIPC );
   196 
   198 
   197 		EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::DoCancel(): CANCELLED CUSTOM API REQUEST \n")));
   199 		EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::DoCancel(): CANCELLED CUSTOM API REQUEST \n")));
   198 	}
   200 	}
   227 	if (iStatus.Int() == KErrNone)
   229 	if (iStatus.Int() == KErrNone)
   228 	{	
   230 	{	
   229 		switch( iQueryId )
   231 		switch( iQueryId )
   230 		{
   232 		{
   231 			case EQueryIMSI:
   233 			case EQueryIMSI:
       
   234 
   232 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AKA interface: Got IMSI reply.\n")));
   235 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AKA interface: Got IMSI reply.\n")));
   233 						
   236 						
   234 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("IMSI"),
   237 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("IMSI"),
   235 						iSubscriberId.Ptr(),
   238 						iSubscriberId.Ptr(),
   236 						iSubscriberId.Size()));
   239 						iSubscriberId.Size()));
   237 				
   240 				
       
   241 				iQueryId = EQueryNone;
       
   242 
   238 				// Convert the IMSI from unicode to UTF8 characters.
   243 				// Convert the IMSI from unicode to UTF8 characters.
   239 
   244 
   240 				completion_status = imsiInUnicode.set_buffer(iSubscriberId.Ptr(), iSubscriberId.Size(), false, false);
   245 				completion_status = imsiInUnicode.set_buffer(iSubscriberId.Ptr(), iSubscriberId.Size(), false, false);
   241 
   246 
   242 				if (completion_status != eap_status_ok)
   247 				if (completion_status != eap_status_ok)
   261 				TRAP(error, iParent->complete_AKA_imsi_L(&imsi, completion_status));
   266 				TRAP(error, iParent->complete_AKA_imsi_L(&imsi, completion_status));
   262 			
   267 			
   263 			break;
   268 			break;
   264 			
   269 			
   265 			case EQueryRES:
   270 			case EQueryRES:
       
   271 
   266 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####AKA interface: Got RES, CK, IK and AUTS reply. ####\n")));			
   272 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("####AKA interface: Got RES, CK, IK and AUTS reply. ####\n")));			
   267 				
   273 				
   268 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("RES"),
   274 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("RES"),
   269 						iEAPAka.iRES.Ptr(),
   275 						iEAPAka.iRES.Ptr(),
   270 						iEAPAka.iRES.Size()));
   276 						iEAPAka.iRES.Size()));
   279 						
   285 						
   280 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AUTS"),
   286 				EAP_TRACE_DATA_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AUTS"),
   281 						iEAPAka.iAUTS.Ptr(),
   287 						iEAPAka.iAUTS.Ptr(),
   282 						iEAPAka.iAUTS.Size()));
   288 						iEAPAka.iAUTS.Size()));
   283 										
   289 										
       
   290 				iQueryId = EQueryNone;
       
   291 
   284 				delete iAuthenticationData;
   292 				delete iAuthenticationData;
   285 				iAuthenticationData = NULL;	
   293 				iAuthenticationData = NULL;	
   286 						
   294 						
   287 				// Close the custom API since we don't need it any more.
   295 				// Close the custom API since we don't need it any more.
   288 				iCustomAPI.Close();				
   296 				iCustomAPI.Close();				
   333 		switch( iQueryId )
   341 		switch( iQueryId )
   334 		{
   342 		{
   335 			case EQueryIMSI:
   343 			case EQueryIMSI:
   336 			
   344 			
   337 				// Error with IMSI. Reset it and complete the request.			
   345 				// Error with IMSI. Reset it and complete the request.			
       
   346 				iQueryId = EQueryNone;
   338 				imsi.reset();
   347 				imsi.reset();
   339 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AKA interface: Error in IMSI.\n")));
   348 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("AKA interface: Error in IMSI.\n")));
   340 							
   349 							
   341 				TRAP(error, iParent->complete_AKA_imsi_L(&imsi));
   350 				TRAP(error, iParent->complete_AKA_imsi_L(&imsi));
   342 			break;
   351 			break;
   344 			case EQueryRES:
   353 			case EQueryRES:
   345 			
   354 			
   346 				// Re-synchronization needed or error with RES or CK or IK.
   355 				// Re-synchronization needed or error with RES or CK or IK.
   347 				
   356 				
   348 				// We have to close the custom API anyway. 
   357 				// We have to close the custom API anyway. 
       
   358 				iQueryId = EQueryNone;
   349 				iCustomAPI.Close();				
   359 				iCustomAPI.Close();				
   350 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::RunL() - error case: CLOSED CUSTOM API \n")));
   360 				EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::RunL() - error case: CLOSED CUSTOM API \n")));
   351 				
   361 				
   352 				// Just to verify if there is any values set.
   362 				// Just to verify if there is any values set.
   353 				
   363 				
   481 void CEapAkaInterface::DisconnectMMETel()
   491 void CEapAkaInterface::DisconnectMMETel()
   482 {
   492 {
   483 	EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::DisconnectMMETel()\n")));
   493 	EAP_TRACE_DEBUG(m_am_tools, TRACE_FLAGS_DEFAULT, (EAPL("CEapAkaInterface::DisconnectMMETel()\n")));
   484 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapAkaInterface::DisconnectMMETel()");
   494 	EAP_TRACE_RETURN_STRING(m_am_tools, "returns: CEapAkaInterface::DisconnectMMETel()");
   485 
   495 
       
   496 	iQueryId = EQueryNone;
       
   497 
   486 	// Close the custom API since we don't need it any more.
   498 	// Close the custom API since we don't need it any more.
   487 	iCustomAPI.Close();
   499 	iCustomAPI.Close();
   488 
   500 
   489     if( iMMETELConnectionStatus )
   501     if( iMMETELConnectionStatus )
   490     {
   502     {