draft-ietf-tls-certificate-compression-05.txt   draft-ietf-tls-certificate-compression-06.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: October 7, 2019 Google Expires: May 23, 2020 Google
April 05, 2019 November 20, 2019
TLS Certificate Compression TLS Certificate Compression
draft-ietf-tls-certificate-compression-05 draft-ietf-tls-certificate-compression-06
Abstract Abstract
In TLS handshakes, certificate chains often take up the majority of In TLS handshakes, certificate chains often take up the majority of
the bytes transmitted. 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
skipping to change at page 1, line 35 skipping to change at page 1, line 35
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 https://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 October 7, 2019. This Internet-Draft will expire on May 23, 2020.
Copyright Notice Copyright Notice
Copyright (c) 2019 IETF Trust and the persons identified as the Copyright (c) 2019 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
(https://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
skipping to change at page 2, line 35 skipping to change at page 2, line 35
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 TLS handshake. to reduce the amount of data exchanged during a 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
for the first time and doesn't already have knowledge of the server's for the first time and doesn't already have knowledge of the server's
certificate chain. certificate chain.
This document describes a mechanism that would allow certificates to This document describes a mechanism that would allow certificates to
be compressed during full handshakes. be compressed during all handshakes.
2. Notational Conventions 2. Notational Conventions
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
3. Negotiating Certificate Compression 3. Negotiating Certificate Compression
skipping to change at page 3, line 27 skipping to change at page 3, line 27
zlib(1), zlib(1),
brotli(2), brotli(2),
zstd(3), zstd(3),
(65535) (65535)
} CertificateCompressionAlgorithm; } CertificateCompressionAlgorithm;
struct { struct {
CertificateCompressionAlgorithm algorithms<2..2^8-2>; CertificateCompressionAlgorithm algorithms<2..2^8-2>;
} CertificateCompressionAlgorithms; } CertificateCompressionAlgorithms;
There is no ServerHello extension that the server is required to echo The compress_certificate extension is a unidirectional indication; no
back. corresponding response extension is needed.
4. Compressed Certificate Message 4. Compressed Certificate Message
If the peer has indicated that it supports compression, server and If the peer has indicated that it supports compression, server and
client MAY compress their corresponding Certificate messages and send client MAY compress their corresponding Certificate messages and send
them in 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:
skipping to change at page 4, line 10 skipping to change at page 4, line 10
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. The presence of this field allows the receiver to pre- alert. The presence of this field allows the receiver to pre-
allocate the buffer for the uncompressed Certificate message and allocate the buffer for the uncompressed Certificate message and
to enforce limits on the message size before performing to enforce limits on the message size before performing
decompression. decompression.
compressed_certificate_message The compressed body of the compressed_certificate_message The result of applying the indicated
Certificate message, in the same format as it would normally be compression algorithm to the encoded Certificate message that
expressed in. The compression algorithm defines how the bytes in would have been sent if certificate compression was not in use.
the compressed_certificate_message field are converted into the The compression algorithm defines how the bytes in the
compressed_certificate_message field are converted into the
Certificate message. Certificate message.
If the specified compression algorithm is zlib, then the Certificate If the specified 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 specified 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]. If the specified compression algorithm as defined in [RFC7932]. If the specified
compression algorithm is zstd, the Certificate message MUST be compression algorithm is zstd, the Certificate message MUST be
compressed with the Zstandard compression algorithm as defined in compressed with the Zstandard compression algorithm as defined in
[RFC8478]. [I-D.kucherawy-rfc8478bis].
It is possible to define a certificate compression algorithm that It is possible to define a certificate compression algorithm that
uses a pre-shared dictionary to achieve higher compression ratio. uses a pre-shared dictionary to achieve higher compression ratio.
This document does not define any such algorithms. This document does not define any such algorithms, but additional
codepoints may be allocated for such use per the policy in
Section 7.3.
If the received CompressedCertificate message cannot be decompressed, If the received CompressedCertificate message cannot be decompressed,
the connection MUST be torn down with the "bad_certificate" alert. the connection MUST be terminated 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 or client_certificate_type extensions server_certificate_type or client_certificate_type extensions
[RFC7250], the resulting altered message is compressed instead. [RFC7250], the resulting altered message is compressed instead.
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.
In order for certificate compression to function correctly, the In order for certificate compression to function correctly, the
underlying compression algorithm MUST be deterministic and it MUST underlying compression algorithm MUST output the same data that was
output the same data that was provided as input by the peer. provided as input by the peer.
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, a malicious application does not have control over
individual fragments in the Certificate message, meaning that they any individual fragments in the Certificate message, meaning that
cannot leak information about the certificate by modifying the they cannot leak information about the certificate by modifying the
plaintext. plaintext.
The implementations SHOULD bound the memory usage when decompressing Implementations SHOULD bound the memory usage when decompressing the
the CompressedCertificate message. CompressedCertificate message.
The implementations MUST limit the size of the resulting decompressed Implementations MUST limit the size of the resulting decompressed
chain to the specified uncompressed length, and they MUST abort the chain to the specified uncompressed length, and they MUST abort the
connection if the size exceeds that limit. TLS framing imposes connection if the size of the output of the decompression function
16777216 byte limit on the certificate message size, and the exceeds that limit. TLS framing imposes 16777216 byte limit on the
implementations MAY impose a limit that is lower than that; in both certificate message size, and the implementations MAY impose a limit
cases, they MUST apply the same limit as if no compression were used. that is lower than that; in both 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. Because of that, the extension that adopt certificate compression. Because of that, the extension
is only supported in the versions of TLS where the certificate is only supported in the versions of TLS where the certificate
message is encrypted in a way that prevents middleboxes from message is encrypted in a way that prevents middleboxes from
skipping to change at page 6, line 31 skipping to change at page 6, line 31
Required" policy for values 256-16383, and under "Experimental Use" Required" policy for values 256-16383, and under "Experimental Use"
otherwise (see [RFC8126] for the definition of relevant policies). otherwise (see [RFC8126] for the definition of relevant policies).
Experimental Use extensions can be used both on private networks and Experimental Use extensions can be used both on private networks and
over the open Internet. over the open Internet.
The procedures for requesting values in the Specification Required The procedures for requesting values in the Specification Required
space are specified in [RFC8447]. space are specified in [RFC8447].
8. Normative References 8. Normative References
[I-D.kucherawy-rfc8478bis]
Collet, Y. and M. Kucherawy, "Zstandard Compression and
the application/zstd Media Type", draft-kucherawy-
rfc8478bis-00 (work in progress), October 2019.
[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, DOI 10.17487/RFC1950, May 1996,
<https://www.rfc-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, DOI 10.17487/RFC2119, March 1997,
<https://www.rfc-editor.org/info/rfc2119>. <https://www.rfc-editor.org/info/rfc2119>.
skipping to change at page 7, line 26 skipping to change at page 7, line 31
May 2017, <https://www.rfc-editor.org/info/rfc8174>. May 2017, <https://www.rfc-editor.org/info/rfc8174>.
[RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol
Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
<https://www.rfc-editor.org/info/rfc8446>. <https://www.rfc-editor.org/info/rfc8446>.
[RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS [RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS
and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018,
<https://www.rfc-editor.org/info/rfc8447>. <https://www.rfc-editor.org/info/rfc8447>.
[RFC8478] Collet, Y. and M. Kucherawy, Ed., "Zstandard Compression
and the application/zstd Media Type", RFC 8478,
DOI 10.17487/RFC8478, October 2018,
<https://www.rfc-editor.org/info/rfc8478>.
Appendix A. Acknowledgements Appendix A. Acknowledgements
Certificate compression was originally introduced in the QUIC Crypto Certificate compression was originally introduced in the QUIC Crypto
protocol, designed by Adam Langley and Wan-Teh Chang. protocol, designed by Adam Langley and Wan-Teh Chang.
This document has benefited from contributions and suggestions from This document has benefited from contributions and suggestions from
David Benjamin, Ryan Hamilton, Ilari Liusvaara, Piotr Sikora, Ian David Benjamin, Ryan Hamilton, Ilari Liusvaara, Piotr Sikora, Ian
Swett, Martin Thomson, Sean Turner and many others. Swett, Martin Thomson, Sean Turner and many others.
Authors' Addresses Authors' Addresses
 End of changes. 16 change blocks. 
31 lines changed or deleted 35 lines changed or added

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