CPaddingSSLv3 Class Reference

class CPaddingSSLv3 : public CPadding

This concrete subclass of CPadding implements padding according to the SSLv3/TLS standard.

The SSL 3.0 spec does not specifiy the padding bytes to be used - it is assumed to be arbitrary (and the openssl implementation uses non-zero random data). The TLS spec however states that padding bytes should be the length of the padding - 1. This class implements the latter when padding, but does not check the padding byes when unpadding, so as to be interoperable with SSL 3.0.

Inherits from

Constructor & Destructor Documentation

CPaddingSSLv3(TInt)

IMPORT_CCPaddingSSLv3(TIntaBlockBytes)[protected]

Constructor

Parameters

TInt aBlockBytesThe block size in bytes.

CPaddingSSLv3(void)

CPaddingSSLv3(void)[private]

Parameters

void

CPaddingSSLv3(const CPaddingSSLv3 &)

CPaddingSSLv3(const CPaddingSSLv3 &)[private]

Parameters

const CPaddingSSLv3 &

Member Functions Documentation

DoPadL(const TDesC8 &, TDes8 &)

voidDoPadL(const TDesC8 &aInput,
TDes8 &aOutput
)[private, virtual]

Parameters

const TDesC8 & aInput
TDes8 & aOutput

MaxPaddedLength(TInt)

TInt MaxPaddedLength(TIntaInputBytes)const [virtual]

Gets the size of the aOutput buffer, in a call to PadL(), must be in order to accommodate a block size of BlockSize() and an input size of aInputBytes.

Note:

By default, this function returns the output of BlockSize(). If a derived padding system outputs more than a single block of padding, one must override this function and return the appropriate value.

Parameters

TInt aInputBytesThe amount of data to be padded out in bytes.

MinPaddingLength(void)

TInt MinPaddingLength(void)const [virtual]

Gets the smallest number of bytes that PadL() will ever add to aInput in order to get a valid block aligned aOutput.

For example, in SSLv3 padding, if the block size is 8 and aInput is 7 bytes, it will append 1 byte of padding. For SSLv3 padding, this is the smallest amount possible as an 8 byte input will add another block size (8 more bytes) of padded data.

Parameters

void

NewL(TInt)

IMPORT_C CPaddingSSLv3 *NewL(TIntaBlockBytes)[static]

Creates a new CPaddingSSLv3 object.

Parameters

TInt aBlockBytesThe block size in bytes.

NewLC(TInt)

IMPORT_C CPaddingSSLv3 *NewLC(TIntaBlockBytes)[static]

Creates a new CPaddingSSLv3 object and leaves a pointer to it on the cleanup stack.

Parameters

TInt aBlockBytesThe block size in bytes.

UnPadL(const TDesC8 &, TDes8 &)

voidUnPadL(const TDesC8 &aInput,
TDes8 &aOutput
)[virtual]

Removes padding from aInput and appends unpadded result to aOutput.

Parameters

const TDesC8 & aInputData to be unpadded.
TDes8 & aOutputOn return, the unpadded data.

operator=(const CPaddingSSLv3 &)

CPaddingSSLv3 &operator=(const CPaddingSSLv3 &)[private]

Parameters

const CPaddingSSLv3 &