os/security/cryptoservices/certificateandkeymgmt/tpkixcert_tef/src/datetimefatalteststep.cpp
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
     1 /*
     2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *
    16 */
    17 
    18 
    19 #include "datetimefatalteststep.h"
    20 
    21 	
    22 CDateTimeFatalValidateStep::CDateTimeFatalValidateStep()
    23 	{
    24 	SetTestStepName(KDateTimeFatalTestStep);
    25 	}
    26 
    27 TVerdict CDateTimeFatalValidateStep::doTestStepPreambleL()
    28 	{
    29 	CValidateCertChainStep::doTestStepPreambleL();
    30 	
    31 	TPtrC dateAndTime;
    32 	GetStringFromConfig(ConfigSection(), KDateTime, dateAndTime);
    33 	
    34 	iDateTime = TTime(dateAndTime);
    35 	return EPass;
    36 	}
    37 
    38 void CDateTimeFatalValidateStep::PerformTestL()
    39 	{
    40 	CPkixCertStepBase::PerformTestL();
    41 	
    42 	iCertChain->SetSupportedCriticalExtensionsL(iProcessedOids);
    43 	
    44 	ValidateL(iDateTime, ConfigSection());
    45 		
    46 	iCertChain->SetValidityPeriodCheckFatal(EFalse);
    47 	
    48 	HBufC* secondConfigSection = HBufC::NewLC(ConfigSection().Length() + KSecondConfigSection().Length());
    49 	TPtr ptr = secondConfigSection->Des();
    50 	
    51 	ptr.Append(ConfigSection());
    52 	ptr.Append(KSecondConfigSection);
    53 	
    54 	ValidateL(iDateTime, ptr);
    55 	
    56 	CleanupStack::PopAndDestroy(secondConfigSection);
    57 		
    58 	iCertChain->SetValidityPeriodCheckFatal(ETrue);	
    59 	
    60 	ValidateL(iDateTime, ConfigSection());	
    61 	
    62 	CleanupStack::PopAndDestroy(iCertChain);
    63 	}
    64 
    65 
    66 
    67 
    68