idnits 2.17.1 draft-ietf-tls-certificate-compression-08.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 11, 2019) is 1598 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-01 ** 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 Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). 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 13, 2020 Google 6 December 11, 2019 8 TLS Certificate Compression 9 draft-ietf-tls-certificate-compression-08 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 13, 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. Normative References . . . . . . . . . . . . . . . . . . . . 6 64 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 7 65 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 67 1. Introduction 69 In order to reduce latency and improve performance it can be useful 70 to reduce the amount of data exchanged during a TLS handshake. 72 [RFC7924] describes a mechanism that allows a client and a server to 73 avoid transmitting certificates already shared in an earlier 74 handshake, but it doesn't help when the client connects to a server 75 for the first time and doesn't already have knowledge of the server's 76 certificate chain. 78 This document describes a mechanism that would allow certificates to 79 be compressed during all handshakes. 81 2. Notational Conventions 83 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 84 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 85 "OPTIONAL" in this document are to be interpreted as described in BCP 86 14 [RFC2119] [RFC8174] when, and only when, they appear in all 87 capitals, as shown here. 89 3. Negotiating Certificate Compression 91 This extension is only supported with TLS 1.3 and newer; if TLS 1.2 92 or earlier is negotiated, the peers MUST ignore this extension. 94 This document defines a new extension type 95 (compress_certificate(27)), which can be used to signal the supported 96 compression formats for the Certificate message to the peer. 97 Whenever it is sent by the client as a ClientHello message extension 98 ([RFC8446], Section 4.1.2), it indicates the support for compressed 99 server certificates. Whenever it is sent by the server as a 100 CertificateRequest extension ([RFC8446], Section 4.3.2), it indicates 101 the support for compressed client certificates. 103 By sending a compress_certificate extension, the sender indicates to 104 the peer the certificate compression algorithms it is willing to use 105 for decompression. The "extension_data" field of this extension 106 SHALL contain a CertificateCompressionAlgorithms value: 108 enum { 109 zlib(1), 110 brotli(2), 111 zstd(3), 112 (65535) 113 } CertificateCompressionAlgorithm; 115 struct { 116 CertificateCompressionAlgorithm algorithms<2..2^8-2>; 117 } CertificateCompressionAlgorithms; 119 The compress_certificate extension is a unidirectional indication; no 120 corresponding response extension is needed. 122 4. Compressed Certificate Message 124 If the peer has indicated that it supports compression, server and 125 client MAY compress their corresponding Certificate messages 126 (Section 4.4.2 of [RFC8446]) and send them in the form of the 127 CompressedCertificate message (replacing the Certificate message). 129 The CompressedCertificate message is formed as follows: 131 struct { 132 CertificateCompressionAlgorithm algorithm; 133 uint24 uncompressed_length; 134 opaque compressed_certificate_message<1..2^24-1>; 135 } CompressedCertificate; 137 algorithm The algorithm used to compress the certificate. The 138 algorithm MUST be one of the algorithms listed in the peer's 139 compress_certificate extension. 141 uncompressed_length The length of the Certificate message once it is 142 uncompressed. If after decompression the specified length does 143 not match the actual length, the party receiving the invalid 144 message MUST abort the connection with the "bad_certificate" 145 alert. The presence of this field allows the receiver to pre- 146 allocate the buffer for the uncompressed Certificate message and 147 to enforce limits on the message size before performing 148 decompression. 150 compressed_certificate_message The result of applying the indicated 151 compression algorithm to the encoded Certificate message that 152 would have been sent if certificate compression was not in use. 153 The compression algorithm defines how the bytes in the 154 compressed_certificate_message field are converted into the 155 Certificate message. 157 If the specified compression algorithm is zlib, then the Certificate 158 message MUST be compressed with the ZLIB compression algorithm, as 159 defined in [RFC1950]. If the specified compression algorithm is 160 brotli, the Certificate message MUST be compressed with the Brotli 161 compression algorithm as defined in [RFC7932]. If the specified 162 compression algorithm is zstd, the Certificate message MUST be 163 compressed with the Zstandard compression algorithm as defined in 164 [I-D.kucherawy-rfc8478bis]. 166 It is possible to define a certificate compression algorithm that 167 uses a pre-shared dictionary to achieve higher compression ratio. 168 This document does not define any such algorithms, but additional 169 codepoints may be allocated for such use per the policy in 170 Section 7.3. 172 If the received CompressedCertificate message cannot be decompressed, 173 the connection MUST be terminated with the "bad_certificate" alert. 175 If the format of the Certificate message is altered using the 176 server_certificate_type or client_certificate_type extensions 177 [RFC7250], the resulting altered message is compressed instead. 179 5. Security Considerations 181 After decompression, the Certificate message MUST be processed as if 182 it were encoded without being compressed. This way, the parsing and 183 the verification have the same security properties as they would have 184 in TLS normally. 186 In order for certificate compression to function correctly, the 187 underlying compression algorithm MUST output the same data that was 188 provided as input by the peer. 190 Since certificate chains are typically presented on a per-server name 191 or per-user basis, a malicious application does not have control over 192 any individual fragments in the Certificate message, meaning that 193 they cannot leak information about the certificate by modifying the 194 plaintext. 196 Implementations SHOULD bound the memory usage when decompressing the 197 CompressedCertificate message. 199 Implementations MUST limit the size of the resulting decompressed 200 chain to the specified uncompressed length, and they MUST abort the 201 connection if the size of the output of the decompression function 202 exceeds that limit. TLS framing imposes 16777216 byte limit on the 203 certificate message size, and the implementations MAY impose a limit 204 that is lower than that; in both cases, they MUST apply the same 205 limit as if no compression were used. 207 While the Certificate message in TLS 1.3 is encrypted, third parties 208 can draw inferences from the message length observed on the wire. 209 TLS 1.3 provides a padding mechanism (discussed in Sections 5.4 and 210 E.3 of [RFC8446]) to counteract such analysis. Certificate 211 compression alters the length of the Certificate message, and the 212 change in length is dependent on the actual contents of the 213 certificate. Any padding scheme covering the Certificate message has 214 to address compression within its design, or disable it altogether. 216 6. Middlebox Compatibility 218 It's been observed that a significant number of middleboxes intercept 219 and try to validate the Certificate message exchanged during a TLS 220 handshake. This means that middleboxes that don't understand the 221 CompressedCertificate message might misbehave and drop connections 222 that adopt certificate compression. Because of that, the extension 223 is only supported in the versions of TLS where the certificate 224 message is encrypted in a way that prevents middleboxes from 225 intercepting it, that is, TLS version 1.3 [RFC8446] and higher. 227 7. IANA Considerations 229 7.1. Update of the TLS ExtensionType Registry 231 Create an entry, compress_certificate(27), in the existing registry 232 for ExtensionType (defined in [RFC8446]), with "TLS 1.3" column 233 values being set to "CH, CR", and "Recommended" column being set to 234 "Yes". 236 7.2. Update of the TLS HandshakeType Registry 238 Create an entry, compressed_certificate(25), in the existing registry 239 for HandshakeType (defined in [RFC8446]). 241 7.3. Registry for Compression Algorithms 243 This document establishes a registry of compression algorithms 244 supported for compressing the Certificate message, titled 245 "Certificate Compression Algorithm IDs", under the existing 246 "Transport Layer Security (TLS) Extensions" heading. 248 The entries in the registry are: 250 +------------------+------------------------------+-----------------+ 251 | Algorithm Number | Description | Reference | 252 +------------------+------------------------------+-----------------+ 253 | 0 | Reserved | | 254 | | | | 255 | 1 | zlib | [this document] | 256 | | | | 257 | 2 | brotli | [this document] | 258 | | | | 259 | 3 | zstd | [this document] | 260 | | | | 261 | 16384 to 65535 | Reserved for Experimental | | 262 | | Use | | 263 +------------------+------------------------------+-----------------+ 265 The values in this registry shall be allocated under "IETF Review" 266 policy for values strictly smaller than 256, under "Specification 267 Required" policy for values 256-16383, and under "Experimental Use" 268 otherwise (see [RFC8126] for the definition of relevant policies). 269 Experimental Use extensions can be used both on private networks and 270 over the open Internet. 272 The procedures for requesting values in the Specification Required 273 space are specified in [RFC8447]. 275 8. Normative References 277 [I-D.kucherawy-rfc8478bis] 278 Collet, Y. and M. Kucherawy, "Zstandard Compression and 279 the application/zstd Media Type", draft-kucherawy- 280 rfc8478bis-01 (work in progress), November 2019. 282 [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format 283 Specification version 3.3", RFC 1950, 284 DOI 10.17487/RFC1950, May 1996, 285 . 287 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 288 Requirement Levels", BCP 14, RFC 2119, 289 DOI 10.17487/RFC2119, March 1997, 290 . 292 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 293 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 294 Transport Layer Security (TLS) and Datagram Transport 295 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 296 June 2014, . 298 [RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security 299 (TLS) Cached Information Extension", RFC 7924, 300 DOI 10.17487/RFC7924, July 2016, 301 . 303 [RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data 304 Format", RFC 7932, DOI 10.17487/RFC7932, July 2016, 305 . 307 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 308 Writing an IANA Considerations Section in RFCs", BCP 26, 309 RFC 8126, DOI 10.17487/RFC8126, June 2017, 310 . 312 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 313 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 314 May 2017, . 316 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 317 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 318 . 320 [RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS 321 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 322 . 324 Appendix A. Acknowledgements 326 Certificate compression was originally introduced in the QUIC Crypto 327 protocol, designed by Adam Langley and Wan-Teh Chang. 329 This document has benefited from contributions and suggestions from 330 David Benjamin, Ryan Hamilton, Christian Huitema, Benjamin Kaduk, 331 Ilari Liusvaara, Piotr Sikora, Ian Swett, Martin Thomson, Sean Turner 332 and many others. 334 Authors' Addresses 336 Alessandro Ghedini 337 Cloudflare, Inc. 339 Email: alessandro@cloudflare.com 341 Victor Vasiliev 342 Google 344 Email: vasilvv@google.com