enum {
change_cipher_spec(20), alert(21), handshake(22),
application_data(23), (255)
} ContentType;
struct {
ContentType type;
ProtocolVersion version;
uint16 length;
opaque fragment[TLSPlaintext.length];
} TLSPlaintext;
type
The higher level protocol used to process the enclosed fragment.
version
The version of the protocol being employed. This document
describes TLS Version 1.0, which uses the version { 3, 1 }. The
version value 3.1 is historical: TLS version 1.0 is a minor
modification to the SSL 3.0 protocol, which bears the version
value 3.0. (See Appendix A.1).
length
The length (in bytes) of the following TLSPlaintext.fragment.
The length should not exceed 2^14.
fragment
The application data. This data is transparent and treated as an
independent block to be dealt with by the higher level protocol
specified by the type field.
Note: Data of different TLS Record layer content types may be
interleaved. Application data is generally of lower precedence
for transmission than other content types.
6.2.2. Record compression and decompression
All records are compressed using the compression algorithm defined in
the current session state. There is always an active compression
algorithm; however, initially it is defined as
CompressionMethod.null. The compression algorithm translates a
TLSPlaintext structure into a TLSCompressed structure. Compression
functions are initialized with default state information whenever a
connection state is made active.
RFC 2246 The TLS Protocol Version 1.0 January 1999
Compression must be lossless and may not increase the content length
by more than 1024 bytes. If the decompression function encounters a
TLSCompressed.fragment that would decompress to a length in excess of
2^14 bytes, it should report a fatal decompression failure error.
struct {
ContentType type; /* same as TLSPlaintext.type */
ProtocolVersion version;/* same as TLSPlaintext.version */
uint16 length;
opaque fragment[TLSCompressed.length];
} TLSCompressed;
length
The length (in bytes) of the following TLSCompressed.fragment.
The length should not exceed 2^14 + 1024.
fragment
The compressed form of TLSPlaintext.fragment.
Note: A CompressionMethod.null operation is an identity operation; no
fields are altered.
Implementation note:
Decompression functions are responsible for ensuring that
messages cannot cause internal buffer overflows.
6.2.3. Record payload protection
The encryption and MAC functions translate a TLSCompressed structure
into a TLSCiphertext. The decryption functions reverse the process.
The MAC of the record also includes a sequence number so that
missing, extra or repeated messages are detectable.
struct {
ContentType type;
ProtocolVersion version;
uint16 length;
select (CipherSpec.cipher_type) {
case stream: GenericStreamCipher;
case block: GenericBlockCipher;
} fragment;
} TLSCiphertext;
=10= |