networksecurity/tlsprovider/Test/ttlsoom/tlsoomauthstep.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 /**
       
    17  @file
       
    18 */
       
    19 
       
    20 #include "tlsoomauthstep.h"
       
    21 
       
    22 CTlsOOMAuthStep* CTlsOOMAuthStep::NewL(const TDesC& aConfigPath, CTestExecuteLogger& aLogger)
       
    23 	{
       
    24 	
       
    25 	CTlsOOMAuthStep* result = new (ELeave) CTlsOOMAuthStep(aConfigPath, aLogger);
       
    26 	return result;
       
    27 	
       
    28 	}
       
    29 	
       
    30 CTlsOOMAuthStep::CTlsOOMAuthStep(const TDesC& aConfigPath, CTestExecuteLogger& aLogger)
       
    31 	: CTlsOOMStepBase(aLogger, aConfigPath)
       
    32 	{
       
    33 	}
       
    34 	
       
    35 void CTlsOOMAuthStep::DoTestStepL()
       
    36 	{
       
    37 	
       
    38 	CTLSProvider* tlsProvider = NULL;
       
    39 	CTLSSession* tlsSession = NULL;
       
    40 	CTlsCryptoAttributes* tlsAttributes = NULL;
       
    41 	HBufC8* serverCert = NULL;
       
    42 	
       
    43 	InitTlsProviderLC(tlsProvider, tlsAttributes, serverCert);
       
    44 	
       
    45 	
       
    46 	TTLSCipherSuite cipherSuite;
       
    47 	cipherSuite.iHiByte = 0;
       
    48 	cipherSuite.iLoByte = 3;
       
    49 	
       
    50 	// Use client authentication to get maximum coverage
       
    51 	
       
    52 	tlsAttributes->iClientAuthenticate = ETrue;
       
    53 	tlsAttributes->iDialogNonAttendedMode = ETrue;
       
    54 	tlsAttributes->iCurrentCipherSuite = cipherSuite;
       
    55 	tlsAttributes->iNegotiatedProtocol = KTLS1_0;
       
    56 	
       
    57 	iStatus = KRequestPending;
       
    58 	tlsProvider->CreateL(tlsSession, iStatus);
       
    59 	CleanupStack::PushL(tlsSession);
       
    60 	SetActive();
       
    61 	CActiveScheduler::Start();
       
    62 	
       
    63 	CleanupStack::PopAndDestroy(3, tlsProvider); // serverCert, tlsSession
       
    64 	
       
    65 	}
       
    66