os/security/contentmgmt/cafstreamingsupport/test/tscaf/inc/tipsec.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // Defines IPSec key stream sink test cases
    15 // 
    16 //
    17 
    18 /**
    19  @file 
    20  @internalComponent
    21  @test
    22 */
    23 
    24 #ifndef TIPSEC_H_
    25 #define TIPSEC_H_
    26 
    27 #include <es_sock.h>
    28 #include <in_sock.h>
    29 #include <lib_pfkey.h>
    30 
    31 #include "tscafstep.h"
    32 
    33 class CScafIpSec: public CScafStep
    34 	{
    35 public:
    36 	CScafIpSec(CScafServer& aParent);
    37 	TVerdict doTestStepPreambleL();
    38 	TVerdict doTestL();
    39 	TVerdict doTestStepPostambleL();
    40 protected:
    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);
    47 protected:
    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;	
    60 	};
    61 	
    62 class CScafIpSecDecoderIntegration : public CScafIpSec
    63 	{
    64 public:
    65 	CScafIpSecDecoderIntegration(CScafServer& aParent);
    66 	TVerdict doTestL();
    67 	};
    68 	
    69 class CScafIpSecSadbVerification : public CScafIpSec
    70 	{
    71 public:
    72 	CScafIpSecSadbVerification(CScafServer& aParent);
    73 	TVerdict doTestL();
    74 	};	
    75 	
    76 class CScafIpSecSadbVerificationConcurrency : public CScafIpSec
    77 	{
    78 public:
    79 	CScafIpSecSadbVerificationConcurrency(CScafServer& aParent);
    80 	TVerdict doTestL();
    81 	void TestThreadFuncL(TInt aBaseSpi);	
    82 	};	
    83 	
    84 class CScafIpSecNegative : public CScafIpSec
    85 	{
    86 public:
    87 	CScafIpSecNegative(CScafServer& aParent);
    88 	TVerdict doTestL();
    89 	};			
    90 	
    91 class CScafIpSecMultipleSinks: public CScafIpSec
    92 	{
    93 public:
    94 	CScafIpSecMultipleSinks(CScafServer& aParent);
    95 	TVerdict doTestL();
    96 	};	
    97 	
    98 class CScafIpSecAlgorithmChange: public CScafIpSec
    99 	{
   100 public:
   101 	CScafIpSecAlgorithmChange(CScafServer& aParent);
   102 	TVerdict doTestL();
   103 	};	
   104 	
   105 class CScafIpSecSARemoval: public CScafIpSec
   106 	{
   107 public:
   108 	CScafIpSecSARemoval(CScafServer& aParent);
   109 	TVerdict doTestL();
   110 	};		
   111 		
   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");
   121 
   122 #endif /*TIPSEC_H_*/