diff -r 000000000000 -r 3553901f7fa8 telephonyserverplugins/simtsy/src/csimsmartcardauth.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/telephonyserverplugins/simtsy/src/csimsmartcardauth.h Tue Feb 02 01:41:59 2010 +0200 @@ -0,0 +1,162 @@ +// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file +*/ + +#include +#include +#include "CSimPhone.h" + +class CSimPhone; +class CTestConfigSection; + +class CSimSmartCardAuth : public CBase + { +public: + static CSimSmartCardAuth* NewL(CSimPhone* aPhone); + ~CSimSmartCardAuth(); + + TInt GetScAuthenticationData(const TTsyReqHandle aTsyReqHandle, TDes8* aPckg1, const RMobilePhone::TAID* aAID); + TInt GetScAuthenticationDataCancel(const TTsyReqHandle aTsyReqHandle); + +private: + CSimSmartCardAuth(CSimPhone *aPhone); + void ConstructL(); + + void ParseAuthInfoL(); + void ParseGBAAuthInfoL(); + void ParseMBMSAuthInfoL(); + + const CTestConfigSection* CfgFile(); + + /** + Structure for holding the authentication parameters read from the + config.txt file. All buffer sizes are multiplied by 4 since each + byte needs at most 4 chars to be represented in the binary format + used by the config.txt (i.e. one byte represented by "\xNN"). + */ + struct TAuthInfo + { + /** holds value of network challenge AUTN */ + TBuf8 iAUTN; + /** holds value of network challenge RAND */ + TBuf8 iRAND; + /** holds result RES of AUTHENTICATE command when it's successfull */ + TBuf8 iRES; + /** holds value of session key Integrity Key */ + TBuf8 iIK; + /** holds value of session key Cipher Key */ + TBuf8 iCK; + /** holds value of GSM Cipher Key */ + TBuf8 iKc; + /** holds value of Authentication Token when AUTHENTICATE fails */ + TBuf8 iAUTS; + /** + holds Application's ID, on which the authentication is to be + carried out. Note, there is no checking for this AID's + existence, config file must simply match client's request data. + */ + TBuf8 iAID; + /** holds the error code that the AUTHENTICATE request should pass/fail with */ + TInt iAuthErr; + /* holds the Btid information */ + + }; + + struct TGBAAuthInfo + { + /** holds value of network challenge AUTN */ + TBuf8 iAUTN; + /** holds value of network challenge RAND */ + TBuf8 iRAND; + /** + holds Application's ID, on which the authentication is to be + carried out. Note, there is no checking for this AID's + existence, config file must simply match client's request data. + */ + TBuf8 iAID; + /** holds result RES of AUTHENTICATE command when it's successfull */ + TBuf8 iRES; + /** holds value of Authentication Token when AUTHENTICATE fails */ + TBuf8 iAUTS; + /** holds value of session key NAFID */ + TBuf8 iNAFID; + /** holds value of session key IMPI */ + TBuf8 iIMPI; + /** holds value of Ks_ext_Naf key */ + TBuf8 iKsExtNaf; + /* holds the Btid information */ + TBuf8 iBtid; + /* holds the keylifetime information */ + TBuf8 iKeyLifeTime; + /* holds whether the other application is busy or not */ + TBool iOtherApplnBusy; + /* holds whether the current application is active or not */ + TBool iApplnActive; + /** holds the error code that the AUTHENTICATE request should pass/fail with */ + TInt iAuthErr; + }; + + struct TMBMSInfo + { + /* holds the input Mikey from the Network */ + TBuf8 iInputMikey ; //255 + /* holds the output Mikey containing the verification message */ + TBuf8 iOutputMikey; //255 + /**holds the output parameter MBMS traffic key */ + TBuf8 iMtk; //16 + /** holds the output parameter random or pseudo random string used to + * protect against some offline pre computation attacks on the + * underlying security protocol. */ + TBuf8 iSaltkey; //16 + /** MSK is identified by its Key Domain ID and MSK ID + * holds the Keydomain ID*/ + TBuf8 iKeyDmn; //3 + /** holds the Key group part */ + TBuf8 iMskIdGrp; //2 + /** holds the MUK ID TLV contains MUK IDr and MUK IDi */ + TBuf8 iMukIdTlv; //255 + /** holds the IDi part of MBMS User Key */ + TBuf8 iMukIdi; //16 + /** holds the IDr part of MBMS User Key */ + TBuf8 iMukIdr; //16 + /** holds the timestamp for MIKEY reply protection in MSK delivery. */ + TBuf8 iMukTimestamp; //16 + /** + holds Application's ID, on which the authentication is to be + carried out. Note, there is no checking for this AID's + existence, config file must simply match client's request data. + */ + TBuf8 iAID; + /** holds value of Ks_Int_Naf key + * The length used for External NAF is being used here also*/ + TBuf8 iKsIntNaf; + /* holds whether the current application is active or not */ + TBool iApplnActive; + /** holds the error code that the AUTHENTICATE request should pass/fail with */ + TInt iAuthErr; + }; + +private: + CSimPhone* iPhone; + TInt index; + + RArray iAuthInfoList; + CArrayFixFlat *iGBAAuthInfoList; + CArrayFixFlat *iMBMSInfoList; + }; +