vpnengine/ikev2lib/inc/ikev2proposal.h
changeset 0 33413c0669b9
equal deleted inserted replaced
-1:000000000000 0:33413c0669b9
       
     1 /*
       
     2 * Copyright (c) 2003-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 "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: IKEv2 Proposal handling.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __IKEV2PROPOSAL_H_
       
    20 #define __IKEV2PROPOSAL_H_
       
    21 #include <e32base.h>
       
    22 #include "ikepolparser.h"
       
    23 #include "ikemsgheader.h"
       
    24 
       
    25 class CIkev2Payloads;
       
    26 class TPayloadIkev2;
       
    27 class TProposalIkev2;
       
    28 class TTransformIkev2;
       
    29 class CIkeV2Identity;
       
    30 class TIkev2SAData;
       
    31 class TIkeV2IpsecSAData;
       
    32 
       
    33 class Ikev2Proposal
       
    34 {
       
    35 public:
       
    36 	static HBufC8* FromPolicyToProposaL(TIkev2SAData& aIkeSaData, 
       
    37                                         const TDesC8& aRekeySpi, 
       
    38                                         TInt aDHGroupGuess, 
       
    39                                         TBool aRekey=EFalse);	
       
    40 	static HBufC8* BuildSaResponseL(TProposalIkev2* aAcceptedProp, CIkev2Payloads* aAcceptedTrans);
       
    41 	static TBool GetSelectedProposalData(TIkev2SAData& aIkev2SaData,
       
    42                                          TIkeV2IpsecSAData& aChildSaData, 
       
    43                                          const CIkev2Payloads& aAcceptedProp, 
       
    44                                          const TProposalIkev2& aProp);	
       
    45 	static TBool VerifySaResponseL(TIkev2SAData& aIkeSaData, 
       
    46                                    TIkeV2IpsecSAData& aIpsecSaData, 
       
    47                                    const TDesC8& aReferenceSaData, 
       
    48                                    const CIkev2Payloads& aRespProp);
       
    49 	static TBool VerifySaRequestAndGetProposedSaBufferL(TIkev2SAData& aIkeSaData, 
       
    50                                                         TIkeV2IpsecSAData& aIpsecSaData,
       
    51                                                         const TDesC8& aReferenceSaData, 
       
    52                                                         const CIkev2Payloads& aProposed,
       
    53                                                         HBufC8*& aProposedSaBuffer);
       
    54 	static TBool VerifyProposaL(CIkev2Payloads* aReference, TProposalIkev2* aProposal, TIkev2SAData& aIkev2SaData);
       
    55 	static TBool CompareTransforms(CArrayFixFlat<TTransformIkev2*>* aRefTrans,
       
    56 								   CArrayFixFlat<TTransformIkev2*>* aTrans);  
       
    57 	static HBufC8* GetPSKFromPolicyL(CIkeData* aHostData);
       
    58 	static TBool IkeSaRekey(CIkev2Payloads* aIkeMsg);
       
    59 	static TBool GetRekeySpi(CIkev2Payloads* aIkeMsg, TIkeSPI& aSPI);
       
    60 	static void ChangeSpiInProposal(HBufC8* aSaBfr, TIkeSPI& aSPI);	
       
    61 	static TUint16 GetDHGroup(TInt aDHGroup);
       
    62 	static CIkeV2Identity* GetRemoteIdentityL(CIkeData* aHostData);	
       
    63 
       
    64 	static inline TBool PkiServiceNeeded(CIkeData* aHostData)
       
    65 	{
       
    66 	    ASSERT(aHostData); 
       
    67 	    if ( aHostData->iCAList && aHostData->iCAList->Count() )
       
    68 		    return ETrue;  
       
    69         else return EFalse;
       
    70 	}
       
    71 };
       
    72 	
       
    73 #endif