TLS | A. Ghedini |
Internet-Draft | Cloudflare, Inc. |
Intended status: Standards Track | V. Vasiliev |
Expires: December 10, 2017 | |
June 08, 2017 |
Transport Layer Security (TLS) Certificate Compression
draft-ietf-tls-certificate-compression-00
In Transport Layer Security (TLS) handshakes, certificate chains often take up the majority of the bytes transmitted.
This document describes how certificate chains can be compressed to reduce the amount of data transmitted and avoid some round trips.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on December 10, 2017.
Copyright (c) 2017 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
In order to reduce latency and improve performance it can be useful to reduce the amount of data exchanged during a Transport Layer Security (TLS) handshake.
[RFC7924] describes a mechanism that allows a client and a server to avoid transmitting certificates already shared in an earlier handshake, but it doesn’t help when the client connects to a server for the first time and doesn’t already have knowledge of the server’s certificate chain.
This document describes a mechanism that would allow server certificates to be compressed during full handshakes.
The words “MUST”, “MUST NOT”, “SHALL”, “SHOULD”, and “MAY” are used in this document. It’s not shouting; when they are capitalized, they have the special meaning defined in [RFC2119].
This document defines a new extension type (compress_server_certificates(TBD)), which is used by the client and the server to negotiate the use of compression for the server certificate chain, as well as the choice of the compression algorithm.
By sending the compress_server_certificates message, the client indicates to the server the certificate compression algorithms it supports. The “extension_data” field of this extension in the ClientHello SHALL contain a CertificateCompressionAlgorithms value:
enum { zlib(0), brotli(1), (255) } CertificateCompressionAlgorithm; struct { CertificateCompressionAlgorithm algorithms<1..2^8-1>; } CertificateCompressionAlgorithms;
If the server supports any of the algorithms offered in the ClientHello, it MAY respond with an extension indicating which compression algorithm it chose. In that case, the extension_data SHALL be a CertificateCompressionAlgorithm value corresponding to the chosen algorithm. If the server has chosen to not use any compression, it MUST NOT send the compress_server_certificates extension.
If the server picks a compression algorithm and sends it in the ServerHello, the format of the Certificate message is altered as follows:
struct { uint24 uncompressed_length; opaque compressed_certificate_message<1..2^24-1>; } Certificate;
If the specified compression algorithm is zlib, then the Certificate message MUST be compressed with the ZLIB compression algorithm, as defined in [RFC1950]. If the specified compression algorithm is brotli, the Certificate message MUST be compressed with the Brotli compression algorithm as defined in [RFC7932].
If the client cannot decompress the received Certificate message from the server, it MUST tear down the connection with the “bad_certificate” alert.
The extension only affects the Certificate message from the server. It does not change the format of the Certificate message sent by the client.
If the format of the message is altered using the server_certificate_type extension [RFC7250], the resulting altered message is compressed instead.
If the server chooses to use the cached_info extension [RFC7924] to replace the Certificate message with a hash, it MUST NOT send the compress_server_certificates extension.
After decompression, the Certificate message MUST be processed as if it were encoded without being compressed. This way, the parsing and the verification have the same security properties as they would have in TLS normally.
Since certificate chains are typically presented on a per-server name basis, the attacker does not have control over any individual fragments in the Certificate message, meaning that they cannot leak information about the certificate by modifying the plaintext.
The implementations SHOULD bound the memory usage when decompressing the Certificate message.
The implementations MUST limit the size of the resulting decompressed chain to the specified uncompressed length, and they MUST abort the connection if the size exceeds that limit. TLS framing imposes 16777216 byte limit on the certificate message size, and the implementations MAY impose a limit that is lower than that; in both cases, they MUST apply the same limit as if no compression were used.
Create an entry, compress_server_certificates(TBD), in the existing registry for ExtensionType (defined in [RFC5246]).
This document establishes a registry of compression algorithms supported for compressing the Certificate message, titled “Certificate Compression Algorithm IDs”, under the existing “Transport Layer Security (TLS) Extensions” heading.
The entries in the registry are:
Algorithm Number | Description |
---|---|
0 | zlib |
1 | brotli |
224 to 255 | Reserved for Private Use |
The values in this registry shall be allocated under “IETF Review” policy for values strictly smaller than 64, and under “Specification Required” policy otherwise (see [RFC5226] for the definition of relevant policies).