First public contribution.
2 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
21 #include "tpaddingServer.h"
22 #include "tpaddingTestSteps.h"
23 #include "tpaddingNone.h"
24 #include "tpaddingSSLv3.h"
25 #include "tpaddingPKCS1.h"
26 #include "tpaddingPKCS7.h"
28 // name of test server
29 _LIT(KServerName, "tpaddingserver");
32 CPaddingServer* CPaddingServer::NewL()
34 * @return - Instance of the test server
35 * Called inside the MainL() function to create and start the
36 * CTestServer derived server.
40 CPaddingServer * server = new (ELeave) CPaddingServer();
41 CleanupStack::PushL(server);
43 // Either use a StartL or ConstructL, the latter will permit
46 //server->StartL(KServerName);
47 server->ConstructL(KServerName);
48 CleanupStack::Pop(server);
53 // Just an E32Main and a MainL()
56 * Much simpler, uses the new Rendezvous() call to sync with the client
59 // Leave the hooks in for platform security
60 #if (defined __DATA_CAGING__)
61 RProcess().DataCaging(RProcess::EDataCagingOn);
62 RProcess().SecureApi(RProcess::ESecureApiOn);
64 CActiveScheduler* sched=NULL;
65 sched=new(ELeave) CActiveScheduler;
66 CActiveScheduler::Install(sched);
68 CPaddingServer* server = NULL;
69 // Create the CTestServer derived server
71 TRAPD(err,server = CPaddingServer::NewL());
74 // Sync with the client and enter the active scheduler
75 RProcess::Rendezvous(KErrNone);
82 // Only a DLL on emulator for typhoon and earlier
84 GLDEF_C TInt E32Main()
86 * @return - Standard Epoc error code on exit
89 CTrapCleanup* cleanup = CTrapCleanup::New();
99 // Create a thread in the calling process
100 // Emulator typhoon and earlier
102 CTestStep* CPaddingServer::CreateTestStep(const TDesC& aStepName)
104 * @return - A CTestStep derived instance
105 * Implementation of CTestServer pure virtual
108 CTestStep* testStep = NULL;
109 // __EDIT_ME__ - Create your own test steps here
110 // This server creates just one step but create as many as you want
111 // They are created "just in time" when the worker thread is created
113 if (aStepName == KPadNone)
114 testStep = new (ELeave) CTestPadNone();
115 else if (aStepName == KUnpadNone)
116 testStep = new (ELeave) CTestUnpadNone();
117 else if (aStepName == KPadSSLv3)
118 testStep = new (ELeave) CTestPadSSLv3();
119 else if (aStepName == KUnpadSSLv3)
120 testStep = new (ELeave) CTestUnpadSSLv3();
121 else if (aStepName == KPadPKCS1)
122 testStep = new (ELeave) CTestPadPKCS1();
123 else if (aStepName == KUnpadPKCS1)
124 testStep = new (ELeave) CTestUnpadPKCS1();
125 else if (aStepName == KPadPKCS7)
126 testStep = new (ELeave) CTestPadPKCS7();
127 else if (aStepName == KUnpadPKCS7)
128 testStep = new (ELeave) CTestUnpadPKCS7();
129 else if (aStepName == KUnpadCorruptPKCS7)
130 testStep = new (ELeave) CTestUnpadCorruptPKCS7();
131 else if (aStepName == KPaddingCorruptPKCS7)
132 testStep = new (ELeave) CTestPaddingCorruptPKCS7();