sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 1998-2010 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
3 |
* All rights reserved.
|
sl@0
|
4 |
* This component and the accompanying materials are made available
|
sl@0
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
6 |
* which accompanies this distribution, and is available
|
sl@0
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
8 |
*
|
sl@0
|
9 |
* Initial Contributors:
|
sl@0
|
10 |
* Nokia Corporation - initial contribution.
|
sl@0
|
11 |
*
|
sl@0
|
12 |
* Contributors:
|
sl@0
|
13 |
*
|
sl@0
|
14 |
* Description:
|
sl@0
|
15 |
*
|
sl@0
|
16 |
*/
|
sl@0
|
17 |
|
sl@0
|
18 |
|
sl@0
|
19 |
#include "taction_build.h"
|
sl@0
|
20 |
#include "t_inputextra.h"
|
sl@0
|
21 |
|
sl@0
|
22 |
_LIT(KRoot, "build\\CA3_root.crt");
|
sl@0
|
23 |
_LIT(KCA2, "build\\CA2.crt");
|
sl@0
|
24 |
_LIT(KCA1, "build\\CA1.crt");
|
sl@0
|
25 |
_LIT(KEE, "build\\EE.crt");
|
sl@0
|
26 |
|
sl@0
|
27 |
_LIT(KRootStart, "<root>");
|
sl@0
|
28 |
_LIT(KRootEnd, "</root>");
|
sl@0
|
29 |
_LIT(KCertificateStart, "<certificate>");
|
sl@0
|
30 |
_LIT(KCertificateEnd, "</certificate>");
|
sl@0
|
31 |
_LIT(KLabelStart, "<label>");
|
sl@0
|
32 |
_LIT(KLabelEnd, "</label>");
|
sl@0
|
33 |
_LIT(KExtraStart, "<extra>");
|
sl@0
|
34 |
_LIT(KExtraEnd, "</extra>");
|
sl@0
|
35 |
_LIT(KInitStart, "<init>");
|
sl@0
|
36 |
_LIT(KInitEnd, "</init>");
|
sl@0
|
37 |
_LIT(KAddCallStart, "<addcall>");
|
sl@0
|
38 |
_LIT(KAddCallEnd, "</addcall>");
|
sl@0
|
39 |
|
sl@0
|
40 |
_LIT(KAddCertStart, "<addcert>");
|
sl@0
|
41 |
_LIT(KAddCertEnd, "</addcert>");
|
sl@0
|
42 |
|
sl@0
|
43 |
_LIT(KCertPath, "\\pkixtestdata\\");
|
sl@0
|
44 |
|
sl@0
|
45 |
CAddCall* CAddCall::NewL(const TDesC& aBuf)
|
sl@0
|
46 |
{
|
sl@0
|
47 |
CAddCall* self = CAddCall::NewLC(aBuf);
|
sl@0
|
48 |
CleanupStack::Pop();
|
sl@0
|
49 |
return self;
|
sl@0
|
50 |
}
|
sl@0
|
51 |
|
sl@0
|
52 |
CAddCall* CAddCall::NewLC(const TDesC& aBuf)
|
sl@0
|
53 |
{
|
sl@0
|
54 |
CAddCall* self = new(ELeave) CAddCall;
|
sl@0
|
55 |
CleanupStack::PushL(self);
|
sl@0
|
56 |
self->ConstructL(aBuf);
|
sl@0
|
57 |
return self;
|
sl@0
|
58 |
}
|
sl@0
|
59 |
|
sl@0
|
60 |
CAddCall::~CAddCall()
|
sl@0
|
61 |
{
|
sl@0
|
62 |
delete iCertsToAdd;
|
sl@0
|
63 |
}
|
sl@0
|
64 |
|
sl@0
|
65 |
CAddCall::CAddCall()
|
sl@0
|
66 |
{
|
sl@0
|
67 |
}
|
sl@0
|
68 |
|
sl@0
|
69 |
void CAddCall::ConstructL(const TDesC& aBuf)
|
sl@0
|
70 |
{
|
sl@0
|
71 |
iCertsToAdd = new(ELeave) CDesCArrayFlat (1);
|
sl@0
|
72 |
TInt pos = 0;
|
sl@0
|
73 |
while(AddCert(aBuf, KAddCertStart, KAddCertEnd, pos, *iCertsToAdd))
|
sl@0
|
74 |
{
|
sl@0
|
75 |
}
|
sl@0
|
76 |
}
|
sl@0
|
77 |
|
sl@0
|
78 |
TBool CAddCall::AddCert(const TDesC& aBuf, const TDesC& aStart, const TDesC& aEnd, TInt& aPos, CDesCArray& aCerts)
|
sl@0
|
79 |
{
|
sl@0
|
80 |
TPtrC certBuf = Input::ParseElement(aBuf, aStart, aEnd, aPos);
|
sl@0
|
81 |
if (certBuf != KNullDesC)
|
sl@0
|
82 |
{
|
sl@0
|
83 |
aCerts.AppendL(certBuf);
|
sl@0
|
84 |
return ETrue;
|
sl@0
|
85 |
}
|
sl@0
|
86 |
|
sl@0
|
87 |
return EFalse;
|
sl@0
|
88 |
}
|
sl@0
|
89 |
|
sl@0
|
90 |
CTestAction* CTestActionBuild::NewL(RFs& aFs,
|
sl@0
|
91 |
CConsoleBase& aConsole,
|
sl@0
|
92 |
Output& aOut,
|
sl@0
|
93 |
const TTestActionSpec& aTestActionSpec)
|
sl@0
|
94 |
{
|
sl@0
|
95 |
CTestAction* self = CTestActionBuild::NewLC(aFs, aConsole,
|
sl@0
|
96 |
aOut, aTestActionSpec);
|
sl@0
|
97 |
CleanupStack::Pop(self);
|
sl@0
|
98 |
return self;
|
sl@0
|
99 |
}
|
sl@0
|
100 |
|
sl@0
|
101 |
CTestAction* CTestActionBuild::NewLC(RFs& aFs,
|
sl@0
|
102 |
CConsoleBase& aConsole,
|
sl@0
|
103 |
Output& aOut,
|
sl@0
|
104 |
const TTestActionSpec& aTestActionSpec)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
CTestActionBuild* self = new(ELeave) CTestActionBuild(aFs, aConsole,
|
sl@0
|
107 |
aOut);
|
sl@0
|
108 |
CleanupStack::PushL(self);
|
sl@0
|
109 |
self->ConstructL(aTestActionSpec);
|
sl@0
|
110 |
return self;
|
sl@0
|
111 |
}
|
sl@0
|
112 |
|
sl@0
|
113 |
CTestActionBuild::~CTestActionBuild()
|
sl@0
|
114 |
{
|
sl@0
|
115 |
delete iUnifiedCertStore;
|
sl@0
|
116 |
delete iCertUtils;
|
sl@0
|
117 |
delete iChain;
|
sl@0
|
118 |
delete iExtraCertsFileName;
|
sl@0
|
119 |
delete iExtraCertsLabel;
|
sl@0
|
120 |
delete iInitCertsFileName;
|
sl@0
|
121 |
delete iInitCertsLabel;
|
sl@0
|
122 |
iAddCalls.ResetAndDestroy();
|
sl@0
|
123 |
iAddCalls.Close();
|
sl@0
|
124 |
delete iValidationResult;
|
sl@0
|
125 |
}
|
sl@0
|
126 |
|
sl@0
|
127 |
CTestActionBuild::CTestActionBuild(RFs& aFs,
|
sl@0
|
128 |
CConsoleBase& aConsole,
|
sl@0
|
129 |
Output& aOut)
|
sl@0
|
130 |
: CTestAction(aConsole, aOut), iFs(aFs)
|
sl@0
|
131 |
{
|
sl@0
|
132 |
}
|
sl@0
|
133 |
|
sl@0
|
134 |
void CTestActionBuild::ConstructL(const TTestActionSpec& aTestActionSpec)
|
sl@0
|
135 |
{
|
sl@0
|
136 |
CTestAction::ConstructL(aTestActionSpec);
|
sl@0
|
137 |
|
sl@0
|
138 |
TInt pos = 0;
|
sl@0
|
139 |
TInt err = KErrNone;
|
sl@0
|
140 |
HBufC* aBody = HBufC::NewLC(aTestActionSpec.iActionBody.Length());
|
sl@0
|
141 |
aBody->Des().Copy(aTestActionSpec.iActionBody);
|
sl@0
|
142 |
TPtrC rootCert(Input::ParseElement(*aBody,
|
sl@0
|
143 |
KRootStart, KRootEnd, pos, err));
|
sl@0
|
144 |
TInt dummyPos = 0;
|
sl@0
|
145 |
iRootCertFileName = Input::ParseElement(rootCert, KCertificateStart,
|
sl@0
|
146 |
KCertificateEnd, dummyPos);
|
sl@0
|
147 |
iRootCertLabel = Input::ParseElement(rootCert, KLabelStart,
|
sl@0
|
148 |
KLabelEnd, dummyPos);
|
sl@0
|
149 |
|
sl@0
|
150 |
iExtraCertsFileName = new(ELeave) CDesCArrayFlat(1);
|
sl@0
|
151 |
iExtraCertsLabel = new(ELeave) CDesCArrayFlat(1);
|
sl@0
|
152 |
while(AddCert(*aBody, KExtraStart, KExtraEnd, pos, *iExtraCertsFileName,
|
sl@0
|
153 |
*iExtraCertsLabel))
|
sl@0
|
154 |
{
|
sl@0
|
155 |
}
|
sl@0
|
156 |
|
sl@0
|
157 |
iInitCertsFileName = new(ELeave) CDesCArrayFlat(1);
|
sl@0
|
158 |
iInitCertsLabel = new(ELeave) CDesCArrayFlat(1);
|
sl@0
|
159 |
while(AddCert(*aBody, KInitStart, KInitEnd, pos, *iInitCertsFileName,
|
sl@0
|
160 |
*iInitCertsLabel))
|
sl@0
|
161 |
{
|
sl@0
|
162 |
}
|
sl@0
|
163 |
|
sl@0
|
164 |
while(AddAddCallsL(*aBody, pos))
|
sl@0
|
165 |
{
|
sl@0
|
166 |
}
|
sl@0
|
167 |
|
sl@0
|
168 |
iValidationResult = CPKIXValidationResult::NewL();
|
sl@0
|
169 |
|
sl@0
|
170 |
TDriveUnit sysDrive (RFs::GetSystemDrive());
|
sl@0
|
171 |
TDriveName driveName(sysDrive.Name());
|
sl@0
|
172 |
iCertPath.Copy(driveName);
|
sl@0
|
173 |
iCertPath.Append(KCertPath);
|
sl@0
|
174 |
|
sl@0
|
175 |
CleanupStack::PopAndDestroy(aBody);
|
sl@0
|
176 |
}
|
sl@0
|
177 |
|
sl@0
|
178 |
void CTestActionBuild::DoPerformPrerequisite(TRequestStatus& aStatus)
|
sl@0
|
179 |
{
|
sl@0
|
180 |
iActionState = EAction;
|
sl@0
|
181 |
TRequestStatus* status = &aStatus;
|
sl@0
|
182 |
User::RequestComplete(status, KErrNone);
|
sl@0
|
183 |
}
|
sl@0
|
184 |
|
sl@0
|
185 |
void CTestActionBuild::DoPerformPostrequisite(TRequestStatus& aStatus)
|
sl@0
|
186 |
{
|
sl@0
|
187 |
TRequestStatus* status = &aStatus;
|
sl@0
|
188 |
User::RequestComplete(status, KErrNone);
|
sl@0
|
189 |
}
|
sl@0
|
190 |
|
sl@0
|
191 |
void CTestActionBuild::PerformAction(TRequestStatus& aStatus)
|
sl@0
|
192 |
{
|
sl@0
|
193 |
switch (iState)
|
sl@0
|
194 |
{
|
sl@0
|
195 |
case EInitCertStoreManager1:
|
sl@0
|
196 |
__ASSERT_DEBUG(!iUnifiedCertStore, User::Panic(_L("CPKIXCertTest"), 1));
|
sl@0
|
197 |
iUnifiedCertStore = CUnifiedCertStore::NewL(iFs, ETrue); // We open the store for writing
|
sl@0
|
198 |
iUnifiedCertStore->Initialize(aStatus);
|
sl@0
|
199 |
iState = ERemoveCertsBeforeTest;
|
sl@0
|
200 |
break;
|
sl@0
|
201 |
|
sl@0
|
202 |
case ERemoveCertsBeforeTest:
|
sl@0
|
203 |
// A new iCertUtils is created and destroyed for each test because
|
sl@0
|
204 |
// we need to close before validating as the chain won't be able to
|
sl@0
|
205 |
// open the store manager if it is already open for write elsewhere
|
sl@0
|
206 |
__ASSERT_DEBUG(!iCertUtils, User::Panic(_L("CPKIXCertTest"), 1));
|
sl@0
|
207 |
iCertUtils = CCertUtils::NewL(iFs);
|
sl@0
|
208 |
iCertUtils->RemoveCertsL(*iUnifiedCertStore, aStatus);
|
sl@0
|
209 |
iState = EAddRoot;
|
sl@0
|
210 |
break;
|
sl@0
|
211 |
|
sl@0
|
212 |
case EAddRoot:
|
sl@0
|
213 |
{
|
sl@0
|
214 |
TUid uid = { 1 };
|
sl@0
|
215 |
TRAPD(err, iCertUtils->RemoveApplicationL(uid));
|
sl@0
|
216 |
iCertUtils->AddApplicationL(_L("testpkix"), uid);
|
sl@0
|
217 |
TUid uid2 = { 2 };
|
sl@0
|
218 |
TRAP(err, iCertUtils->RemoveApplicationL(uid2));
|
sl@0
|
219 |
iCertUtils->AddApplicationL(_L("testpkix"), uid2);
|
sl@0
|
220 |
iCertUtils->AddCert(iRootCertLabel, EX509Certificate, ECACertificate,
|
sl@0
|
221 |
1, iCertPath, iRootCertFileName, *iUnifiedCertStore, aStatus);//1 is trusted for our use
|
sl@0
|
222 |
iState = EAddIntermediateCerts;
|
sl@0
|
223 |
}
|
sl@0
|
224 |
break;
|
sl@0
|
225 |
|
sl@0
|
226 |
case EAddIntermediateCerts:
|
sl@0
|
227 |
iCertUtils->AddCACertsL(*iExtraCertsFileName,
|
sl@0
|
228 |
*iExtraCertsLabel, EX509Certificate,
|
sl@0
|
229 |
2, iCertPath, *iUnifiedCertStore, aStatus); // 2 not trusted for our use
|
sl@0
|
230 |
iState = EDoBuildTestStart;
|
sl@0
|
231 |
break;
|
sl@0
|
232 |
|
sl@0
|
233 |
case EDoBuildTestStart:
|
sl@0
|
234 |
{
|
sl@0
|
235 |
// We have to close the store manager because it is open for write
|
sl@0
|
236 |
// and CPKIXCertChain won't be able to open it if we don't close it
|
sl@0
|
237 |
// iCertUtils muts also be deleted since it uses this store manager
|
sl@0
|
238 |
delete iCertUtils;
|
sl@0
|
239 |
iCertUtils = 0;
|
sl@0
|
240 |
delete iUnifiedCertStore;
|
sl@0
|
241 |
iUnifiedCertStore = 0;
|
sl@0
|
242 |
|
sl@0
|
243 |
__ASSERT_DEBUG(!iChain, User::Panic(_L("CPKIXCertTest"), 1));
|
sl@0
|
244 |
|
sl@0
|
245 |
HBufC8* initCerts =
|
sl@0
|
246 |
InputExtra::ReadFilesLC(*iInitCertsFileName, iCertPath, iFs);
|
sl@0
|
247 |
TUid testUid = TUid::Uid(1);
|
sl@0
|
248 |
iChain = CPKIXCertChain::NewL(iFs, *initCerts, testUid);
|
sl@0
|
249 |
CleanupStack::PopAndDestroy(initCerts); // initCerts
|
sl@0
|
250 |
|
sl@0
|
251 |
TInt addCount = iAddCalls.Count();
|
sl@0
|
252 |
for (TInt i = 0; i < addCount; i++)
|
sl@0
|
253 |
{
|
sl@0
|
254 |
const CAddCall* addCall = iAddCalls[i];
|
sl@0
|
255 |
HBufC8* addCerts = InputExtra::ReadFilesLC(*(addCall->iCertsToAdd),
|
sl@0
|
256 |
iCertPath, iFs);
|
sl@0
|
257 |
// the root of the chain is set when the certificate chain is getting created through the CPKIXCertChainAO
|
sl@0
|
258 |
// via CPKIXChainBuilder. If the chain has the root certificate then the iChainHasRoot is set which is returned
|
sl@0
|
259 |
// through this method. If the corresponding certificate does not have the issuer certificate in the chain then
|
sl@0
|
260 |
// the extra certificates provided in the test script would be added for completing the chain.
|
sl@0
|
261 |
if (!(iChain->ChainHasRoot()))
|
sl@0
|
262 |
{
|
sl@0
|
263 |
iChain->AddCertL(*addCerts);
|
sl@0
|
264 |
}
|
sl@0
|
265 |
CleanupStack::PopAndDestroy(); // addCerts
|
sl@0
|
266 |
}
|
sl@0
|
267 |
|
sl@0
|
268 |
iTime.HomeTime();
|
sl@0
|
269 |
|
sl@0
|
270 |
iChain->ValidateL(*iValidationResult, iTime, aStatus);
|
sl@0
|
271 |
|
sl@0
|
272 |
iState = EDoBuildTestFinished;
|
sl@0
|
273 |
}
|
sl@0
|
274 |
break;
|
sl@0
|
275 |
|
sl@0
|
276 |
case EDoBuildTestFinished:
|
sl@0
|
277 |
{
|
sl@0
|
278 |
iResult = CompareChainsL(*iChain);
|
sl@0
|
279 |
delete iChain;
|
sl@0
|
280 |
iChain = 0;
|
sl@0
|
281 |
iState = EInitCertStoreManager2;
|
sl@0
|
282 |
TRequestStatus* status = &aStatus;
|
sl@0
|
283 |
User::RequestComplete(status, KErrNone);
|
sl@0
|
284 |
}
|
sl@0
|
285 |
break;
|
sl@0
|
286 |
|
sl@0
|
287 |
case EInitCertStoreManager2:
|
sl@0
|
288 |
__ASSERT_DEBUG(!iChain, User::Panic(_L("CPKIXCertTest"), 1));
|
sl@0
|
289 |
//TRAP(err, HandleEDoBuildTests_SingleTest_InitCertStoreManager2L());
|
sl@0
|
290 |
iUnifiedCertStore = CUnifiedCertStore::NewL(iFs, ETrue); // We open the store for writing
|
sl@0
|
291 |
iUnifiedCertStore->Initialize(aStatus);
|
sl@0
|
292 |
iState = ERemoveCertsAfterTest;
|
sl@0
|
293 |
break;
|
sl@0
|
294 |
|
sl@0
|
295 |
case ERemoveCertsAfterTest:
|
sl@0
|
296 |
__ASSERT_DEBUG(!iCertUtils, User::Panic(_L("CPKIXCertTest"), 1));
|
sl@0
|
297 |
iCertUtils = CCertUtils::NewL(iFs);
|
sl@0
|
298 |
iCertUtils->RemoveCertsL(*iUnifiedCertStore, aStatus);
|
sl@0
|
299 |
iState = EEnd;
|
sl@0
|
300 |
break;
|
sl@0
|
301 |
|
sl@0
|
302 |
case EEnd:
|
sl@0
|
303 |
{
|
sl@0
|
304 |
delete iCertUtils;
|
sl@0
|
305 |
iCertUtils = 0;
|
sl@0
|
306 |
delete iUnifiedCertStore;
|
sl@0
|
307 |
iUnifiedCertStore = 0;
|
sl@0
|
308 |
TRequestStatus* status = &aStatus;
|
sl@0
|
309 |
iFinished = ETrue;
|
sl@0
|
310 |
User::RequestComplete(status, KErrNone);
|
sl@0
|
311 |
}
|
sl@0
|
312 |
break;
|
sl@0
|
313 |
}
|
sl@0
|
314 |
}
|
sl@0
|
315 |
|
sl@0
|
316 |
TBool CTestActionBuild::TestResult(TInt /*aError*/)
|
sl@0
|
317 |
{
|
sl@0
|
318 |
return 0;
|
sl@0
|
319 |
}
|
sl@0
|
320 |
|
sl@0
|
321 |
void CTestActionBuild::PerformCancel()
|
sl@0
|
322 |
{
|
sl@0
|
323 |
}
|
sl@0
|
324 |
|
sl@0
|
325 |
void CTestActionBuild::Reset()
|
sl@0
|
326 |
{
|
sl@0
|
327 |
}
|
sl@0
|
328 |
|
sl@0
|
329 |
void CTestActionBuild::DoReportAction()
|
sl@0
|
330 |
{
|
sl@0
|
331 |
iConsole.Printf(_L("u"));
|
sl@0
|
332 |
}
|
sl@0
|
333 |
|
sl@0
|
334 |
void CTestActionBuild::DoCheckResult(TInt /*aError*/)
|
sl@0
|
335 |
{
|
sl@0
|
336 |
}
|
sl@0
|
337 |
|
sl@0
|
338 |
TBool CTestActionBuild::AddCert(const TDesC& aBuf,
|
sl@0
|
339 |
const TDesC& aStart,
|
sl@0
|
340 |
const TDesC& aEnd, TInt& aPos,
|
sl@0
|
341 |
CDesCArray& aCertsFileName,
|
sl@0
|
342 |
CDesCArray& aCertsLabel)
|
sl@0
|
343 |
{
|
sl@0
|
344 |
TPtrC certBuf = Input::ParseElement(aBuf, aStart, aEnd, aPos);
|
sl@0
|
345 |
TInt dummyPos = 0;
|
sl@0
|
346 |
if (certBuf != KNullDesC)
|
sl@0
|
347 |
{
|
sl@0
|
348 |
aCertsFileName.AppendL(Input::ParseElement(certBuf, KCertificateStart,
|
sl@0
|
349 |
KCertificateEnd, dummyPos));
|
sl@0
|
350 |
aCertsLabel.AppendL(Input::ParseElement(certBuf, KLabelStart,
|
sl@0
|
351 |
KLabelEnd, dummyPos));
|
sl@0
|
352 |
return ETrue;
|
sl@0
|
353 |
}
|
sl@0
|
354 |
return EFalse;
|
sl@0
|
355 |
}
|
sl@0
|
356 |
|
sl@0
|
357 |
TBool CTestActionBuild::AddAddCallsL(const TDesC& aBuf, TInt& aPos)
|
sl@0
|
358 |
{
|
sl@0
|
359 |
TPtrC addCallsBuf = Input::ParseElement(aBuf, KAddCallStart, KAddCallEnd, aPos);
|
sl@0
|
360 |
if (addCallsBuf != KNullDesC)
|
sl@0
|
361 |
{
|
sl@0
|
362 |
CAddCall* addCall = CAddCall::NewLC(addCallsBuf);
|
sl@0
|
363 |
iAddCalls.AppendL(addCall);
|
sl@0
|
364 |
CleanupStack::Pop(addCall);
|
sl@0
|
365 |
return ETrue;
|
sl@0
|
366 |
}
|
sl@0
|
367 |
return EFalse;
|
sl@0
|
368 |
}
|
sl@0
|
369 |
|
sl@0
|
370 |
TBool CTestActionBuild::CompareChainsL(const CPKIXCertChain& aChain)
|
sl@0
|
371 |
{
|
sl@0
|
372 |
if (aChain.Count() != 4)
|
sl@0
|
373 |
{
|
sl@0
|
374 |
return EFalse;
|
sl@0
|
375 |
}
|
sl@0
|
376 |
if ( (!CompareCertL(aChain.Cert(0), KEE)) ||
|
sl@0
|
377 |
(!CompareCertL(aChain.Cert(1), KCA1)) ||
|
sl@0
|
378 |
(!CompareCertL(aChain.Cert(2), KCA2)) ||
|
sl@0
|
379 |
(!CompareCertL(aChain.Cert(3), KRoot)) )
|
sl@0
|
380 |
{
|
sl@0
|
381 |
return EFalse;
|
sl@0
|
382 |
}
|
sl@0
|
383 |
else
|
sl@0
|
384 |
{
|
sl@0
|
385 |
return ETrue;
|
sl@0
|
386 |
}
|
sl@0
|
387 |
}
|
sl@0
|
388 |
|
sl@0
|
389 |
TBool CTestActionBuild::CompareCertL(const CX509Certificate& aCert, const TDesC& aFilename)
|
sl@0
|
390 |
{
|
sl@0
|
391 |
HBufC8* correct = Input::ReadFileLC(aFilename, iCertPath, iFs);
|
sl@0
|
392 |
TBool res = (correct->Des() == aCert.Encoding());
|
sl@0
|
393 |
CleanupStack::PopAndDestroy();
|
sl@0
|
394 |
return res;
|
sl@0
|
395 |
}
|
sl@0
|
396 |
|
sl@0
|
397 |
|