networksecurity/tls/ts_tls/T_TLS_cntrl.h
changeset 0 af10295192d8
child 20 7e41d162e158
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2003-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 #ifndef _T_TLS_CNTRL_H
       
    17 #define _T_TLS_CNTRL_H
       
    18 
       
    19 // Accept untrusted certificates without showing a dialog
       
    20 #define NODIALOGS
       
    21 
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <e32cons.h>
       
    25 #include <f32file.h>
       
    26 #include <charconv.h>
       
    27 #include <networking/log.h>
       
    28 #include <networking/teststep.h>
       
    29 
       
    30 #include "T_TLS_test.h"
       
    31 #include "T_Autossl_Const.h"
       
    32 
       
    33 #include <securesocket.h>
       
    34 
       
    35 
       
    36 enum TTestSiteParameters
       
    37 	{
       
    38 	EIPAddress,			// IP address of site (or www.site.com name)
       
    39 	EDNSName,			// DNS name of site (checked against names from certificate)
       
    40 	EPage,				// Page to attempt to retrieve
       
    41 	EIPPort,			// IP port number
       
    42 	EMaxTLSVers,		// Max version of TLS client should support
       
    43 	EMinTLSVers,		// Min version of TLS client should support
       
    44 	ECipher,			// Cipher that *should* be selected by server from range
       
    45 	ECipherSuites,		// The range of cipher suites that can be used
       
    46 	ESimpleGet,			// Use a simple get or full http get request for the page
       
    47 	ETestEndDelay,		// Number of seconds to delay after test has completed
       
    48 	ENumSiteParams		// ###Must be last one, used to calc the size of the array needed###
       
    49 	};
       
    50 
       
    51 _LIT( KSemaphoreName, "T_AUTOSSL" );
       
    52 
       
    53 class CController : public CActive
       
    54 	{
       
    55 private:
       
    56 	enum TControllerStates
       
    57 	{
       
    58 	EReadNextSite,		// Read a new site description from the file
       
    59 	EFindFreeTest,		// Find the first free test object and start it off
       
    60 	EWaitForComplete,	// No more sites to test, wait until all tests have completed
       
    61 	ETestCompleted		// All tests completed
       
    62 	};
       
    63 
       
    64 public:
       
    65 	// Construct/destruct
       
    66 	static CController *NewL();
       
    67 	
       
    68 	~CController();
       
    69 
       
    70 	// Start the controller
       
    71 	void Start( CTestStepTls * aTestStep );
       
    72 	
       
    73 private:
       
    74 	// Construction
       
    75 	CController();	 
       
    76 	void ConstructL();
       
    77 
       
    78 	// Methods from CActive
       
    79 	void RunL();
       
    80 	void DoCancel();
       
    81 
       
    82 	CTestStepTls * iTestStep;
       
    83 	RTimer	iTimer;
       
    84 	TInt	iRunState;
       
    85 	CTLSTest* iTLSTest[ KMaxSSLConnections ];
       
    86 
       
    87 	TBuf<128>	iAddress;
       
    88 	TBuf8<256>	iDNSName;
       
    89 	TInt		iPortNum;
       
    90 	TBuf<128>	iPage;
       
    91 	TBuf8<64>	iCipherSuites;
       
    92 	TInt		iCipher;
       
    93 	TInt		iSimpleGet;
       
    94 	TInt		iTestEndDelay;
       
    95 	TBuf<32>	iProtocol;
       
    96 	TBool		iUseGenericSocket;
       
    97 	TBool		iEAPKeyDerivation;
       
    98 
       
    99 	RSemaphore	iSemaphore;	
       
   100 
       
   101 	};
       
   102 
       
   103 #endif