CTlsSessionImpl Class Reference

class CTlsSessionImpl : public CActive

Inherits from

Public Member Functions
~CTlsSessionImpl()
CTlsCryptoAttributes *Attributes()
voidCancelRequest()
voidCertificateVerifySignatureL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TRequestStatus &)
voidClientCertificate(HBufC8 *&, TRequestStatus &)
voidClientCertificate(CX509Certificate *&, TRequestStatus &)
voidClientCertificate(RPointerArray< HBufC8 > *, TRequestStatus &)
voidClientFinishedMsgL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TRequestStatus &)
voidClientKeyExchange(HBufC8 *&, TRequestStatus &)
voidConstructL(CTlsCryptoAttributes *, HBufC8 *, TRequestStatus &)
voidConstructResumedL(CTlsCryptoAttributes *, TRequestStatus &)
TInt DecryptAndVerifyL(const TDesC8 &, HBufC8 *&, TInt64 &, TRecordProtocol &)
TInt EncryptL(const TDesC8 &, HBufC8 *&, TInt64 &, TRecordProtocol &)
TInt KeyDerivation(const TDesC8 &, const TTLSMasterSecretInput &, TDes8 &)
CTlsSessionImpl *NewL(MTLSSession *, CCTCertInfo *, CCTKeyInfo *, RPointerArray< CCertificate > *)
voidServerCertificate(CX509Certificate *&, TRequestStatus &)
voidVerifyServerFinishedMsgL(CMessageDigest *, CMessageDigest *, const TDesC8 &, TRequestStatus &)
Private Member Functions
CTlsSessionImpl()
voidBuildClientIntermediateCertChainL(RPointerArray< CCertificate > &, const CX509Certificate *)
voidDoCancel()
voidGenerateFinishedMessageL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TBool)
voidGenerateKeysL()
voidGetX509CertL(HBufC8 *&, CX509Certificate *&)
TBool MatchRequestedIssuerDN(const CCertificate *)
TInt RunError(TInt)
voidRunL()
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Member Enumerations
enumTStateLists {
ENullState, EConstruct, EGetClientCerificate, EGetClientKeyExchange, EGetServerCertificate, EKeyGeneration, EClientFinishedMsg, EVerifyServerFinishedMsg, EComputeDigitalSignature, EConnectionEstablished, EGetClientCerificateX509, ECertificateVerifyMsg, EReturnCert, EGetClientCertificateArray
}
Inherited Enumerations
CActive:TPriority
Private Attributes
TBool iAbbrievatedHandshake
HBufC8 *iActualFinishedMsg
TInt iAttribute
TTLSCipherSuite iCipherSuiteId
RPointerArray< HBufC8 > *iClientCertArray
CX509Certificate **iClientCertX509
HBufC8 **iClientKeyExch
HBufC8 **iComputeDigitalSig
TBool iConstructionComplete
TStateLists iCurrentState
HBufC8 *iEncodedClientCert
HBufC8 **iEncodedClientCertHldrPtr
HBufC8 *iEncodedServerCerts
CTlsEncrypt *iEncrypt
RFs iFs
HBufC8 *iKeyMaterial
TTLSMasterSecretInput iMasterSecretInput
TStateLists iNextState
TRequestStatus *iOriginalRequestStatus
TStateLists iOriginalState
TTLSProtocolVersion iProtocolVersion
CUnifiedCertStore *iPtrUnifiedCertStore
CCTCertInfo *iSelectedCertInfo
CCTKeyInfo *iSelectedKeyInfo
HBufC8 *iServerCert_rv
HBufC8 *iServerFinished
TInt iServerMsgVerified
MTLSSession *iSessionInterface
RPointerArray< CCertificate > *iStoredIntermediatesCACertificates
HBufC8 *iTempHolder
TPtr8 iTempPtr
CTlsCryptoAttributes *iTlsCryptoAttributes
CX509Certificate **iX509ServerCert
Inherited Attributes
CActive::iStatus

Constructor & Destructor Documentation

CTlsSessionImpl()

CTlsSessionImpl()[private]

~CTlsSessionImpl()

~CTlsSessionImpl()

Member Functions Documentation

Attributes()

CTlsCryptoAttributes *Attributes()

BuildClientIntermediateCertChainL(RPointerArray< CCertificate > &, const CX509Certificate *)

voidBuildClientIntermediateCertChainL(RPointerArray< CCertificate > &aCertChain,
const CX509Certificate *aClientCert
)const [private]

Parameters

RPointerArray< CCertificate > & aCertChain
const CX509Certificate * aClientCert

CancelRequest()

voidCancelRequest()

CertificateVerifySignatureL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TRequestStatus &)

voidCertificateVerifySignatureL(CMessageDigest *aMd5DigestInput,
CMessageDigest *aShaDigestInput,
HBufC8 *&aOutput,
TRequestStatus &aStatus
)

Parameters

CMessageDigest * aMd5DigestInput
CMessageDigest * aShaDigestInput
HBufC8 *& aOutput
TRequestStatus & aStatus

ClientCertificate(HBufC8 *&, TRequestStatus &)

voidClientCertificate(HBufC8 *&aEncodedClientCert,
TRequestStatus &aStatus
)

Parameters

HBufC8 *& aEncodedClientCert
TRequestStatus & aStatus

ClientCertificate(CX509Certificate *&, TRequestStatus &)

voidClientCertificate(CX509Certificate *&aX509ClientCert,
TRequestStatus &aStatus
)

Parameters

CX509Certificate *& aX509ClientCert
TRequestStatus & aStatus

ClientCertificate(RPointerArray< HBufC8 > *, TRequestStatus &)

voidClientCertificate(RPointerArray< HBufC8 > *aClientCertArray,
TRequestStatus &aStatus
)

Parameters

RPointerArray< HBufC8 > * aClientCertArray
TRequestStatus & aStatus

ClientFinishedMsgL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TRequestStatus &)

voidClientFinishedMsgL(CMessageDigest *aMd5DigestInput,
CMessageDigest *aShaDigestInput,
HBufC8 *&aOutput,
TRequestStatus &aStatus
)

Parameters

CMessageDigest * aMd5DigestInput
CMessageDigest * aShaDigestInput
HBufC8 *& aOutput
TRequestStatus & aStatus

ClientKeyExchange(HBufC8 *&, TRequestStatus &)

voidClientKeyExchange(HBufC8 *&aClientKeyExch,
TRequestStatus &aStatus
)

Parameters

HBufC8 *& aClientKeyExch
TRequestStatus & aStatus

ConstructL(CTlsCryptoAttributes *, HBufC8 *, TRequestStatus &)

voidConstructL(CTlsCryptoAttributes *aTlsCryptoAttributes,
HBufC8 *aEncodedServerCerts,
TRequestStatus &aStatus
)

Parameters

CTlsCryptoAttributes * aTlsCryptoAttributes
HBufC8 * aEncodedServerCerts
TRequestStatus & aStatus

ConstructResumedL(CTlsCryptoAttributes *, TRequestStatus &)

voidConstructResumedL(CTlsCryptoAttributes *aTlsCryptoAttributes,
TRequestStatus &aStatus
)

Parameters

CTlsCryptoAttributes * aTlsCryptoAttributes
TRequestStatus & aStatus

DecryptAndVerifyL(const TDesC8 &, HBufC8 *&, TInt64 &, TRecordProtocol &)

TInt DecryptAndVerifyL(const TDesC8 &aInput,
HBufC8 *&aOutput,
TInt64 &aSeqNumber,
TRecordProtocol &aType
)

Parameters

const TDesC8 & aInput
HBufC8 *& aOutput
TInt64 & aSeqNumber
TRecordProtocol & aType

DoCancel()

voidDoCancel()[private, virtual]

Implements cancellation of an outstanding request.

This function is called as part of the active object's Cancel().

It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.

DoCancel() must not wait for event completion; this is handled by Cancel().

CActive::Cancel

EncryptL(const TDesC8 &, HBufC8 *&, TInt64 &, TRecordProtocol &)

TInt EncryptL(const TDesC8 &aInput,
HBufC8 *&aOutput,
TInt64 &aSeqNumber,
TRecordProtocol &aType
)

Parameters

const TDesC8 & aInput
HBufC8 *& aOutput
TInt64 & aSeqNumber
TRecordProtocol & aType

GenerateFinishedMessageL(CMessageDigest *, CMessageDigest *, HBufC8 *&, TBool)

voidGenerateFinishedMessageL(CMessageDigest *aMd5DigestInput,
CMessageDigest *aShaDigestInput,
HBufC8 *&aOutput,
TBoolaIsServer
)[private]

This asynchronous method generates a SSL/TLS protocol's Client 'Finished' message. This input for this message is a hash of the concatenation of all the handshake messages exchanged thus far (as specified by RFC2246 and SSL3.0 specification). In order to create the required output, TLS Protocol: "client finished" + iMd5DigestInput + iShaDigestInput

SSL Protocol: (iMd5DigestInput +"CLNT") + (iShaDigestInput +"CLNT")

Parameters

CMessageDigest * aMd5DigestInputMd5 hash of Handshake message
CMessageDigest * aShaDigestInputMd5 hash of Handshake message
HBufC8 *& aOutputClient's 'Finished' message
TBool aIsServerasynchronous request status set on the completion

GenerateKeysL()

voidGenerateKeysL()[private]

GetX509CertL(HBufC8 *&, CX509Certificate *&)

voidGetX509CertL(HBufC8 *&aEncodedCert,
CX509Certificate *&aOutputX509
)[private]

Parameters

HBufC8 *& aEncodedCert
CX509Certificate *& aOutputX509

KeyDerivation(const TDesC8 &, const TTLSMasterSecretInput &, TDes8 &)

TInt KeyDerivation(const TDesC8 &aLabel,
const TTLSMasterSecretInput &aMasterSecretInput,
TDes8 &aKeyingMaterial
)

Parameters

const TDesC8 & aLabel
const TTLSMasterSecretInput & aMasterSecretInput
TDes8 & aKeyingMaterial

MatchRequestedIssuerDN(const CCertificate *)

TBool MatchRequestedIssuerDN(const CCertificate *aCert)const [private]

Parameters

const CCertificate * aCert

NewL(MTLSSession *, CCTCertInfo *, CCTKeyInfo *, RPointerArray< CCertificate > *)

CTlsSessionImpl *NewL(MTLSSession *aSessionInterface,
CCTCertInfo *aSelectedCertInfo,
CCTKeyInfo *aSelectedKeyInfo,
RPointerArray< CCertificate > *aStoredIntermediatesCACertificates
)[static]

Parameters

MTLSSession * aSessionInterface
CCTCertInfo * aSelectedCertInfo
CCTKeyInfo * aSelectedKeyInfo
RPointerArray< CCertificate > * aStoredIntermediatesCACertificates

RunError(TInt)

TInt RunError(TIntaError)[private, virtual]

Parameters

TInt aError

RunL()

voidRunL()[private, virtual]

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

1. decided that this is the highest priority active object with a completed request

2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

CActiveScheduler::Start CActiveScheduler::Error CActiveScheduler::WaitForAnyRequest TRAPD

ServerCertificate(CX509Certificate *&, TRequestStatus &)

voidServerCertificate(CX509Certificate *&aX509ServerCert,
TRequestStatus &aStatus
)

Parameters

CX509Certificate *& aX509ServerCert
TRequestStatus & aStatus

VerifyServerFinishedMsgL(CMessageDigest *, CMessageDigest *, const TDesC8 &, TRequestStatus &)

voidVerifyServerFinishedMsgL(CMessageDigest *aMd5DigestInput,
CMessageDigest *aShaDigestInput,
const TDesC8 &aActualFinishedMsg,
TRequestStatus &aStatus
)

Parameters

CMessageDigest * aMd5DigestInput
CMessageDigest * aShaDigestInput
const TDesC8 & aActualFinishedMsg
TRequestStatus & aStatus

Member Enumerations Documentation

Enum TStateLists

Enumerators

ENullState
EConstruct
EGetClientCerificate
EGetClientKeyExchange
EGetServerCertificate
EKeyGeneration
EClientFinishedMsg
EVerifyServerFinishedMsg
EComputeDigitalSignature
EConnectionEstablished
EGetClientCerificateX509
ECertificateVerifyMsg
EReturnCert
EGetClientCertificateArray

Member Data Documentation

TBool iAbbrievatedHandshake

TBool iAbbrievatedHandshake[private]

HBufC8 * iActualFinishedMsg

HBufC8 *iActualFinishedMsg[private]

TInt iAttribute

TInt iAttribute[private]

TTLSCipherSuite iCipherSuiteId

TTLSCipherSuite iCipherSuiteId[private]

RPointerArray< HBufC8 > * iClientCertArray

RPointerArray< HBufC8 > *iClientCertArray[private]

CX509Certificate ** iClientCertX509

CX509Certificate **iClientCertX509[private]

HBufC8 ** iClientKeyExch

HBufC8 **iClientKeyExch[private]

HBufC8 ** iComputeDigitalSig

HBufC8 **iComputeDigitalSig[private]

TBool iConstructionComplete

TBool iConstructionComplete[private]

TStateLists iCurrentState

TStateLists iCurrentState[private]

HBufC8 * iEncodedClientCert

HBufC8 *iEncodedClientCert[private]

HBufC8 ** iEncodedClientCertHldrPtr

HBufC8 **iEncodedClientCertHldrPtr[private]

HBufC8 * iEncodedServerCerts

HBufC8 *iEncodedServerCerts[private]

CTlsEncrypt * iEncrypt

CTlsEncrypt *iEncrypt[private]

RFs iFs

RFs iFs[private]

HBufC8 * iKeyMaterial

HBufC8 *iKeyMaterial[private]

TTLSMasterSecretInput iMasterSecretInput

TTLSMasterSecretInput iMasterSecretInput[private]

TStateLists iNextState

TStateLists iNextState[private]

TRequestStatus * iOriginalRequestStatus

TRequestStatus *iOriginalRequestStatus[private]

TStateLists iOriginalState

TStateLists iOriginalState[private]

TTLSProtocolVersion iProtocolVersion

TTLSProtocolVersion iProtocolVersion[private]

CUnifiedCertStore * iPtrUnifiedCertStore

CUnifiedCertStore *iPtrUnifiedCertStore[private]

CCTCertInfo * iSelectedCertInfo

CCTCertInfo *iSelectedCertInfo[private]

CCTKeyInfo * iSelectedKeyInfo

CCTKeyInfo *iSelectedKeyInfo[private]

HBufC8 * iServerCert_rv

HBufC8 *iServerCert_rv[private]

HBufC8 * iServerFinished

HBufC8 *iServerFinished[private]

TInt iServerMsgVerified

TInt iServerMsgVerified[private]

MTLSSession * iSessionInterface

MTLSSession *iSessionInterface[private]

RPointerArray< CCertificate > * iStoredIntermediatesCACertificates

RPointerArray< CCertificate > *iStoredIntermediatesCACertificates[private]

HBufC8 * iTempHolder

HBufC8 *iTempHolder[private]

TPtr8 iTempPtr

TPtr8 iTempPtr[private]

CTlsCryptoAttributes * iTlsCryptoAttributes

CTlsCryptoAttributes *iTlsCryptoAttributes[private]

CX509Certificate ** iX509ServerCert

CX509Certificate **iX509ServerCert[private]