|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 |
|
14 #ifndef __SIMPHONEIMSAUTH_H_ |
|
15 #define __SIMPHONEIMSAUTH_H_ |
|
16 |
|
17 /** |
|
18 * @file |
|
19 * |
|
20 * Contains the class definitions required for the Phone IMS Auth |
|
21 * @internalAll |
|
22 */ |
|
23 |
|
24 #include <etelmm.h> |
|
25 #include <et_phone.h> |
|
26 #include "csimtimer.h" |
|
27 #include "CSimSmsStore.h"//ugly but needed for listReadAllAttempt |
|
28 //#include "CSimPhone.h" |
|
29 |
|
30 //Constants |
|
31 |
|
32 /** |
|
33 * The main Phone IMS Auth class which simulates IMS Authorization & |
|
34 * Authentication features |
|
35 */ |
|
36 class CSimPhone; |
|
37 class CTestConfigSection; |
|
38 class CTestConfigItem; |
|
39 class CListReadAllAttempt; |
|
40 class CSimPhoneIMSAuth : public CBase, public MTimerCallBack |
|
41 { |
|
42 public: |
|
43 static CSimPhoneIMSAuth* NewL(CSimPhone* aPhone); |
|
44 CSimPhoneIMSAuth(CSimPhone* aPhone); |
|
45 ~CSimPhoneIMSAuth(); |
|
46 const CTestConfigSection* CfgFile(); |
|
47 |
|
48 TInt GetAuthorizationInfoPhase1(const TTsyReqHandle aTsyReqHandle, |
|
49 RMobilePhone::TClientId* aClient,TInt* aBufSize); |
|
50 TInt ProcessGetAuthorizationInfoPhase1L(const TTsyReqHandle aTsyReqHandle, |
|
51 RMobilePhone::TClientId* aClientId, TInt* aBufSize); |
|
52 TInt GetAuthorizationInfoPhase2(const TTsyReqHandle aTsyReqHandle, |
|
53 RMobilePhone::TClientId* aClientId,TDes8* aBuffer); |
|
54 TInt GetAuthorizationInfoCancel(const TTsyReqHandle aTsyReqHandle); |
|
55 |
|
56 TInt NotifyImsAuthorizationInfoChanged(const TTsyReqHandle aTsyReqHandle); |
|
57 TInt NotifyImsAuthorizationInfoChangedCancel(const TTsyReqHandle aTsyReqHandle); |
|
58 |
|
59 TInt GetAuthenticationData(const TTsyReqHandle aTsyReqHandle,TDes8* aAuthenticationData); |
|
60 TInt GetAuthenticationDataCancel(const TTsyReqHandle aTsyReqHandle); |
|
61 |
|
62 protected: |
|
63 void ConstructL(); |
|
64 |
|
65 private: |
|
66 struct TAuthorizationInfo |
|
67 { |
|
68 /**Internet Multimedia Private Identity stored on the ISIM/USIM*/ |
|
69 RMobilePhone::TIMPI iIMPI; |
|
70 /**Internet Multimedia Public Identity(ies) stored on the ISIM/USIM*/ |
|
71 RArray<RMobilePhone::TIMPU> iIMPUArray; |
|
72 /**Home Network Domain Name stored on the ISIM/USIM*/ |
|
73 RMobilePhone::THNDN iHomeNetworkDomainName; |
|
74 /**indicates whether authorization data has been retrieved from the ISIM*/ |
|
75 RMobilePhone::TAuthorizationDataSource iAuthenticationDataSource; |
|
76 /**The delay after calling NotifyChange after which the next Authorization info is set*/ |
|
77 TInt iInfoChangeDelay; |
|
78 }; |
|
79 |
|
80 struct TAuthenticationInfo |
|
81 { |
|
82 /** holds value of network challenge AUTN */ |
|
83 TBuf8<RMobilePhone::KAutnLength> iAUTN; |
|
84 /** holds value of network challenge RAND */ |
|
85 TBuf8<RMobilePhone::KRandLength> iRAND; |
|
86 /** holds result RES of AUTHENTICATE command when it's successfull*/ |
|
87 TBuf8<RMobilePhone::KResLength> iRES; |
|
88 /** holds value of session key Integrity Key */ |
|
89 TBuf8<RMobilePhone::KIkLength> iIK; |
|
90 /** holds value of session key Cipher Key */ |
|
91 TBuf8<RMobilePhone::KCkLength> iCK; |
|
92 /** holds value of Authentication Token when AUTHENTICATE fails*/ |
|
93 TBuf8<RMobilePhone::KAutsLength> iAUTS; |
|
94 /** holds the error code that the AUTHENTICATE request should pass/fail with*/ |
|
95 TInt iAuthenticationErr; |
|
96 }; |
|
97 |
|
98 void TimerCallBack(TInt aId); |
|
99 void ParseAuthorizationInfoL(); |
|
100 void ParseAuthenticationInfoL(); |
|
101 |
|
102 private: |
|
103 CSimPhone* iPhone; |
|
104 CSimTimer* iTimer; |
|
105 CArrayPtrFlat<CListReadAllAttempt>* iGetAuthorizationData; |
|
106 TBool iTimerStarted; |
|
107 |
|
108 TBool iAuthInfoChangeNotifyPending; // < Authorization Info change notification outstanding |
|
109 TTsyReqHandle iAuthInfoChangeNotifyReqHandle; // < Authorization Info change notification request handle |
|
110 |
|
111 |
|
112 RArray<TAuthorizationInfo> iAuthorizationInfoList; |
|
113 TInt iCurrentAuthorizationInfo; |
|
114 RArray<TAuthenticationInfo> iAuthenticationInfoList; |
|
115 }; |
|
116 |
|
117 #endif |