Update contrib.
2 * Copyright (c) 1998-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of the License "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #include "tactiondecodepkcs5.h"
26 _LIT8(KInputStart, "<input>");
29 CTestAction* CActionDecodePKCS5::NewL(RFs& aFs,
30 CConsoleBase& aConsole,
32 const TTestActionSpec& aTestActionSpec)
34 CActionDecodePKCS5* self = new(ELeave) CActionDecodePKCS5(aFs, aConsole, aOut);
35 CleanupStack::PushL(self);
36 self->ConstructL(aTestActionSpec);
41 CActionDecodePKCS5::~CActionDecodePKCS5()
47 CActionDecodePKCS5::CActionDecodePKCS5(RFs& aFs,
48 CConsoleBase& aConsole,
51 : CTestAction(aConsole, aOut), iFs(aFs)
55 void CActionDecodePKCS5::ConstructL(const TTestActionSpec& aTestActionSpec)
57 CTestAction::ConstructL(aTestActionSpec);
59 iInput = Input::ParseElementHexL(aTestActionSpec.iActionBody, KInputStart);
60 iOutput = HBufC8::NewL(iInput->Length()+100); //so we detect errors in
61 //encoding not panics in descriptors
64 void CActionDecodePKCS5::DoReportAction(void)
68 void CActionDecodePKCS5::DoCheckResult(TInt)
72 void CActionDecodePKCS5::PerformAction(TRequestStatus& aStatus)
74 TRequestStatus* status = &aStatus;
77 CPBEncryptParms* parms = TASN1DecPKCS5::DecodeDERL(*iInput);
78 CleanupStack::PushL(parms);
79 CASN1EncSequence* seq = TASN1EncPKCS5::EncodeDERL(*parms);
80 CleanupStack::PushL(seq);
82 iOutput->Des().SetLength(seq->LengthDER());
84 TPtr8 iOutputTemp = iOutput->Des();
85 seq->WriteDERL(iOutputTemp, length);
87 if(*iOutput == *iInput)
92 CleanupStack::PopAndDestroy(2); //seq, parms
93 User::RequestComplete(status, KErrNone);
94 iActionState = CTestAction::EPostrequisite;