telephonyserverplugins/simtsy/src/CSimPhoneSecurity.cpp
changeset 44 8b72faa1200f
parent 0 3553901f7fa8
child 66 07a122eea281
equal deleted inserted replaced
39:2473f5e227f9 44:8b72faa1200f
     1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 /**
    18 /**
    19  @file
    19  @file
    20 */
    20 */
    21 
    21 
       
    22 
       
    23 
       
    24 #include "OstTraceDefinitions.h"
       
    25 #ifdef OST_TRACE_COMPILER_IN_USE
       
    26 #include "CSimPhoneSecurityTraces.h"
       
    27 #endif
       
    28 
    22 #include "CSimPhone.h"
    29 #include "CSimPhone.h"
    23 #include "Simlog.h"
       
    24 #include "utils.h"
    30 #include "utils.h"
    25 #include "CSimPhoneSecurity.h"
    31 #include "CSimPhoneSecurity.h"
    26 #include <testconfigfileparser.h>
    32 #include <testconfigfileparser.h>
    27 #include "CSimTsyMode.h"
    33 #include "CSimTsyMode.h"
    28 #include <e32math.h>
    34 #include <e32math.h>
    64  * Second phase constructor that allocates memory for the phonebook, batch read buffer and
    70  * Second phase constructor that allocates memory for the phonebook, batch read buffer and
    65  * a delayed completion timer.  The constructor also reads the individual and batch read
    71  * a delayed completion timer.  The constructor also reads the individual and batch read
    66  * delays from the configuration file.
    72  * delays from the configuration file.
    67  */
    73  */
    68 	{
    74 	{
    69 	LOGPHONE1("Starting to parse PhoneSecurity additional config parameters...");
    75 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_1, "Starting to parse PhoneSecurity additional config parameters...");
    70 	
    76 	
    71 	iNotifySettingsTimer = CIccTimer::NewL();
    77 	iNotifySettingsTimer = CIccTimer::NewL();
    72 	iNotifySecurityEventsTimer = CIccTimer::NewL();
    78 	iNotifySecurityEventsTimer = CIccTimer::NewL();
    73 	
    79 	
    74 	iNotifySettingsTimer->iTimer = CSimTimer::NewL(iPhone);
    80 	iNotifySettingsTimer->iTimer = CSimTimer::NewL(iPhone);
    84 		{
    90 		{
    85 		TPtrC8 temp;
    91 		TPtrC8 temp;
    86 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
    92 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
    87 		if(ret!=KErrNone)
    93 		if(ret!=KErrNone)
    88 			{
    94 			{
    89 			LOGPARSERR("temp",ret,0,&KSecurityCodes);
    95 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_2, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,0,KSecurityCodes);
    90 			}
    96 			}
    91 		else
    97 		else
    92 			iSecCodes.iPin1.Copy(temp);
    98 			iSecCodes.iPin1.Copy(temp);
    93 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
    99 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
    94 		if(ret!=KErrNone)
   100 		if(ret!=KErrNone)
    95 			{
   101 			{
    96 			LOGPARSERR("temp",ret,1,&KSecurityCodes);
   102 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_3, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,1,KSecurityCodes);
    97 			}
   103 			}
    98 		else
   104 		else
    99 			iSecCodes.iPin2.Copy(temp);
   105 			iSecCodes.iPin2.Copy(temp);
   100 
   106 
   101 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   107 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   102 		if(ret!=KErrNone)
   108 		if(ret!=KErrNone)
   103 			{
   109 			{
   104 			LOGPARSERR("temp",ret,2,&KSecurityCodes);
   110 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_4, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,2,KSecurityCodes);
   105 			}
   111 			}
   106 		else
   112 		else
   107 			iSecCodes.iPuk1.Copy(temp);
   113 			iSecCodes.iPuk1.Copy(temp);
   108 
   114 
   109 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   115 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   110 		if(ret!=KErrNone)
   116 		if(ret!=KErrNone)
   111 			{
   117 			{
   112 			LOGPARSERR("temp",ret,3,&KSecurityCodes);
   118 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_5, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,3,KSecurityCodes);
   113 			}
   119 			}
   114 		else
   120 		else
   115 			iSecCodes.iPuk2.Copy(temp);
   121 			iSecCodes.iPuk2.Copy(temp);
   116 
   122 
   117 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,temp);
   123 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,temp);
   118 		if(ret!=KErrNone)
   124 		if(ret!=KErrNone)
   119 			{
   125 			{
   120 			LOGPARSERR("temp",ret,4,&KSecurityCodes);
   126 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_6, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,4,KSecurityCodes);
   121 			}
   127 			}
   122 		else
   128 		else
   123 			iSecCodes.iPhonePassword.Copy(temp);
   129 			iSecCodes.iPhonePassword.Copy(temp);
   124 
   130 
   125 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,temp);
   131 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,temp);
   126 		if(ret!=KErrNone)
   132 		if(ret!=KErrNone)
   127 			{
   133 			{
   128 			LOGPARSERR("temp",ret,5,&KSecurityCodes);
   134 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_7, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,5,KSecurityCodes);
   129 			}
   135 			}
   130 		else
   136 		else
   131 			iSecCodes.iSPC.Copy(temp);
   137 			iSecCodes.iSPC.Copy(temp);
   132 
   138 
   133 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,temp);
   139 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,temp);
   134 		if(ret!=KErrNone)
   140 		if(ret!=KErrNone)
   135 			{
   141 			{
   136 			LOGPARSERR("temp",ret,6,&KSecurityCodes);
   142 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_8, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,6,KSecurityCodes);
   137 			}
   143 			}
   138 		else
   144 		else
   139 			iSecCodes.iPhBkHiddenKey.Copy(temp);
   145 			iSecCodes.iPhBkHiddenKey.Copy(temp);
   140 
   146 
   141 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,temp);
   147 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,temp);
   142 		if(ret!=KErrNone)
   148 		if(ret!=KErrNone)
   143 			{
   149 			{
   144 			LOGPARSERR("temp",ret,7,&KSecurityCodes);
   150 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_9, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,7,KSecurityCodes);
   145 			}
   151 			}
   146 		else
   152 		else
   147 			iSecCodes.iUSimAppPin.Copy(temp);
   153 			iSecCodes.iUSimAppPin.Copy(temp);
   148 
   154 
   149 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,temp);
   155 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,temp);
   150 		if(ret!=KErrNone)
   156 		if(ret!=KErrNone)
   151 			{
   157 			{
   152 			LOGPARSERR("temp",ret,8,&KSecurityCodes);
   158 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_10, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,8,KSecurityCodes);
   153 			}
   159 			}
   154 		else
   160 		else
   155 			iSecCodes.iSecondUSimAppPin.Copy(temp);
   161 			iSecCodes.iSecondUSimAppPin.Copy(temp);
   156 
   162 
   157 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,9,temp);
   163 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,9,temp);
   158 		if(ret!=KErrNone)
   164 		if(ret!=KErrNone)
   159 			{
   165 			{
   160 			LOGPARSERR("temp",ret,9,&KSecurityCodes);
   166 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_11, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,9,KSecurityCodes);
   161 			}
   167 			}
   162 		else
   168 		else
   163 			iSecCodes.iUniversalPin.Copy(temp);
   169 			iSecCodes.iUniversalPin.Copy(temp);
   164 		}
   170 		}
   165 	
   171 	
   170 		TInt temp;
   176 		TInt temp;
   171 
   177 
   172 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
   178 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
   173 		if(ret!=KErrNone)
   179 		if(ret!=KErrNone)
   174 			{
   180 			{
   175 			LOGPARSERR(&KSecurityCodeAttempts,ret,0,&KSecurityCodeAttempts);
   181 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_12, "WARNING - CONFIGURATION FILE PARSING - Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s." ,ret,0,KSecurityCodeAttempts);
   176 			}
   182 			}
   177 		else
   183 		else
   178 			{
   184 			{
   179 			if (temp <= 0)
   185 			if (temp <= 0)
   180 				{
   186 				{
   181 				LOGPARSERRANGE(&KSecurityCodeAttempts,temp,"> 0",0,&KSecurityCodeAttempts);
   187 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_13, "Using default value...");
   182 				LOGCONFIG1("Using default value...");
       
   183 				temp = KDefaultPinEntryAttempts;
   188 				temp = KDefaultPinEntryAttempts;
   184 				}
   189 				}
   185 			iSecurityCodeRemainigAttempts.iPin1=temp;
   190 			iSecurityCodeRemainigAttempts.iPin1=temp;
   186 			iSecurityCodeDefaultRemainigAttempts.iPin1=temp;
   191 			iSecurityCodeDefaultRemainigAttempts.iPin1=temp;
   187 			}
   192 			}
   188 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
   193 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
   189 		if(ret!=KErrNone)
   194 		if(ret!=KErrNone)
   190 			{
   195 			{
   191 			LOGPARSERR(&KSecurityCodeAttempts,ret,1,&KSecurityCodeAttempts);
   196 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_14, "WARNING - CONFIGURATION FILE PARSING - Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s." ,ret,1,KSecurityCodeAttempts);
   192 			}
   197 			}
   193 		else
   198 		else
   194 			{
   199 			{
   195 			if (temp <= 0)
   200 			if (temp <= 0)
   196 				{
   201 				{
   197 				LOGPARSERRANGE(&KSecurityCodeAttempts,temp,"> 0",1,&KSecurityCodeAttempts);
   202 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_15, "Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s expected > 0" ,temp,1,KSecurityCodeAttempts);
   198 				LOGCONFIG1("Using default value...");
   203 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_16, "Using default value...");
   199 				temp = KDefaultPinEntryAttempts;
   204 				temp = KDefaultPinEntryAttempts;
   200 				}
   205 				}
   201 			iSecurityCodeRemainigAttempts.iPin2=temp;
   206 			iSecurityCodeRemainigAttempts.iPin2=temp;
   202 			iSecurityCodeDefaultRemainigAttempts.iPin2=temp;
   207 			iSecurityCodeDefaultRemainigAttempts.iPin2=temp;
   203 			}
   208 			}
   204 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   209 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   205 		if(ret!=KErrNone)
   210 		if(ret!=KErrNone)
   206 			{
   211 			{
   207 			LOGPARSERR(&KSecurityCodeAttempts,ret,2,&KSecurityCodeAttempts);
   212 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_17, "WARNING - CONFIGURATION FILE PARSING - Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s." ,ret,2,KSecurityCodeAttempts);
   208 			}
   213 			}
   209 		else
   214 		else
   210 			{
   215 			{
   211 			if (temp <= 0)
   216 			if (temp <= 0)
   212 				{
   217 				{
   213 				LOGPARSERRANGE(&KSecurityCodeAttempts,temp,"> 0",2,&KSecurityCodeAttempts);
   218 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_18, "Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s expected > 0" ,temp,2,KSecurityCodeAttempts);
   214 				LOGCONFIG1("Using default value...");
   219 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_19, "Using default value...");
   215 				temp = KDefaultPukEntryAttempts;
   220 				temp = KDefaultPukEntryAttempts;
   216 				}
   221 				}
   217 			iSecurityCodeRemainigAttempts.iPuk1=temp;
   222 			iSecurityCodeRemainigAttempts.iPuk1=temp;
   218 			iSecurityCodeDefaultRemainigAttempts.iPuk1=temp;
   223 			iSecurityCodeDefaultRemainigAttempts.iPuk1=temp;
   219 			}
   224 			}
   220 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   225 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   221 		if(ret!=KErrNone)
   226 		if(ret!=KErrNone)
   222 			{
   227 			{
   223 			LOGPARSERR(&KSecurityCodeAttempts,ret,3,&KSecurityCodeAttempts);
   228 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_20, "WARNING - CONFIGURATION FILE PARSING - Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s."  ,ret,3,KSecurityCodeAttempts);
   224 			}
   229 			}
   225 		else
   230 		else
   226 			{
   231 			{
   227 			if (temp <= 0)
   232 			if (temp <= 0)
   228 				{
   233 				{
   229 				LOGPARSERRANGE(&KSecurityCodeAttempts,temp,"> 0",3,&KSecurityCodeAttempts);
   234 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_21, "Reading element SECURITYCODEATTEMPTS returned %d (element no. %d) from tag %s expected > 0" ,temp,3,KSecurityCodeAttempts);
   230 				LOGCONFIG1("Using default value...");
   235 				OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_22, "Using default value...");
   231 				temp = KDefaultPukEntryAttempts;
   236 				temp = KDefaultPukEntryAttempts;
   232 				}
   237 				}
   233 			iSecurityCodeRemainigAttempts.iPuk2=temp;
   238 			iSecurityCodeRemainigAttempts.iPuk2=temp;
   234 			iSecurityCodeDefaultRemainigAttempts.iPuk2=temp;
   239 			iSecurityCodeDefaultRemainigAttempts.iPuk2=temp;
   235 			}
   240 			}
   236 		}
   241 		}
   237 	else
   242 	else
   238 		{
   243 		{
   239 		LOGPHONE2("NOTE tag %S not defined, using default values",&KSecurityCodeAttempts);
   244 		OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_23, "NOTE tag %s not defined, using default values",KSecurityCodeAttempts);
   240 		iSecurityCodeDefaultRemainigAttempts.iPin1= KDefaultPinEntryAttempts;
   245 		iSecurityCodeDefaultRemainigAttempts.iPin1= KDefaultPinEntryAttempts;
   241 		iSecurityCodeRemainigAttempts.iPin1= iSecurityCodeDefaultRemainigAttempts.iPin1;
   246 		iSecurityCodeRemainigAttempts.iPin1= iSecurityCodeDefaultRemainigAttempts.iPin1;
   242 		iSecurityCodeDefaultRemainigAttempts.iPin2= KDefaultPinEntryAttempts;
   247 		iSecurityCodeDefaultRemainigAttempts.iPin2= KDefaultPinEntryAttempts;
   243 		iSecurityCodeRemainigAttempts.iPin2= iSecurityCodeDefaultRemainigAttempts.iPin2;
   248 		iSecurityCodeRemainigAttempts.iPin2= iSecurityCodeDefaultRemainigAttempts.iPin2;
   244 		iSecurityCodeDefaultRemainigAttempts.iPuk1= KDefaultPukEntryAttempts;
   249 		iSecurityCodeDefaultRemainigAttempts.iPuk1= KDefaultPukEntryAttempts;
   253 		TInt temp;
   258 		TInt temp;
   254 
   259 
   255 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
   260 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,temp);
   256 		if(ret!=KErrNone)
   261 		if(ret!=KErrNone)
   257 			{
   262 			{
   258 			LOGPARSERR("temp",ret,0,&KICCLockedAtStart);
   263 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_24, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,0,KICCLockedAtStart);
   259 			}
   264 			}
   260 		else
   265 		else
   261 			{
   266 			{
   262 			iSecStatus.iPin1=(RMobilePhone::TMobilePhoneLockStatus) temp;
   267 			iSecStatus.iPin1=(RMobilePhone::TMobilePhoneLockStatus) temp;
   263 			iSecSetting.iPin1=(RMobilePhone::TMobilePhoneLockSetting) temp;
   268 			iSecSetting.iPin1=(RMobilePhone::TMobilePhoneLockSetting) temp;
   264 			}
   269 			}
   265 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
   270 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,temp);
   266 		if(ret!=KErrNone)
   271 		if(ret!=KErrNone)
   267 			{
   272 			{
   268 			LOGPARSERR("temp",ret,1,&KICCLockedAtStart);
   273 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_25, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,1,KICCLockedAtStart);
   269 			}
   274 			}
   270 		else
   275 		else
   271 			{
   276 			{
   272 			iSecStatus.iPin2=(RMobilePhone::TMobilePhoneLockStatus) temp;
   277 			iSecStatus.iPin2=(RMobilePhone::TMobilePhoneLockStatus) temp;
   273 			iSecSetting.iPin2=(RMobilePhone::TMobilePhoneLockSetting) temp;
   278 			iSecSetting.iPin2=(RMobilePhone::TMobilePhoneLockSetting) temp;
   274 			}
   279 			}
   275 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   280 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,temp);
   276 		if(ret!=KErrNone)
   281 		if(ret!=KErrNone)
   277 			{
   282 			{
   278 			LOGPARSERR("temp",ret,2,&KICCLockedAtStart);
   283 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_26, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,2,KICCLockedAtStart);
   279 			}
   284 			}
   280 		else
   285 		else
   281 			{
   286 			{
   282 			iSecStatus.iPuk1=(RMobilePhone::TMobilePhoneLockStatus) temp;
   287 			iSecStatus.iPuk1=(RMobilePhone::TMobilePhoneLockStatus) temp;
   283 			iSecSetting.iPuk1=(RMobilePhone::TMobilePhoneLockSetting) temp;
   288 			iSecSetting.iPuk1=(RMobilePhone::TMobilePhoneLockSetting) temp;
   284 			}
   289 			}
   285 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   290 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,temp);
   286 		if(ret!=KErrNone)
   291 		if(ret!=KErrNone)
   287 			{
   292 			{
   288 			LOGPARSERR("temp",ret,3,&KICCLockedAtStart);
   293 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_27, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,3,KICCLockedAtStart);
   289 			}
   294 			}
   290 		else
   295 		else
   291 			{
   296 			{
   292 			iSecStatus.iPuk2=(RMobilePhone::TMobilePhoneLockStatus) temp;
   297 			iSecStatus.iPuk2=(RMobilePhone::TMobilePhoneLockStatus) temp;
   293 			iSecSetting.iPuk2=(RMobilePhone::TMobilePhoneLockSetting) temp;
   298 			iSecSetting.iPuk2=(RMobilePhone::TMobilePhoneLockSetting) temp;
   294 			}
   299 			}
   295 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,temp);
   300 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,4,temp);
   296 		if(ret!=KErrNone)
   301 		if(ret!=KErrNone)
   297 			{
   302 			{
   298 			LOGPARSERR("temp",ret,4,&KICCLockedAtStart);
   303 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_28, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,4,KICCLockedAtStart);
   299 			}
   304 			}
   300 		else
   305 		else
   301 			{
   306 			{
   302 			iSecStatus.iPhonePassword=(RMobilePhone::TMobilePhoneLockStatus) temp;
   307 			iSecStatus.iPhonePassword=(RMobilePhone::TMobilePhoneLockStatus) temp;
   303 			iSecSetting.iPhonePassword=(RMobilePhone::TMobilePhoneLockSetting) temp;
   308 			iSecSetting.iPhonePassword=(RMobilePhone::TMobilePhoneLockSetting) temp;
   304 			}
   309 			}
   305 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,temp);
   310 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,5,temp);
   306 		if(ret!=KErrNone)
   311 		if(ret!=KErrNone)
   307 			{
   312 			{
   308 			LOGPARSERR("temp",ret,5,&KICCLockedAtStart);
   313 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_29, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,5,KICCLockedAtStart);
   309 			}
   314 			}
   310 		else
   315 		else
   311 			iSecStatus.iSPC=(RMobilePhone::TMobilePhoneLockStatus) temp;
   316 			iSecStatus.iSPC=(RMobilePhone::TMobilePhoneLockStatus) temp;
   312 
   317 
   313 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,temp);
   318 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,6,temp);
   314 		if(ret!=KErrNone)
   319 		if(ret!=KErrNone)
   315 			{
   320 			{
   316 			LOGPARSERR("temp",ret,6,&KICCLockedAtStart);
   321 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_30, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,6,KICCLockedAtStart);
   317 			}
   322 			}
   318 		else
   323 		else
   319 			{
   324 			{
   320 			iSecStatus.iPhBkHiddenKey=(RMobilePhone::TMobilePhoneLockStatus) temp;
   325 			iSecStatus.iPhBkHiddenKey=(RMobilePhone::TMobilePhoneLockStatus) temp;
   321 			iSecSetting.iPhBkHiddenKey=(RMobilePhone::TMobilePhoneLockSetting) temp;
   326 			iSecSetting.iPhBkHiddenKey=(RMobilePhone::TMobilePhoneLockSetting) temp;
   322 			}
   327 			}
   323 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,temp);
   328 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,7,temp);
   324 		if(ret!=KErrNone)
   329 		if(ret!=KErrNone)
   325 			{
   330 			{
   326 			LOGPARSERR("temp",ret,7,&KICCLockedAtStart);
   331 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_31, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,7,KICCLockedAtStart);
   327 			}
   332 			}
   328 		else
   333 		else
   329 			{
   334 			{
   330 			iSecStatus.iUSimAppPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   335 			iSecStatus.iUSimAppPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   331 			iSecSetting.iUSimAppPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   336 			iSecSetting.iUSimAppPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   332 			}
   337 			}
   333 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,temp);
   338 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,8,temp);
   334 		if(ret!=KErrNone)
   339 		if(ret!=KErrNone)
   335 			{
   340 			{
   336 			LOGPARSERR("temp",ret,8,&KICCLockedAtStart);
   341 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_32, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,8,KICCLockedAtStart);
   337 			}
   342 			}
   338 		else
   343 		else
   339 			{
   344 			{
   340 			iSecStatus.iSecondUSimAppPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   345 			iSecStatus.iSecondUSimAppPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   341 			iSecSetting.iSecondUSimAppPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   346 			iSecSetting.iSecondUSimAppPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   342 			}
   347 			}
   343 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,9,temp);
   348 		ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,9,temp);
   344 		if(ret!=KErrNone)
   349 		if(ret!=KErrNone)
   345 			{
   350 			{
   346 			LOGPARSERR("temp",ret,9,&KICCLockedAtStart);
   351 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_33, "WARNING - CONFIGURATION FILE PARSING - Reading element TEMP returned %d (element no. %d) from tag %s.",ret,9,KICCLockedAtStart);
   347 			}
   352 			}
   348 		else
   353 		else
   349 			{
   354 			{
   350 			iSecStatus.iUniversalPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   355 			iSecStatus.iUniversalPin=(RMobilePhone::TMobilePhoneLockStatus) temp;
   351 			iSecSetting.iUniversalPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   356 			iSecSetting.iUniversalPin=(RMobilePhone::TMobilePhoneLockSetting) temp;
   362 			TInt duration;
   367 			TInt duration;
   363 			TInt ICCStatus;
   368 			TInt ICCStatus;
   364 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,duration);
   369 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,duration);
   365 			if(ret!=KErrNone)
   370 			if(ret!=KErrNone)
   366 				{
   371 				{
   367 				LOGPARSERR("duration",ret,0,&KICCStatus);
   372 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_34, "WARNING - CONFIGURATION FILE PARSING - Reading element DURATION returned %d (element no. %d) from tag %s.",ret,0,KICCStatus);
   368 				continue;
   373 				continue;
   369 				}
   374 				}
   370 			
   375 			
   371 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,ICCStatus);
   376 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,ICCStatus);
   372 			if(ret!=KErrNone)
   377 			if(ret!=KErrNone)
   373 				{
   378 				{
   374 				LOGPARSERR("ICCStatus",ret,1,&KICCStatus);
   379 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_35, "WARNING - CONFIGURATION FILE PARSING - Reading element ICCSTATUS returned %d (element no. %d) from tag %s.",ret,1,KICCStatus);
   375 				continue;
   380 				continue;
   376 				}
   381 				}
   377 			
   382 			
   378 			TICCStatusEntry icc;
   383 			TICCStatusEntry icc;
   379 			icc.iDuration=duration;
   384 			icc.iDuration=duration;
   393 			TInt duration(0), lock(0), lockSetting(0), lockStatus(0);
   398 			TInt duration(0), lock(0), lockSetting(0), lockStatus(0);
   394 
   399 
   395 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,duration);
   400 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,0,duration);
   396 			if(ret!=KErrNone)
   401 			if(ret!=KErrNone)
   397 				{
   402 				{
   398 				LOGPARSERR("duration",ret,0,&KICCSetting);
   403 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_36, "WARNING - CONFIGURATION FILE PARSING - Reading element DURATION returned %d (element no. %d) from tag %s.",ret,0,KICCSetting);
   399 				continue;
   404 				continue;
   400 				}
   405 				}
   401 				
   406 				
   402 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,lock);
   407 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,1,lock);
   403 			if(ret!=KErrNone)
   408 			if(ret!=KErrNone)
   404 				{
   409 				{
   405 				LOGPARSERR("lock",ret,1,&KICCSetting);
   410 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_37, "WARNING - CONFIGURATION FILE PARSING - Reading element LOCK returned %d (element no. %d) from tag %s.",ret,1,KICCSetting);
   406 				continue;
   411 				continue;
   407 				}
   412 				}
   408 			
   413 			
   409 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,lockSetting);
   414 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,2,lockSetting);
   410 			if(ret!=KErrNone)
   415 			if(ret!=KErrNone)
   411 				{
   416 				{
   412 				LOGPARSERR("lockSetting",ret,2,&KICCSetting);
   417 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_38, "WARNING - CONFIGURATION FILE PARSING - Reading element LOCKSETTING returned %d (element no. %d) from tag %s.",ret,2,KICCSetting);
   413 				continue;
   418 				continue;
   414 				}
   419 				}
   415 			
   420 			
   416 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,lockStatus);
   421 			ret=CTestConfig::GetElement(item->Value(),KStdDelimiter,3,lockStatus);
   417 			if(ret!=KErrNone)
   422 			if(ret!=KErrNone)
   418 				{
   423 				{
   419 				LOGPARSERR("lockStatus",ret,3,&KICCSetting);
   424 				OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CONSTRUCTL_39, "WARNING - CONFIGURATION FILE PARSING - Reading element LOCKSTATUS returned %d (element no. %d) from tag %s.",ret,3,KICCSetting);
   420 				continue;
   425 				continue;
   421 				}
   426 				}
   422 			
   427 			
   423 			TICCSettingEntry icc;
   428 			TICCSettingEntry icc;
   424 			icc.iLock = (RMobilePhone::TMobilePhoneLock)lock;
   429 			icc.iLock = (RMobilePhone::TMobilePhoneLock)lock;
   635 	case EMobilePhoneNotifySecurityCapsChange:
   640 	case EMobilePhoneNotifySecurityCapsChange:
   636 	case EMobilePhoneNotifySecurityEvent:
   641 	case EMobilePhoneNotifySecurityEvent:
   637 		return KDefaultNumberOfSlots;
   642 		return KDefaultNumberOfSlots;
   638 
   643 
   639 	default:
   644 	default:
   640 		LOGPHONE1("CSimPhoneSecurity: Number of Slots error, unknown IPC");
   645 		OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_NUMBEROFSLOTSL_1, "CSimPhoneSecurity: Number of Slots error, unknown IPC");
   641 		User::Leave(KErrNotSupported);
   646 		User::Leave(KErrNotSupported);
   642 		break;
   647 		break;
   643 		}
   648 		}
   644 	return KDefaultNumberOfSlots;
   649 	return KDefaultNumberOfSlots;
   645 	}
   650 	}
   692 * Returns a pointer to the config file section
   697 * Returns a pointer to the config file section
   693 *
   698 *
   694 * @return CTestConfigSection a pointer to the configuration file data section
   699 * @return CTestConfigSection a pointer to the configuration file data section
   695 */
   700 */
   696 	{
   701 	{
   697 	LOGPHONE1(">>CSimPhoneSecurity::CfgFile");
   702 	OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_CFGFILE_1, ">>CSimPhoneSecurity::CfgFile");
   698 	return iPhone->CfgFile();
   703 	return iPhone->CfgFile();
   699 	}
   704 	}
   700 
   705 
   701 
   706 
   702 TInt CSimPhoneSecurity::GetSecurityCaps(const TTsyReqHandle aReqHandle, TUint32* aCaps)
   707 TInt CSimPhoneSecurity::GetSecurityCaps(const TTsyReqHandle aReqHandle, TUint32* aCaps)
  1416 			break;
  1421 			break;
  1417 
  1422 
  1418 		case RMobilePhone::ESPCChanged:
  1423 		case RMobilePhone::ESPCChanged:
  1419 			//  FALLTHRU
  1424 			//  FALLTHRU
  1420 		default:
  1425 		default:
  1421 			LOGPHONE4("CSimPhoneSecurity::SecurityEvent %d OOR [%d,%d]",
  1426 			OstTraceDefExt3(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CSIMPHONESECURITY_SECURITYEVENT_1, "CSimPhoneSecurity::SecurityEvent %d OOR [%d,%d]",aEvent, RMobilePhone::ENoICCFound, RMobilePhone::ESPCChanged);
  1422 					aEvent, RMobilePhone::ENoICCFound, RMobilePhone::ESPCChanged);
       
  1423 			return;
  1427 			return;
  1424 		}
  1428 		}
  1425 	
  1429 	
  1426 	if(iNotifyEvent.iNotifyPending)
  1430 	if(iNotifyEvent.iNotifyPending)
  1427 		{
  1431 		{