|
1 // Copyright (c) 2006-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 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file newtlsstepbase.h |
|
18 @internalTechnology |
|
19 */ |
|
20 #ifndef __CNEWTLSSTEPBASE_H__ |
|
21 #define __CNEWTLSSTEPBASE_H__ |
|
22 |
|
23 #include "tlsstepbase.h" |
|
24 |
|
25 #include <asymmetric.h> |
|
26 #include <asymmetrickeys.h> |
|
27 #include <symmetric.h> |
|
28 #include <asnpkcs.h> |
|
29 #include "tlsgenericactive.h" |
|
30 |
|
31 |
|
32 /** |
|
33 * |
|
34 * About this new test step base: |
|
35 * This new test step base is derived from existing test base "CTlsStepBase" but |
|
36 * has been optimised for out of memory test. |
|
37 * Main differences with previous test base: |
|
38 * - All reading of values form INI file had been moved to test pre-amble. |
|
39 * - No production code under test had been initialised in test pre-amble. |
|
40 * - Includes OOM test facilities. |
|
41 * |
|
42 */ |
|
43 |
|
44 |
|
45 class CNewTlsStepBase : public CTlsStepBase |
|
46 { |
|
47 public: |
|
48 |
|
49 ~CNewTlsStepBase(); |
|
50 |
|
51 virtual TVerdict doTestStepPreambleL(); |
|
52 virtual TVerdict doTestStepL(); |
|
53 virtual TVerdict doOOMTestL(); |
|
54 virtual void doTestL(); |
|
55 void ConstructL(); |
|
56 |
|
57 // These "Lean" functions are base on fuctions with similar name in |
|
58 // first base but they do not read any INI value when called. |
|
59 |
|
60 // Generic methods. |
|
61 TInt LeanVerifyServerCertificate(CX509Certificate*& aCertOut, HBufC8* aCertIn); |
|
62 TInt LeanCreateSession(); |
|
63 TInt LeanClientKeyExchange(HBufC8*& aMessageOut); |
|
64 HBufC8* LeanDerivePreMasterSecretL(const TDesC8& aClientKeyExMessage, CDecPKCS8Data* aServerKeyData); |
|
65 TInt LeanCipherSuiteIndex(const TTLSCipherSuite& aSuite); |
|
66 HBufC8* LeanComputeMasterSecretL(const TDesC8& aPremasterSecret); |
|
67 HBufC8* LeanComputeSslMasterSecretL(const TDesC8& aPremasterSecret); |
|
68 HBufC8* LeanComputeTlsMasterSecretL(const TDesC8& aPremasterSecret); |
|
69 void LeanComputeTlsCipherKeysL(const TDesC8& aMasterSecret, const TDesC8& aRandom); |
|
70 void LeanComputeSslCipherKeysL(const TDesC8& aMasterSecret, const TDesC8& aRandom); |
|
71 TInt LeanGetCipherSuitesL(); |
|
72 |
|
73 public: |
|
74 |
|
75 TBool iOOMCondition; |
|
76 TBool iOOMAllowNonMemoryErrors; |
|
77 TBool iUseDHParams; |
|
78 CGenericActive* iActive; |
|
79 |
|
80 // Data that should deleted by test step destructor |
|
81 HBufC8* iServerRandom; |
|
82 HBufC8* iClientRandom; |
|
83 TTLSCipherSuite iCipherSuite; |
|
84 TTLSProtocolVersion iProtocolVersion; |
|
85 TTLSSessionId iSessionId; |
|
86 TPtrC iDomainName; |
|
87 |
|
88 HBufC8* iServerCertificate; |
|
89 CTLSSession* iSession; |
|
90 CDecPKCS8Data* iServerPrivateKey; |
|
91 |
|
92 // Data that has to be reset for each OOM cycle.. |
|
93 CActiveScheduler* iSched; |
|
94 CTLSProvider* iProvider; |
|
95 RArray<TTLSCipherSuite> iSuites; |
|
96 |
|
97 HBufC8* iClientMacSecret; |
|
98 HBufC8* iServerMacSecret; |
|
99 |
|
100 HBufC8* iClientWriteSecret; |
|
101 HBufC8* iServerWriteSecret; |
|
102 |
|
103 HBufC8* iClientInitVector; |
|
104 HBufC8* iServerInitVector; |
|
105 |
|
106 |
|
107 }; |
|
108 |
|
109 #endif /* __CNEWTLSSTEPBASE_H__ */ |