draft-ietf-tls-certificate-compression-01.txt   draft-ietf-tls-certificate-compression-02.txt 
TLS A. Ghedini TLS A. Ghedini
Internet-Draft Cloudflare, Inc. Internet-Draft Cloudflare, Inc.
Intended status: Standards Track V. Vasiliev Intended status: Standards Track V. Vasiliev
Expires: June 12, 2018 Google Expires: July 30, 2018 Google
December 09, 2017 January 26, 2018
Transport Layer Security (TLS) Certificate Compression Transport Layer Security (TLS) Certificate Compression
draft-ietf-tls-certificate-compression-01 draft-ietf-tls-certificate-compression-02
Abstract Abstract
In Transport Layer Security (TLS) handshakes, certificate chains In Transport Layer Security (TLS) handshakes, certificate chains
often take up the majority of the bytes transmitted. often take up the majority of the bytes transmitted.
This document describes how certificate chains can be compressed to This document describes how certificate chains can be compressed to
reduce the amount of data transmitted and avoid some round trips. reduce the amount of data transmitted and avoid some round trips.
Status of This Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on June 12, 2018. This Internet-Draft will expire on July 30, 2018.
Copyright Notice Copyright Notice
Copyright (c) 2017 IETF Trust and the persons identified as the Copyright (c) 2018 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (https://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Notational Conventions . . . . . . . . . . . . . . . . . . . 2 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 2
3. Negotiating Certificate Compression . . . . . . . . . . . . . 2 3. Negotiating Certificate Compression . . . . . . . . . . . . . 2
4. Compressed Certificate Message . . . . . . . . . . . . . . . 3 4. Compressed Certificate Message . . . . . . . . . . . . . . . 3
5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4
6. Middlebox Compatibility . . . . . . . . . . . . . . . . . . . 5 6. Middlebox Compatibility . . . . . . . . . . . . . . . . . . . 5
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5
7.1. Update of the TLS ExtensionType Registry . . . . . . . . 5 7.1. Update of the TLS ExtensionType Registry . . . . . . . . 5
7.2. Update of the TLS HandshakeType Registry . . . . . . . . 5 7.2. Update of the TLS HandshakeType Registry . . . . . . . . 5
7.3. Registry for Compression Algorithms . . . . . . . . . . . 5 7.3. Registry for Compression Algorithms . . . . . . . . . . . 5
8. Normative References . . . . . . . . . . . . . . . . . . . . 6 8. Normative References . . . . . . . . . . . . . . . . . . . . 6
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 6 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 7
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7
1. Introduction 1. Introduction
In order to reduce latency and improve performance it can be useful In order to reduce latency and improve performance it can be useful
to reduce the amount of data exchanged during a Transport Layer to reduce the amount of data exchanged during a Transport Layer
Security (TLS) handshake. Security (TLS) handshake.
[RFC7924] describes a mechanism that allows a client and a server to [RFC7924] describes a mechanism that allows a client and a server to
avoid transmitting certificates already shared in an earlier avoid transmitting certificates already shared in an earlier
handshake, but it doesn't help when the client connects to a server handshake, but it doesn't help when the client connects to a server
skipping to change at page 2, line 45 skipping to change at page 2, line 46
be compressed during full handshakes. be compressed during full handshakes.
2. Notational Conventions 2. Notational Conventions
The words "MUST", "MUST NOT", "SHALL", "SHOULD", and "MAY" are used The words "MUST", "MUST NOT", "SHALL", "SHOULD", and "MAY" are used
in this document. It's not shouting; when they are capitalized, they in this document. It's not shouting; when they are capitalized, they
have the special meaning defined in [RFC2119]. have the special meaning defined in [RFC2119].
3. Negotiating Certificate Compression 3. Negotiating Certificate Compression
This document defines a new extension type This extension is only supported with TLS 1.3 and newer; if TLS 1.2
(compress_certificates(TBD)), which is used by the client and the or earlier is negotiated, the peers MUST ignore this extension.
server to negotiate the use of compression for their certificate
chains, as well as the choice of the compression algorithm.
By sending the compress_certificates extension, the client indicates This document defines a new extension type
to the server the certificate compression algorithms it supports. (compress_certificate(TBD)), which can be used to signal the
supported compression formats for the Certificate message to the
peer. Whenever it is sent by the client as a ClientHello message
extension ([I-D.ietf-tls-tls13], Section 4.1.2), it indicates the
support for compressed server certificates. Whenever it is sent by
the server as a CertificateRequest extension ([I-D.ietf-tls-tls13],
Section 4.3.2), it indicates the support for compressed client
certificates.
The "extension_data" field of this extension in the ClientHello SHALL By sending a compress_certificate extension, the sender indicates to
contain a CertificateCompressionAlgorithms value: the peer the certificate compression algorithms it is willing to use
for decompression. The "extension_data" field of this extension
SHALL contain a CertificateCompressionAlgorithms value:
enum { enum {
zlib(0), zlib(0),
brotli(1), brotli(1),
(255) (255)
} CertificateCompressionAlgorithm; } CertificateCompressionAlgorithm;
struct { struct {
CertificateCompressionAlgorithm algorithms<1..2^8-1>; CertificateCompressionAlgorithm algorithms<1..2^8-1>;
} CertificateCompressionAlgorithms; } CertificateCompressionAlgorithms;
If the server supports any of the algorithms offered in the There is no ServerHello extension that the server is required to echo
ClientHello, it MAY respond with an extension indicating which back.
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_certificates extension.
4. Compressed Certificate Message 4. Compressed Certificate Message
If a compression algorithm has been negotiated, server and client MAY If the peer has indicated that it supports compression, server and
compress their corresponding Certificate messages and send them in client MAY compress their corresponding Certificate messages and send
the form of the CompressedCertificate message (replacing the them in the form of the CompressedCertificate message (replacing the
Certificate message). Certificate message).
The CompressedCertificate message is formed as follows: The CompressedCertificate message is formed as follows:
struct { struct {
CertificateCompressionAlgorithm algorithm;
uint24 uncompressed_length; uint24 uncompressed_length;
opaque compressed_certificate_message<1..2^24-1>; opaque compressed_certificate_message<1..2^24-1>;
} CompressedCertificate; } CompressedCertificate;
algorithm The algorithm used to compress the certificate. The
algorithm MUST be one of the algorithms listed in the peer's
compress_certificate extension.
uncompressed_length The length of the Certificate message once it is uncompressed_length The length of the Certificate message once it is
uncompressed. If after decompression the specified length does uncompressed. If after decompression the specified length does
not match the actual length, the party receiving the invalid not match the actual length, the party receiving the invalid
message MUST abort the connection with the "bad_certificate" message MUST abort the connection with the "bad_certificate"
alert. alert.
compressed_certificate_message The compressed body of the compressed_certificate_message The compressed body of the
Certificate message, in the same format as it would normally be Certificate message, in the same format as it would normally be
expressed in. The compression algorithm defines how the bytes in expressed in. The compression algorithm defines how the bytes in
the compressed_certificate_message field are converted into the the compressed_certificate_message field are converted into the
Certificate message. Certificate message.
A peer is not required to compress their own Certificate messages If the specified compression algorithm is zlib, then the Certificate
even if the compress_certficates extension has been negotiated, but
MUST be able to decompress a received CompressedCertificate message.
If the negotiated compression algorithm is zlib, then the Certificate
message MUST be compressed with the ZLIB compression algorithm, as message MUST be compressed with the ZLIB compression algorithm, as
defined in [RFC1950]. If the negotiated compression algorithm is defined in [RFC1950]. If the specified compression algorithm is
brotli, the Certificate message MUST be compressed with the Brotli brotli, the Certificate message MUST be compressed with the Brotli
compression algorithm as defined in [RFC7932]. compression algorithm as defined in [RFC7932].
If the received CompressedCertificate message cannot be decompressed, If the received CompressedCertificate message cannot be decompressed,
the connection MUST be tore down with the "bad_certificate" alert. the connection MUST be torn down with the "bad_certificate" alert.
If the format of the Certificate message is altered using the If the format of the Certificate message is altered using the
server_certificate_type extension [RFC7250], the resulting altered server_certificate_type extension [RFC7250], the resulting altered
message is compressed instead. 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_certificates extension.
5. Security Considerations 5. Security Considerations
After decompression, the Certificate message MUST be processed as if After decompression, the Certificate message MUST be processed as if
it were encoded without being compressed. This way, the parsing and it were encoded without being compressed. This way, the parsing and
the verification have the same security properties as they would have the verification have the same security properties as they would have
in TLS normally. in TLS normally.
Since certificate chains are typically presented on a per-server name Since certificate chains are typically presented on a per-server name
or per-user basis, the attacker does not have control over any or per-user basis, the attacker does not have control over any
individual fragments in the Certificate message, meaning that they individual fragments in the Certificate message, meaning that they
skipping to change at page 5, line 11 skipping to change at page 5, line 11
16777216 byte limit on the certificate message size, and the 16777216 byte limit on the certificate message size, and the
implementations MAY impose a limit that is lower than that; in both 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. cases, they MUST apply the same limit as if no compression were used.
6. Middlebox Compatibility 6. Middlebox Compatibility
It's been observed that a significant number of middleboxes intercept It's been observed that a significant number of middleboxes intercept
and try to validate the Certificate message exchanged during a TLS and try to validate the Certificate message exchanged during a TLS
handshake. This means that middleboxes that don't understand the handshake. This means that middleboxes that don't understand the
CompressedCertificate message might misbehave and drop connections CompressedCertificate message might misbehave and drop connections
that adopt certificate compression. that adopt certificate compression. Because of that, the extension
is only supported in the versions of TLS where the certificate
However this is not a problem when using TLS version 1.3 [draft-ietf- message is encrypted in a way that prevents middleboxes from
tls-tls13] and higher, due to the fact that the Certificate (and thus intercepting it, that is, TLS version 1.3 [I-D.ietf-tls-tls13] and
the CompressedCertificate) message is encrypted, preventing higher.
middleboxes from intercepting it.
7. IANA Considerations 7. IANA Considerations
7.1. Update of the TLS ExtensionType Registry 7.1. Update of the TLS ExtensionType Registry
Create an entry, compress_certificates(TBD), in the existing registry Create an entry, compress_certificate(TBD), in the existing registry
for ExtensionType (defined in [RFC5246]). for ExtensionType (defined in [I-D.ietf-tls-tls13]), with "TLS 1.3"
column values being set to "CH, CR".
7.2. Update of the TLS HandshakeType Registry 7.2. Update of the TLS HandshakeType Registry
Create an entry, compressed_certificate(TBD), in the existing Create an entry, compressed_certificate(TBD), in the existing
registry for HandshakeType (defined in [RFC5246]). registry for HandshakeType (defined in [RFC5246]).
7.3. Registry for Compression Algorithms 7.3. Registry for Compression Algorithms
This document establishes a registry of compression algorithms This document establishes a registry of compression algorithms
supported for compressing the Certificate message, titled supported for compressing the Certificate message, titled
skipping to change at page 5, line 51 skipping to change at page 5, line 51
+------------------+--------------------------+ +------------------+--------------------------+
| 0 | zlib | | 0 | zlib |
| | | | | |
| 1 | brotli | | 1 | brotli |
| | | | | |
| 224 to 255 | Reserved for Private Use | | 224 to 255 | Reserved for Private Use |
+------------------+--------------------------+ +------------------+--------------------------+
The values in this registry shall be allocated under "IETF Review" The values in this registry shall be allocated under "IETF Review"
policy for values strictly smaller than 64, and under "Specification policy for values strictly smaller than 64, and under "Specification
Required" policy otherwise (see [RFC5226] for the definition of Required" policy otherwise (see [RFC8126] for the definition of
relevant policies). relevant policies).
8. Normative References 8. Normative References
[I-D.ietf-tls-tls13]
Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", draft-ietf-tls-tls13-23 (work in progress),
January 2018.
[RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format
Specification version 3.3", RFC 1950, Specification version 3.3", RFC 1950,
DOI 10.17487/RFC1950, May 1996, <https://www.rfc- DOI 10.17487/RFC1950, May 1996,
editor.org/info/rfc1950>. <https://www.rfc-editor.org/info/rfc1950>.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, Requirement Levels", BCP 14, RFC 2119,
DOI 10.17487/RFC2119, March 1997, <https://www.rfc- DOI 10.17487/RFC2119, March 1997,
editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
[RFC4366] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J., [RFC4366] Blake-Wilson, S., Nystrom, M., Hopwood, D., Mikkelsen, J.,
and T. Wright, "Transport Layer Security (TLS) and T. Wright, "Transport Layer Security (TLS)
Extensions", RFC 4366, DOI 10.17487/RFC4366, April 2006, Extensions", RFC 4366, DOI 10.17487/RFC4366, April 2006,
<https://www.rfc-editor.org/info/rfc4366>. <https://www.rfc-editor.org/info/rfc4366>.
[RFC5226] Narten, T. and H. Alvestrand, "Guidelines for Writing an
IANA Considerations Section in RFCs", RFC 5226,
DOI 10.17487/RFC5226, May 2008, <https://www.rfc-
editor.org/info/rfc5226>.
[RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security
(TLS) Protocol Version 1.2", RFC 5246, (TLS) Protocol Version 1.2", RFC 5246,
DOI 10.17487/RFC5246, August 2008, <https://www.rfc- DOI 10.17487/RFC5246, August 2008,
editor.org/info/rfc5246>. <https://www.rfc-editor.org/info/rfc5246>.
[RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J.,
Weiler, S., and T. Kivinen, "Using Raw Public Keys in Weiler, S., and T. Kivinen, "Using Raw Public Keys in
Transport Layer Security (TLS) and Datagram Transport Transport Layer Security (TLS) and Datagram Transport
Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250,
June 2014, <https://www.rfc-editor.org/info/rfc7250>. June 2014, <https://www.rfc-editor.org/info/rfc7250>.
[RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security [RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security
(TLS) Cached Information Extension", RFC 7924, (TLS) Cached Information Extension", RFC 7924,
DOI 10.17487/RFC7924, July 2016, <https://www.rfc- DOI 10.17487/RFC7924, July 2016,
editor.org/info/rfc7924>. <https://www.rfc-editor.org/info/rfc7924>.
[RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data [RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data
Format", RFC 7932, DOI 10.17487/RFC7932, July 2016, Format", RFC 7932, DOI 10.17487/RFC7932, July 2016,
<https://www.rfc-editor.org/info/rfc7932>. <https://www.rfc-editor.org/info/rfc7932>.
[RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for
Writing an IANA Considerations Section in RFCs", BCP 26,
RFC 8126, DOI 10.17487/RFC8126, June 2017,
<https://www.rfc-editor.org/info/rfc8126>.
Appendix A. Acknowledgements
Certificate compression was originally introduced in the QUIC Crypto
protocol, designed by Adam Langley and Wan-Teh Chang.
This document has benefited from contributions and suggestions from
David Benjamin, Ryan Hamilton, Ilari Liusvaara, Piotr Sikora, Ian
Swett, Martin Thomson, Sean Turner and many others.
Authors' Addresses Authors' Addresses
Alessandro Ghedini Alessandro Ghedini
Cloudflare, Inc. Cloudflare, Inc.
Email: alessandro@cloudflare.com Email: alessandro@cloudflare.com
Victor Vasiliev Victor Vasiliev
Google Google
Email: vasilvv@google.com Email: vasilvv@google.com
 End of changes. 29 change blocks. 
58 lines changed or deleted 74 lines changed or added

This html diff was produced by rfcdiff 1.46. The latest version is available from http://tools.ietf.org/tools/rfcdiff/