idnits 2.17.1 draft-ietf-tls-certificate-compression-09.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 23, 2019) is 1557 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Outdated reference: A later version (-06) exists of draft-kucherawy-rfc8478bis-03 ** Downref: Normative reference to an Informational draft: draft-kucherawy-rfc8478bis (ref. 'I-D.kucherawy-rfc8478bis') ** Downref: Normative reference to an Informational RFC: RFC 1950 ** Downref: Normative reference to an Informational RFC: RFC 7932 -- Obsolete informational reference (is this intentional?): RFC 5246 (Obsoleted by RFC 8446) Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TLS A. Ghedini 3 Internet-Draft Cloudflare, Inc. 4 Intended status: Standards Track V. Vasiliev 5 Expires: June 25, 2020 Google 6 December 23, 2019 8 TLS Certificate Compression 9 draft-ietf-tls-certificate-compression-09 11 Abstract 13 In TLS handshakes, certificate chains often take up the majority of 14 the bytes transmitted. 16 This document describes how certificate chains can be compressed to 17 reduce the amount of data transmitted and avoid some round trips. 19 Status of This Memo 21 This Internet-Draft is submitted in full conformance with the 22 provisions of BCP 78 and BCP 79. 24 Internet-Drafts are working documents of the Internet Engineering 25 Task Force (IETF). Note that other groups may also distribute 26 working documents as Internet-Drafts. The list of current Internet- 27 Drafts is at https://datatracker.ietf.org/drafts/current/. 29 Internet-Drafts are draft documents valid for a maximum of six months 30 and may be updated, replaced, or obsoleted by other documents at any 31 time. It is inappropriate to use Internet-Drafts as reference 32 material or to cite them other than as "work in progress." 34 This Internet-Draft will expire on June 25, 2020. 36 Copyright Notice 38 Copyright (c) 2019 IETF Trust and the persons identified as the 39 document authors. All rights reserved. 41 This document is subject to BCP 78 and the IETF Trust's Legal 42 Provisions Relating to IETF Documents 43 (https://trustee.ietf.org/license-info) in effect on the date of 44 publication of this document. Please review these documents 45 carefully, as they describe your rights and restrictions with respect 46 to this document. Code Components extracted from this document must 47 include Simplified BSD License text as described in Section 4.e of 48 the Trust Legal Provisions and are provided without warranty as 49 described in the Simplified BSD License. 51 Table of Contents 53 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 54 2. Notational Conventions . . . . . . . . . . . . . . . . . . . 2 55 3. Negotiating Certificate Compression . . . . . . . . . . . . . 2 56 4. Compressed Certificate Message . . . . . . . . . . . . . . . 3 57 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 58 6. Middlebox Compatibility . . . . . . . . . . . . . . . . . . . 5 59 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 60 7.1. Update of the TLS ExtensionType Registry . . . . . . . . 5 61 7.2. Update of the TLS HandshakeType Registry . . . . . . . . 6 62 7.3. Registry for Compression Algorithms . . . . . . . . . . . 6 63 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 6 64 8.1. Normative References . . . . . . . . . . . . . . . . . . 6 65 8.2. Informative References . . . . . . . . . . . . . . . . . 7 66 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 8 67 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 69 1. Introduction 71 In order to reduce latency and improve performance it can be useful 72 to reduce the amount of data exchanged during a TLS handshake. 74 [RFC7924] describes a mechanism that allows a client and a server to 75 avoid transmitting certificates already shared in an earlier 76 handshake, but it doesn't help when the client connects to a server 77 for the first time and doesn't already have knowledge of the server's 78 certificate chain. 80 This document describes a mechanism that would allow certificates to 81 be compressed during all handshakes. 83 2. Notational Conventions 85 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 86 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 87 "OPTIONAL" in this document are to be interpreted as described in BCP 88 14 [RFC2119] [RFC8174] when, and only when, they appear in all 89 capitals, as shown here. 91 3. Negotiating Certificate Compression 93 This extension is only supported with TLS 1.3 [RFC8446] and newer; if 94 TLS 1.2 [RFC5246] or earlier is negotiated, the peers MUST ignore 95 this extension. 97 This document defines a new extension type 98 (compress_certificate(27)), which can be used to signal the supported 99 compression formats for the Certificate message to the peer. 100 Whenever it is sent by the client as a ClientHello message extension 101 ([RFC8446], Section 4.1.2), it indicates the support for compressed 102 server certificates. Whenever it is sent by the server as a 103 CertificateRequest extension ([RFC8446], Section 4.3.2), it indicates 104 the support for compressed client certificates. 106 By sending a compress_certificate extension, the sender indicates to 107 the peer the certificate compression algorithms it is willing to use 108 for decompression. The "extension_data" field of this extension 109 SHALL contain a CertificateCompressionAlgorithms value: 111 enum { 112 zlib(1), 113 brotli(2), 114 zstd(3), 115 (65535) 116 } CertificateCompressionAlgorithm; 118 struct { 119 CertificateCompressionAlgorithm algorithms<2..2^8-2>; 120 } CertificateCompressionAlgorithms; 122 The compress_certificate extension is a unidirectional indication; no 123 corresponding response extension is needed. 125 4. Compressed Certificate Message 127 If the peer has indicated that it supports compression, server and 128 client MAY compress their corresponding Certificate messages 129 (Section 4.4.2 of [RFC8446]) and send them in the form of the 130 CompressedCertificate message (replacing the Certificate message). 132 The CompressedCertificate message is formed as follows: 134 struct { 135 CertificateCompressionAlgorithm algorithm; 136 uint24 uncompressed_length; 137 opaque compressed_certificate_message<1..2^24-1>; 138 } CompressedCertificate; 140 algorithm The algorithm used to compress the certificate. The 141 algorithm MUST be one of the algorithms listed in the peer's 142 compress_certificate extension. 144 uncompressed_length The length of the Certificate message once it is 145 uncompressed. If after decompression the specified length does 146 not match the actual length, the party receiving the invalid 147 message MUST abort the connection with the "bad_certificate" 148 alert. The presence of this field allows the receiver to pre- 149 allocate the buffer for the uncompressed Certificate message and 150 to enforce limits on the message size before performing 151 decompression. 153 compressed_certificate_message The result of applying the indicated 154 compression algorithm to the encoded Certificate message that 155 would have been sent if certificate compression was not in use. 156 The compression algorithm defines how the bytes in the 157 compressed_certificate_message field are converted into the 158 Certificate message. 160 If the specified compression algorithm is zlib, then the Certificate 161 message MUST be compressed with the ZLIB compression algorithm, as 162 defined in [RFC1950]. If the specified compression algorithm is 163 brotli, the Certificate message MUST be compressed with the Brotli 164 compression algorithm as defined in [RFC7932]. If the specified 165 compression algorithm is zstd, the Certificate message MUST be 166 compressed with the Zstandard compression algorithm as defined in 167 [I-D.kucherawy-rfc8478bis]. 169 It is possible to define a certificate compression algorithm that 170 uses a pre-shared dictionary to achieve higher compression ratio. 171 This document does not define any such algorithms, but additional 172 codepoints may be allocated for such use per the policy in 173 Section 7.3. 175 If the received CompressedCertificate message cannot be decompressed, 176 the connection MUST be terminated with the "bad_certificate" alert. 178 If the format of the Certificate message is altered using the 179 server_certificate_type or client_certificate_type extensions 180 [RFC7250], the resulting altered message is compressed instead. 182 5. Security Considerations 184 After decompression, the Certificate message MUST be processed as if 185 it were encoded without being compressed. This way, the parsing and 186 the verification have the same security properties as they would have 187 in TLS normally. 189 In order for certificate compression to function correctly, the 190 underlying compression algorithm MUST output the same data that was 191 provided as input by the peer. 193 Since certificate chains are typically presented on a per-server name 194 or per-user basis, a malicious application does not have control over 195 any individual fragments in the Certificate message, meaning that 196 they cannot leak information about the certificate by modifying the 197 plaintext. 199 Implementations SHOULD bound the memory usage when decompressing the 200 CompressedCertificate message. 202 Implementations MUST limit the size of the resulting decompressed 203 chain to the specified uncompressed length, and they MUST abort the 204 connection if the size of the output of the decompression function 205 exceeds that limit. TLS framing imposes 16777216 byte limit on the 206 certificate message size, and the implementations MAY impose a limit 207 that is lower than that; in both cases, they MUST apply the same 208 limit as if no compression were used. 210 While the Certificate message in TLS 1.3 is encrypted, third parties 211 can draw inferences from the message length observed on the wire. 212 TLS 1.3 provides a padding mechanism (discussed in Sections 5.4 and 213 E.3 of [RFC8446]) to counteract such analysis. Certificate 214 compression alters the length of the Certificate message, and the 215 change in length is dependent on the actual contents of the 216 certificate. Any padding scheme covering the Certificate message has 217 to address compression within its design, or disable it altogether. 219 6. Middlebox Compatibility 221 It's been observed that a significant number of middleboxes intercept 222 and try to validate the Certificate message exchanged during a TLS 223 handshake. This means that middleboxes that don't understand the 224 CompressedCertificate message might misbehave and drop connections 225 that adopt certificate compression. Because of that, the extension 226 is only supported in the versions of TLS where the certificate 227 message is encrypted in a way that prevents middleboxes from 228 intercepting it, that is, TLS version 1.3 [RFC8446] and higher. 230 7. IANA Considerations 232 7.1. Update of the TLS ExtensionType Registry 234 Create an entry, compress_certificate(27), in the existing registry 235 for ExtensionType (defined in [RFC8446]), with "TLS 1.3" column 236 values being set to "CH, CR", and "Recommended" column being set to 237 "Yes". 239 7.2. Update of the TLS HandshakeType Registry 241 Create an entry, compressed_certificate(25), in the existing registry 242 for HandshakeType (defined in [RFC8446]). 244 7.3. Registry for Compression Algorithms 246 This document establishes a registry of compression algorithms 247 supported for compressing the Certificate message, titled 248 "Certificate Compression Algorithm IDs", under the existing 249 "Transport Layer Security (TLS) Extensions" heading. 251 The entries in the registry are: 253 +------------------+------------------------------+-----------------+ 254 | Algorithm Number | Description | Reference | 255 +------------------+------------------------------+-----------------+ 256 | 0 | Reserved | | 257 | | | | 258 | 1 | zlib | [this document] | 259 | | | | 260 | 2 | brotli | [this document] | 261 | | | | 262 | 3 | zstd | [this document] | 263 | | | | 264 | 16384 to 65535 | Reserved for Experimental | | 265 | | Use | | 266 +------------------+------------------------------+-----------------+ 268 The values in this registry shall be allocated under "IETF Review" 269 policy for values strictly smaller than 256, under "Specification 270 Required" policy for values 256-16383, and under "Experimental Use" 271 otherwise (see [RFC8126] for the definition of relevant policies). 272 Experimental Use extensions can be used both on private networks and 273 over the open Internet. 275 The procedures for requesting values in the Specification Required 276 space are specified in Section 17 of [RFC8447]. 278 8. References 280 8.1. Normative References 282 [I-D.kucherawy-rfc8478bis] 283 Collet, Y. and M. Kucherawy, "Zstandard Compression and 284 the application/zstd Media Type", draft-kucherawy- 285 rfc8478bis-03 (work in progress), December 2019. 287 [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format 288 Specification version 3.3", RFC 1950, 289 DOI 10.17487/RFC1950, May 1996, 290 . 292 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 293 Requirement Levels", BCP 14, RFC 2119, 294 DOI 10.17487/RFC2119, March 1997, 295 . 297 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 298 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 299 Transport Layer Security (TLS) and Datagram Transport 300 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 301 June 2014, . 303 [RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security 304 (TLS) Cached Information Extension", RFC 7924, 305 DOI 10.17487/RFC7924, July 2016, 306 . 308 [RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data 309 Format", RFC 7932, DOI 10.17487/RFC7932, July 2016, 310 . 312 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 313 Writing an IANA Considerations Section in RFCs", BCP 26, 314 RFC 8126, DOI 10.17487/RFC8126, June 2017, 315 . 317 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 318 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 319 May 2017, . 321 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 322 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 323 . 325 [RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS 326 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 327 . 329 8.2. Informative References 331 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 332 (TLS) Protocol Version 1.2", RFC 5246, 333 DOI 10.17487/RFC5246, August 2008, 334 . 336 Appendix A. Acknowledgements 338 Certificate compression was originally introduced in the QUIC Crypto 339 protocol, designed by Adam Langley and Wan-Teh Chang. 341 This document has benefited from contributions and suggestions from 342 David Benjamin, Ryan Hamilton, Christian Huitema, Benjamin Kaduk, 343 Ilari Liusvaara, Piotr Sikora, Ian Swett, Martin Thomson, Sean Turner 344 and many others. 346 Authors' Addresses 348 Alessandro Ghedini 349 Cloudflare, Inc. 351 Email: alessandro@cloudflare.com 353 Victor Vasiliev 354 Google 356 Email: vasilvv@google.com