sl@0
|
1 |
/*
|
sl@0
|
2 |
* Copyright (c) 2005-2009 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 |
* CExtensionTest class implementation
|
sl@0
|
16 |
*
|
sl@0
|
17 |
*/
|
sl@0
|
18 |
|
sl@0
|
19 |
|
sl@0
|
20 |
/**
|
sl@0
|
21 |
@file
|
sl@0
|
22 |
@internalTechnology
|
sl@0
|
23 |
*/
|
sl@0
|
24 |
|
sl@0
|
25 |
#ifndef __EXTENSIONTEST_H
|
sl@0
|
26 |
#define __EXTENSIONTEST_H
|
sl@0
|
27 |
|
sl@0
|
28 |
#include <x509certext.h>
|
sl@0
|
29 |
|
sl@0
|
30 |
#include "t_testaction.h"
|
sl@0
|
31 |
#include "tcertwriter.h"
|
sl@0
|
32 |
|
sl@0
|
33 |
class CExtensionTest : public CTestAction
|
sl@0
|
34 |
{
|
sl@0
|
35 |
public:
|
sl@0
|
36 |
static CTestAction* NewL(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
37 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
38 |
static CTestAction* NewLC(RFs& aFs, CConsoleBase& aConsole,
|
sl@0
|
39 |
Output& aOut, const TTestActionSpec& aTestActionSpec);
|
sl@0
|
40 |
void TestValidation(TRequestStatus& aStatus);
|
sl@0
|
41 |
~CExtensionTest();
|
sl@0
|
42 |
|
sl@0
|
43 |
void PerformAction(TRequestStatus& aStatus);
|
sl@0
|
44 |
void DoReportAction();
|
sl@0
|
45 |
void DoCheckResult(TInt aError);
|
sl@0
|
46 |
|
sl@0
|
47 |
private:
|
sl@0
|
48 |
CExtensionTest(RFs& aFs, CConsoleBase& aConsole, Output& aOut);
|
sl@0
|
49 |
void ConstructL(const TTestActionSpec& aTestActionSpec);
|
sl@0
|
50 |
|
sl@0
|
51 |
// compares arrays of things returning true if they are equal
|
sl@0
|
52 |
TBool IsEqual(const RArray<TInt>& aArray1, const RArray<TInt>& aArray2);
|
sl@0
|
53 |
TBool IsEqual(const RPointerArray<HBufC>& aArray1, const RPointerArray<HBufC>& aArray2);
|
sl@0
|
54 |
|
sl@0
|
55 |
// return true if the extension data matches the expected value
|
sl@0
|
56 |
void CheckExtensionsL(const CX509Certificate& cert, TBool& match, TBool& result);
|
sl@0
|
57 |
TBool CheckDeviceIdListL(const CX509Certificate& cert);
|
sl@0
|
58 |
TBool CheckSidListL(const CX509Certificate& cert);
|
sl@0
|
59 |
TBool CheckVidListL(const CX509Certificate& cert);
|
sl@0
|
60 |
TBool CheckCapabilitiesL(const CX509Certificate& cert);
|
sl@0
|
61 |
|
sl@0
|
62 |
// populate expected value data structures from scritps
|
sl@0
|
63 |
void BuildIntList(RArray<TInt>& aInts, const TDesC& aBuf, const TDesC& aTag);
|
sl@0
|
64 |
void BuildStringListL(RPointerArray<HBufC>& aStrings, const TDesC& aBuf, const TDesC& aTag);
|
sl@0
|
65 |
void BuildCapabilitySet(TCapabilitySet& aCapabilitySet, const TDesC& aBuf);
|
sl@0
|
66 |
|
sl@0
|
67 |
void PrintLine(const TDesC& aText);
|
sl@0
|
68 |
void Print(const TDesC& aText);
|
sl@0
|
69 |
|
sl@0
|
70 |
private:
|
sl@0
|
71 |
RFs& iFs;
|
sl@0
|
72 |
TFileName iCertFileName;
|
sl@0
|
73 |
|
sl@0
|
74 |
// Whether the input data is expeceted to match the certificate extension.
|
sl@0
|
75 |
TBool iExpectedMatch;
|
sl@0
|
76 |
|
sl@0
|
77 |
// Whether the parsing of extension is expected to fail.
|
sl@0
|
78 |
TBool iExpectedCorrupt;
|
sl@0
|
79 |
|
sl@0
|
80 |
// Whether the constraints are expected within the certificate
|
sl@0
|
81 |
TBool iDeviceIdsPresent;
|
sl@0
|
82 |
TBool iSidsPresent;
|
sl@0
|
83 |
TBool iVidsPresent;
|
sl@0
|
84 |
TBool iCapabilitiesPresent;
|
sl@0
|
85 |
|
sl@0
|
86 |
// The expected values associated with the extensions
|
sl@0
|
87 |
RPointerArray<HBufC> iExpectedDeviceIdList;
|
sl@0
|
88 |
RArray<TInt> iExpectedSidList;
|
sl@0
|
89 |
RArray<TInt> iExpectedVidList;
|
sl@0
|
90 |
TCapabilitySet iExpectedCapabilities;
|
sl@0
|
91 |
};
|
sl@0
|
92 |
|
sl@0
|
93 |
#endif
|