#include <padding.h>
class CPaddingSSLv3 : public CPadding |
Public Member Functions | |
---|---|
virtual TInt | MaxPaddedLength(TInt) |
virtual TInt | MinPaddingLength(void) |
IMPORT_C CPaddingSSLv3 * | NewL(TInt) |
IMPORT_C CPaddingSSLv3 * | NewLC(TInt) |
virtual void | UnPadL(const TDesC8 &, TDes8 &) |
Protected Member Functions | |
---|---|
CPaddingSSLv3(TInt) |
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.
IMPORT_C | CPaddingSSLv3 | ( | TInt | aBlockBytes | ) | [protected] |
Constructor
Parameter | Description |
---|---|
aBlockBytes | The block size in bytes. |
Reimplemented from CPadding::MaxPaddedLength(TInt)const
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.
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.
Parameter | Description |
---|---|
aInputBytes | The amount of data to be padded out in bytes. |
Returns: A TInt representing the maximum amount of padded output data (in bytes) for a given block and input size.
TInt | MinPaddingLength | ( | void | ) | const [virtual] |
Reimplemented from CPadding::MinPaddingLength(void)const
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.
Returns: A TInt containing the smallest number of padding bytes possible.
IMPORT_C CPaddingSSLv3 * | NewL | ( | TInt | aBlockBytes | ) | [static] |
Creates a new CPaddingSSLv3 object.
Parameter | Description |
---|---|
aBlockBytes | The block size in bytes. |
Returns: A pointer to the new CPaddingSSLv3 object.
IMPORT_C CPaddingSSLv3 * | NewLC | ( | TInt | aBlockBytes | ) | [static] |
Creates a new CPaddingSSLv3 object and leaves a pointer to it on the cleanup stack.
Parameter | Description |
---|---|
aBlockBytes | The block size in bytes. |
Returns: A pointer to the new CPaddingSSLv3 object.
Reimplemented from CPadding::UnPadL(const TDesC8 &,TDes8 &)
Removes padding from aInput and appends unpadded result to aOutput.
Parameter | Description |
---|---|
aInput | Data to be unpadded. |
aOutput | On return, the unpadded data. |