|
1 // Copyright (c) 2005-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 |
|
18 */ |
|
19 |
|
20 #include "tlsoomstepwrapper.h" |
|
21 |
|
22 #include "tlsoomconnectstep.h" |
|
23 #include "tlsoomcipherstep.h" |
|
24 #include "tlsoomauthstep.h" |
|
25 #include "tlsoomkeyexchangestep.h" |
|
26 |
|
27 |
|
28 CTlsOOMStepWrapper::CTlsOOMStepWrapper(const TDesC& aStepName) |
|
29 : iStepName(aStepName) |
|
30 { |
|
31 } |
|
32 |
|
33 TVerdict CTlsOOMStepWrapper::doTestStepL() |
|
34 { |
|
35 |
|
36 CActiveScheduler* scheduler = new (ELeave) CActiveScheduler; |
|
37 CleanupStack::PushL(scheduler); |
|
38 CActiveScheduler::Install(scheduler); |
|
39 |
|
40 CTlsOOMStepBase* step; |
|
41 |
|
42 if (iStepName == KConnectStep) |
|
43 { |
|
44 |
|
45 step = CTlsOOMConnectStep::NewL(Logger()); |
|
46 |
|
47 } |
|
48 else if (iStepName == KCipherStep) |
|
49 { |
|
50 |
|
51 step = CTlsOOMCipherStep::NewL(Logger()); |
|
52 |
|
53 } |
|
54 else if (iStepName == KAuthStep) |
|
55 { |
|
56 |
|
57 TPtrC confPath = GetConfigPath(); |
|
58 step = CTlsOOMAuthStep::NewL(confPath, Logger()); |
|
59 |
|
60 } |
|
61 else if (iStepName == KKeyExchangeStep) |
|
62 { |
|
63 |
|
64 TPtrC confPath = GetConfigPath(); |
|
65 TPtrC serverName = GetTlsServerName(); |
|
66 TPtrC sessionID = GetTlsSessionID(); |
|
67 |
|
68 step = CTlsOOMKeyExchangeStep::NewL(confPath, serverName, sessionID, |
|
69 Logger()); |
|
70 |
|
71 } |
|
72 |
|
73 TVerdict result = step->Start(); |
|
74 delete step; |
|
75 CleanupStack::PopAndDestroy(scheduler); |
|
76 |
|
77 return result; |
|
78 |
|
79 } |
|
80 |
|
81 TPtrC CTlsOOMStepWrapper::GetConfigPath() |
|
82 { |
|
83 |
|
84 TPtrC result; |
|
85 _LIT(KConfigFilePath, "CONFPATH"); |
|
86 GetStringFromConfig(ConfigSection(), KConfigFilePath, result); |
|
87 return result; |
|
88 |
|
89 } |
|
90 |
|
91 TPtrC CTlsOOMStepWrapper::GetTlsServerName() |
|
92 { |
|
93 |
|
94 TPtrC result; |
|
95 _LIT(KServerName, "SERVERNAME"); |
|
96 GetStringFromConfig(ConfigSection(), KServerName, result); |
|
97 return result; |
|
98 |
|
99 } |
|
100 |
|
101 TPtrC CTlsOOMStepWrapper::GetTlsSessionID() |
|
102 { |
|
103 |
|
104 TPtrC result; |
|
105 _LIT(KSessionID, "SESSIONID"); |
|
106 GetStringFromConfig(ConfigSection(), KSessionID, result); |
|
107 return result; |
|
108 |
|
109 } |