|
1 /* |
|
2 * Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __UT_CSRTPCRYPTOHANDLERSRTCP_H__ |
|
22 #define __UT_CSRTPCRYPTOHANDLERSRTCP_H__ |
|
23 |
|
24 // EXTERNAL INCLUDES |
|
25 #include <digia/eunit/ceunittestsuiteclass.h> |
|
26 |
|
27 // INTERNAL INCLUDES |
|
28 #include "srtpmastersalt.h" |
|
29 #include "srtpmasterkey.h" |
|
30 #include "srtpcryptocontext.h" |
|
31 #include <in_sock.h> |
|
32 #include "msrtprekeyingobserver.h" |
|
33 |
|
34 // FORWARD DECLARATIONS |
|
35 class CSRTPCryptoHandlerSRTCP; |
|
36 class CSRTPSession; |
|
37 class CSRTPStreamIn; |
|
38 class CSRTPStreamOut; |
|
39 |
|
40 // CLASS DEFINITION |
|
41 /** |
|
42 * |
|
43 * EUnitWizard generated test class. |
|
44 * |
|
45 */ |
|
46 class UT_CSRTPCryptoHandlerSRTCP |
|
47 : public CEUnitTestSuiteClass, |
|
48 public MSRTPReKeyingObserver |
|
49 { |
|
50 public: // Constructors and destructors |
|
51 |
|
52 /** |
|
53 * Two phase construction |
|
54 */ |
|
55 static UT_CSRTPCryptoHandlerSRTCP* NewL(); |
|
56 static UT_CSRTPCryptoHandlerSRTCP* NewLC(); |
|
57 /** |
|
58 * Destructor |
|
59 */ |
|
60 ~UT_CSRTPCryptoHandlerSRTCP(); |
|
61 |
|
62 private: // Constructors and destructors |
|
63 |
|
64 UT_CSRTPCryptoHandlerSRTCP(); |
|
65 void ConstructL(); |
|
66 |
|
67 public: // From observer interface |
|
68 void SRTPMasterKeyStaleEvent(const CSRTPStream& aStream); |
|
69 void SRTPMasterKeyStaleEvent(const CSRTPSession& aSession); |
|
70 |
|
71 |
|
72 private: // New methods |
|
73 |
|
74 void SetupL(); |
|
75 |
|
76 void Teardown(); |
|
77 |
|
78 void UT_CSRTPCryptoHandlerSRTCP_NewLL(); |
|
79 |
|
80 |
|
81 void UT_CSRTPCryptoHandlerSRTCP_NewLCL(); |
|
82 |
|
83 |
|
84 void UT_DeriveSessionKeysL_1L(); |
|
85 |
|
86 |
|
87 void UT_PerformAuthenticationLL(); |
|
88 void UT_AuthenticateLL( ) ; |
|
89 void UT_AuthenticateL2L( ) ; |
|
90 void UT_AddAuthTagLL(); |
|
91 |
|
92 void Hex(HBufC8& aString); |
|
93 |
|
94 void UT_CountSenderPacketIndexL1L( ); |
|
95 void UT_CountSenderPacketIndexL2L(); |
|
96 void UT_ReplayProtectionL1L( ); |
|
97 void UT_ReplayProtectionL2L( ); |
|
98 void UT_ReplayProtectionL3L( ); |
|
99 void UT_ReplayProtectionL4L( ); |
|
100 void UT_CheckMasterKeyIdentifierLL( ); |
|
101 |
|
102 private: // Data |
|
103 |
|
104 EUNIT_DECLARE_TEST_TABLE; |
|
105 CSRTPMasterSalt* iMasterSalt; |
|
106 CSRTPMasterKey* iMasterKey; |
|
107 |
|
108 CSRTPCryptoContext* iContext; |
|
109 |
|
110 HBufC8* iTestPayload160Bits; |
|
111 HBufC8* iTestMKI128Bits; |
|
112 HBufC8* iTestAuthTag80Bits; |
|
113 |
|
114 CSRTPSession* iSRTPSession; |
|
115 CSRTPStreamIn* iStreamIn; |
|
116 CSRTPCryptoHandlerSRTCP *iCryptoHandlerSRTCP; |
|
117 TInetAddr iDestination; |
|
118 |
|
119 HBufC8* iRFC3711_SessionEncrKey128bits; |
|
120 HBufC8* iRFC3711_SessionSaltKey128bits; |
|
121 HBufC8* iRFC3711_SessionAuthKey128bits; |
|
122 HBufC8* iDecryptedPayload; |
|
123 TBool iReKeyCalled; |
|
124 }; |
|
125 |
|
126 #endif // __UT_CSRTPCRYPTOHANDLERSRTCP_H__ |
|
127 |
|
128 // End of file |