Update contrib.
1 // Copyright (c) 2007-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 the License "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".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Defines IPSec key stream sink test cases
29 #include <lib_pfkey.h>
31 #include "tscafstep.h"
33 class CScafIpSec: public CScafStep
36 CScafIpSec(CScafServer& aParent);
37 TVerdict doTestStepPreambleL();
39 TVerdict doTestStepPostambleL();
41 void SendKeyAssociationToKeySinkL(TInt aSpi, CKeyStreamSink *aKeyStreamSink);
42 void AddAndValidateAssociationsL(CKeyStreamSink *aKeyStreamSink, TInt aSpiBase);
43 void ValidateNoAssociationsL(TInt aSpiBase);
44 CKeyStreamSink *CreateDefaultKeyStreamSinkLC();
45 void InitializeAlgorithmsL(CKeyStreamSink *aKeyStreamSink);
46 static void CallValidateSadbL(TInt32 aSpi, TInetAddr &aSourceAddr, TInetAddr &aDestAddr, TBool aPositiveTesting);
48 RSocketServ iSocketServ;
49 RConnection iConnection;
50 RSocket iClientSocket;
51 CKeyStreamSink *iKeyStreamSink;
52 TInetAddr iServerAddr;
53 TInetAddr iClientAddr;
54 HBufC8* iEncryptionKey;
55 HBufC8* iAuthenticationKey;
56 TInt iAssociationsNumber;
57 TBool iAuthenticationUsed;
58 TInt iEncryptionAlgorithm;
59 TInt iAuthenticationAlgorithm;
62 class CScafIpSecDecoderIntegration : public CScafIpSec
65 CScafIpSecDecoderIntegration(CScafServer& aParent);
69 class CScafIpSecSadbVerification : public CScafIpSec
72 CScafIpSecSadbVerification(CScafServer& aParent);
76 class CScafIpSecSadbVerificationConcurrency : public CScafIpSec
79 CScafIpSecSadbVerificationConcurrency(CScafServer& aParent);
81 void TestThreadFuncL(TInt aBaseSpi);
84 class CScafIpSecNegative : public CScafIpSec
87 CScafIpSecNegative(CScafServer& aParent);
91 class CScafIpSecMultipleSinks: public CScafIpSec
94 CScafIpSecMultipleSinks(CScafServer& aParent);
98 class CScafIpSecAlgorithmChange: public CScafIpSec
101 CScafIpSecAlgorithmChange(CScafServer& aParent);
105 class CScafIpSecSARemoval: public CScafIpSec
108 CScafIpSecSARemoval(CScafServer& aParent);
112 // Test case identifier definition
113 _LIT(KScafIpSec,"SCAFIpSec");
114 _LIT(KScafIpSecDecoderIntegration,"SCAFIpSecDecoderIntegration");
115 _LIT(KScafIpSecSadbVerification, "SCAFIpSecSadbVerification");
116 _LIT(KScafIpSecSadbVerificationConcurrency, "SCAFIpSecSadbVerificationConcurrency");
117 _LIT(KScafIpSecNegative,"SCAFIpSecNegative");
118 _LIT(KScafIpSecMultipleSinks,"SCAFIpSecMultipleSinks");
119 _LIT(KScafIpSecAlgorithmChange,"SCAFIpSecAlgorithmChange");
120 _LIT(KScafIpSecSARemoval,"SCAFIpSecSARemoval");