cryptoservices/certificateandkeymgmt/tpkcs10/tpkcs10negatives.cpp
author Santosh Patil <santosh.v.patil@nokia.com>
Wed, 08 Jul 2009 11:25:26 +0100
changeset 0 2c201484c85f
child 8 35751d3474b7
permissions -rw-r--r--
Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     1
/*
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     8
*
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
     9
* Initial Contributors:
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    11
*
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    12
* Contributors:
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    13
*
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    14
* Description: 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    15
* Implementation of negative step classes for PKCS#10 tests.
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    16
*
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    17
*/
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    18
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    19
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    20
#include "tpkcs10negatives.h"
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    21
#include <x500dn.h>
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    22
#include <unifiedkeystore.h>
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    23
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    24
// Key label
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    25
_LIT(KKeyLabel, "new pkcs10 neg test key"); 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    26
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    27
// Panics
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    28
_LIT(KPanicNegativeTests, "PKCS10NegativeTests");
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    29
TInt EPanicNegInvalidTestData = 1;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    30
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    31
// String of 256 characters
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    32
_LIT8(KHugeString, "p000000001p000000002p000000003p000000004p000000005p000000006p000000007"
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    33
				   "p000000008p000000009p000000010p000000011p000000012p000000013p000000014"
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    34
				   "p000000015p000000016p000000017p000000018p000000019p000000020p000000021"
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    35
				   "p000000022p000000023p000000024p000000025p23456");
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    36
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    37
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    38
CPKCS10NegTesterActive::CPKCS10NegTesterActive(CTestExecuteLogger& aLogger) : 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    39
	CActive(EPriorityStandard),
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    40
	iLogger(aLogger),
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    41
	iKeyImportStarted(EFalse)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    42
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    43
	CActiveScheduler::Add(this);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    44
	User::LeaveIfError(iFs.Connect());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    45
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    46
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    47
CPKCS10NegTesterActive::~CPKCS10NegTesterActive()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    48
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    49
	Cancel();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    50
	delete iKeyData;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    51
	if (iKeyInfo)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    52
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    53
		iKeyInfo->Release();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    54
 		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    55
 	delete iKeyStore;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    56
	iFs.Close();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    57
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    58
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    59
CCTKeyInfo* CPKCS10NegTesterActive::doImportKeyL(CCertificateRequestStep *aStep)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    60
{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    61
	INFO_PRINTF1(_L("Active object tester for Key Import"));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    62
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    63
	iStep = aStep;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    64
	// Initialise Key store
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    65
  	iKeyStore = CUnifiedKeyStore::NewL(iFs);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    66
	iKeyStore->Initialize(iStatus);  
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    67
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    68
	SetActive();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    69
   	CActiveScheduler::Start();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    70
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    71
	User::LeaveIfError(iStatus.Int());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    72
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    73
	return iKeyInfo;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    74
}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    75
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    76
void CPKCS10NegTesterActive::RunL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    77
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    78
	iError = iStatus.Int();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    79
	if (iError != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    80
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    81
		CActiveScheduler::Stop();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    82
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    83
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    84
	if (iKeyImportStarted == EFalse) 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    85
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    86
  		INFO_PRINTF1(_L("Importing keys"));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    87
		TFileName filename;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    88
		filename = iStep->iPrivateKey;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    89
		RFile file;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    90
		User::LeaveIfError(file.Open(iFs, filename, EFileRead));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    91
		CleanupClosePushL(file);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    92
		TInt size;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    93
		User::LeaveIfError(file.Size(size));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    94
		iKeyData = HBufC8::NewMaxL(size);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    95
		TPtr8 keyPtr = iKeyData->Des();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    96
		User::LeaveIfError(file.Read(keyPtr));			
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    97
		CleanupStack::PopAndDestroy(); // file
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    98
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
    99
		TTime start(0.0); 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   100
		TTime end(0.0); 
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   101
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   102
		// Assumes only one keystore
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   103
	 	ASSERT(iKeyInfo == NULL);      
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   104
		iKeyStore->ImportKey(0, *iKeyData, EPKCS15UsageSign, KKeyLabel,0, start, end, iKeyInfo, iStatus);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   105
  		iKeyImportStarted = ETrue;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   106
  		SetActive();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   107
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   108
	else
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   109
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   110
		// Key import done
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   111
		CActiveScheduler::Stop();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   112
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   113
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   114
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   115
TInt CPKCS10NegTesterActive::RunError(TInt aError)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   116
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   117
	iError = aError;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   118
	CActiveScheduler::Stop();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   119
	return KErrNone;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   120
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   121
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   122
TVerdict CPKCS10NegPKCS10GenericAttr::doTestStepL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   123
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   124
	// Set it to pass initially
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   125
	SetTestStepResult(EPass);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   126
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   127
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   128
	// Test for invalid attribute for NewL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   129
 	TInt numAttr = iArrayGenAttrOID.Count();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   130
 	__ASSERT_ALWAYS((numAttr > 0), User::Panic(KPanicNegativeTests, EPanicNegInvalidTestData));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   131
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   132
	HBufC8 *string = HBufC8::NewMaxLC(iArrayGenAttrValue[0].Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   133
	string->Des().Copy(iArrayGenAttrValue[0]);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   134
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   135
	CASN1EncOctetString* attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   136
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   137
	CPKCS10Attribute *genericAttr = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   138
	TRAPD(err, genericAttr = CPKCS10Attribute::NewL(iArrayGenAttrOID[0], attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   139
	CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   140
	CleanupStack::PopAndDestroy(string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   141
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   142
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   143
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   144
		delete attrString;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   145
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   146
	else
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   147
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   148
		delete genericAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   149
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   150
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   151
	if (err != KErrBadDescriptor)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   152
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   153
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   154
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   155
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   156
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   157
	// Test for NULL value for NewL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   158
 	__ASSERT_ALWAYS((numAttr > 1), User::Panic(KPanicNegativeTests, EPanicNegInvalidTestData));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   159
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   160
	string = HBufC8::NewMaxLC(iArrayGenAttrValue[1].Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   161
	string->Des().Copy(iArrayGenAttrValue[1]);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   162
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   163
	if (*string == KNullDesC8)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   164
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   165
		attrString = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   166
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   167
	else
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   168
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   169
		attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   170
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   171
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   172
	TRAP(err, genericAttr = CPKCS10Attribute::NewL(iArrayGenAttrOID[1], attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   173
	if (attrString != NULL)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   174
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   175
		CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   176
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   177
	CleanupStack::PopAndDestroy(string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   178
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   179
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   180
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   181
		delete attrString;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   182
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   183
	else
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   184
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   185
		delete genericAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   186
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   187
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   188
	if (err != 	KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   189
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   190
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   191
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   192
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   193
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   194
	// Test for NULL value for AddValueL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   195
 	__ASSERT_ALWAYS((numAttr > 2), User::Panic(KPanicNegativeTests, EPanicNegInvalidTestData));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   196
	string = HBufC8::NewMaxLC(iArrayGenAttrValue[2].Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   197
	string->Des().Copy(iArrayGenAttrValue[2]);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   198
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   199
	attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   200
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   201
	TRAP(err, genericAttr = CPKCS10Attribute::NewL(iArrayGenAttrOID[2], attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   202
	CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   203
	CleanupStack::PopAndDestroy(string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   204
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   205
	// Should not be an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   206
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   207
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   208
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   209
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   210
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   211
	// Try to add a NULL value
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   212
	TRAP(err, genericAttr->AddValueL(NULL));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   213
	delete genericAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   214
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   215
	// Should return an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   216
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   217
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   218
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   219
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   220
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   221
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   222
	// Test for invalid attribute for ResetL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   223
	string = HBufC8::NewMaxLC(iArrayGenAttrValue[2].Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   224
	string->Des().Copy(iArrayGenAttrValue[2]);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   225
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   226
	attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   227
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   228
	TRAP(err, genericAttr = CPKCS10Attribute::NewL(iArrayGenAttrOID[2], attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   229
	CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   230
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   231
	// Should not be an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   232
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   233
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   234
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   235
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   236
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   237
	// Try to reset with an invalid attribute OID
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   238
	attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   239
	TRAP(err, genericAttr->ResetL(KNullDesC, attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   240
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   241
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   242
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   243
		delete attrString;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   244
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   245
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   246
	CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   247
	CleanupStack::PopAndDestroy(string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   248
	delete genericAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   249
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   250
	// Should return an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   251
	if (err != 	KErrBadDescriptor)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   252
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   253
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   254
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   255
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   256
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   257
	// Test for NULL value for ResetL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   258
	string = HBufC8::NewMaxLC(iArrayGenAttrValue[2].Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   259
	string->Des().Copy(iArrayGenAttrValue[2]);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   260
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   261
	attrString = CASN1EncOctetString::NewLC(*string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   262
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   263
	TRAP(err, genericAttr = CPKCS10Attribute::NewL(iArrayGenAttrOID[2], attrString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   264
	CleanupStack::Pop(attrString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   265
	CleanupStack::PopAndDestroy(string);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   266
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   267
	// Should not be an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   268
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   269
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   270
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   271
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   272
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   273
	// Try to reset with a NULL value
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   274
	TRAP(err, genericAttr->ResetL(iArrayGenAttrOID[2], NULL));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   275
	delete genericAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   276
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   277
	// Should return an error
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   278
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   279
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   280
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   281
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   282
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   283
	return TestStepResult();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   284
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   285
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   286
TVerdict CPKCS10NegPKCS9ChallengePasswordAttr::doTestStepL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   287
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   288
	// Set it to pass initially
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   289
	SetTestStepResult(EPass);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   290
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   291
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   292
	// Test for empty password for NewL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   293
	HBufC8 *passwordString = HBufC8::NewMaxLC(iChallengePassword.Length());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   294
	passwordString->Des().Copy(iChallengePassword);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   295
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   296
	CPKCS9ChallengePasswordAttr *chPasswordAttr = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   297
	TRAPD(err, chPasswordAttr = CPKCS9ChallengePasswordAttr::NewL(*passwordString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   298
	CleanupStack::PopAndDestroy(passwordString);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   299
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   300
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   301
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   302
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   303
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   304
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   305
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   306
	// Test for big password for ResetL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   307
	TRAP(err, chPasswordAttr = CPKCS9ChallengePasswordAttr::NewL(_L8("password")));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   308
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   309
	// Should not fail
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   310
	if (err != KErrNone)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   311
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   312
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   313
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   314
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   315
	TRAP(err, chPasswordAttr->ResetL(KHugeString));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   316
	delete chPasswordAttr;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   317
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   318
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   319
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   320
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   321
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   322
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   323
	return TestStepResult();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   324
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   325
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   326
TVerdict CPKCS10NegPKCS9ExtensionRequestAttr::doTestStepL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   327
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   328
	// Set it to pass initially
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   329
	SetTestStepResult(EPass);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   330
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   331
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   332
	// Test for empty attribute OID for NewL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   333
 	TInt numAttr = iArrayV3AttrOID.Count();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   334
 	__ASSERT_ALWAYS((numAttr > 0), User::Panic(KPanicNegativeTests, EPanicNegInvalidTestData));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   335
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   336
	CX509CertExtension* x509CertExtn = CX509CertExtension::NewL(iArrayV3AttrOID[0], iArrayV3AttrCritical[0], _L8("value"));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   337
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   338
	CPKCS9ExtensionRequestAttr *chExtReqAttr = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   339
	TRAPD(err, chExtReqAttr = CPKCS9ExtensionRequestAttr::NewL(*x509CertExtn));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   340
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   341
	delete x509CertExtn;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   342
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   343
	if (err != KErrBadDescriptor)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   344
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   345
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   346
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   347
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   348
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   349
	// Test for empty attribute OID for AddExtensionL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   350
 	__ASSERT_ALWAYS((numAttr > 1), User::Panic(KPanicNegativeTests, EPanicNegInvalidTestData));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   351
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   352
	x509CertExtn = CX509CertExtension::NewLC(iArrayV3AttrOID[1], iArrayV3AttrCritical[1], _L8("value"));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   353
	chExtReqAttr = CPKCS9ExtensionRequestAttr::NewLC(*x509CertExtn);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   354
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   355
	CX509CertExtension *x509CertExtnNew = CX509CertExtension::NewLC(iArrayV3AttrOID[0], iArrayV3AttrCritical[0], _L8("value"));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   356
	TRAP(err, chExtReqAttr->AddExtensionL(*x509CertExtnNew));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   357
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   358
	CleanupStack::PopAndDestroy(3, x509CertExtn);	// chExtReqAttr, x509CertExtnNew
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   359
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   360
	if (err != KErrBadDescriptor)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   361
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   362
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   363
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   364
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   365
	return TestStepResult();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   366
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   367
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   368
TVerdict CPKCS10NegPKCS10Attributes::doTestStepL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   369
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   370
	// Set it to pass initially
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   371
	SetTestStepResult(EPass);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   372
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   373
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   374
	// Test for NULL attribute for AddPKCSAttributeL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   375
	CPKCS10Attributes *attrList = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   376
	attrList = CPKCS10Attributes::NewLC();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   377
	TRAPD(err, attrList->AddPKCSAttributeL(NULL));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   378
	CleanupStack::PopAndDestroy(attrList);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   379
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   380
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   381
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   382
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   383
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   384
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   385
	return TestStepResult();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   386
	}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   387
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   388
TVerdict CPKCS10NegPKCS10Request::doTestStepL()
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   389
	{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   390
	// Set it to pass initially
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   391
	SetTestStepResult(EPass);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   392
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   393
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   394
	// Test for invalid DN for NewL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   395
	CActiveScheduler* sch = new(ELeave) CActiveScheduler;   
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   396
	CActiveScheduler::Install(sch);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   397
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   398
	// Import the key
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   399
	CPKCS10NegTesterActive* activeObj = new (ELeave) CPKCS10NegTesterActive(Logger());
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   400
	CCTKeyInfo *keyInfo = activeObj->doImportKeyL(this);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   401
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   402
	// Try to generate a cert req
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   403
	CX500DistinguishedName* dn = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   404
	CPKCS10Request* req = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   405
	TRAPD(err, req = CPKCS10Request::NewL(*dn, *keyInfo));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   406
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   407
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   408
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   409
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   410
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   411
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   412
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   413
	// Test for EDH for SetDigestAlgL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   414
    CArrayPtrFlat<CX520AttributeTypeAndValue>* array = new(ELeave) CArrayPtrFlat<CX520AttributeTypeAndValue>(7);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   415
	CleanupStack::PushL(array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   416
	dn = CX500DistinguishedName::NewL(*array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   417
	CleanupStack::PushL(dn);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   418
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   419
	req = CPKCS10Request::NewL(*dn, *keyInfo);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   420
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   421
	TRAP(err, req->SetDigestAlgL(EDH));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   422
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   423
	delete req;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   424
	array->ResetAndDestroy();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   425
	CleanupStack::PopAndDestroy(2, array); //array, dn
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   426
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   427
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   428
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   429
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   430
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   431
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   432
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   433
	// Test for NULL DN for SetDistinguishedNameL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   434
    array = new(ELeave) CArrayPtrFlat<CX520AttributeTypeAndValue>(7);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   435
	CleanupStack::PushL(array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   436
	dn = CX500DistinguishedName::NewL(*array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   437
	CleanupStack::PushL(dn);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   438
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   439
	req = CPKCS10Request::NewL(*dn, *keyInfo);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   440
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   441
	CX500DistinguishedName* nullDN = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   442
	TRAP(err, req->SetDistinguishedNameL(*nullDN));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   443
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   444
	delete req;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   445
	array->ResetAndDestroy();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   446
	CleanupStack::PopAndDestroy(2, array); //array, dn
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   447
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   448
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   449
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   450
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   451
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   452
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   453
	//////////////////////////////////////////////////////////////////////////////
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   454
	// Test for NULL for SetKeyInfoL
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   455
    array = new(ELeave) CArrayPtrFlat<CX520AttributeTypeAndValue>(7);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   456
	CleanupStack::PushL(array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   457
	dn = CX500DistinguishedName::NewL(*array);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   458
	CleanupStack::PushL(dn);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   459
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   460
	req = CPKCS10Request::NewL(*dn, *keyInfo);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   461
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   462
	CCTKeyInfo* nullKeyInfo = NULL;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   463
	TRAP(err, req->SetKeyInfoL(*nullKeyInfo));
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   464
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   465
	delete req;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   466
	array->ResetAndDestroy();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   467
	CleanupStack::PopAndDestroy(2, array); //array, dn
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   468
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   469
	if (err != KErrArgument)
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   470
		{
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   471
		SetTestStepResult(EFail);
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   472
		}
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   473
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   474
	delete activeObj;		// Will release keyInfo
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   475
	delete sch;
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   476
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   477
	return TestStepResult();
2c201484c85f Move the Security package to EPL, and add the implementations of the cryptographic algorithms
Santosh Patil <santosh.v.patil@nokia.com>
parents:
diff changeset
   478
	}