idnits 2.17.1 draft-ietf-tls-certificate-compression-06.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 (November 20, 2019) is 1619 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-00 ** 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: May 23, 2020 Google 6 November 20, 2019 8 TLS Certificate Compression 9 draft-ietf-tls-certificate-compression-06 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 May 23, 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 . . . . . . . . 5 62 7.3. Registry for Compression Algorithms . . . . . . . . . . . 5 63 8. Normative References . . . . . . . . . . . . . . . . . . . . 6 64 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 7 65 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 7 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 and send 126 them in the form of the CompressedCertificate message (replacing the 127 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 6. Middlebox Compatibility 209 It's been observed that a significant number of middleboxes intercept 210 and try to validate the Certificate message exchanged during a TLS 211 handshake. This means that middleboxes that don't understand the 212 CompressedCertificate message might misbehave and drop connections 213 that adopt certificate compression. Because of that, the extension 214 is only supported in the versions of TLS where the certificate 215 message is encrypted in a way that prevents middleboxes from 216 intercepting it, that is, TLS version 1.3 [RFC8446] and higher. 218 7. IANA Considerations 220 7.1. Update of the TLS ExtensionType Registry 222 Create an entry, compress_certificate(27), in the existing registry 223 for ExtensionType (defined in [RFC8446]), with "TLS 1.3" column 224 values being set to "CH, CR", and "Recommended" column being set to 225 "Yes". 227 7.2. Update of the TLS HandshakeType Registry 229 Create an entry, compressed_certificate(25), in the existing registry 230 for HandshakeType (defined in [RFC8446]). 232 7.3. Registry for Compression Algorithms 234 This document establishes a registry of compression algorithms 235 supported for compressing the Certificate message, titled 236 "Certificate Compression Algorithm IDs", under the existing 237 "Transport Layer Security (TLS) Extensions" heading. 239 The entries in the registry are: 241 +------------------+-------------------------------+ 242 | Algorithm Number | Description | 243 +------------------+-------------------------------+ 244 | 0 | Reserved | 245 | | | 246 | 1 | zlib | 247 | | | 248 | 2 | brotli | 249 | | | 250 | 3 | zstd | 251 | | | 252 | 16384 to 65535 | Reserved for Experimental Use | 253 +------------------+-------------------------------+ 255 The values in this registry shall be allocated under "IETF Review" 256 policy for values strictly smaller than 256, under "Specification 257 Required" policy for values 256-16383, and under "Experimental Use" 258 otherwise (see [RFC8126] for the definition of relevant policies). 259 Experimental Use extensions can be used both on private networks and 260 over the open Internet. 262 The procedures for requesting values in the Specification Required 263 space are specified in [RFC8447]. 265 8. Normative References 267 [I-D.kucherawy-rfc8478bis] 268 Collet, Y. and M. Kucherawy, "Zstandard Compression and 269 the application/zstd Media Type", draft-kucherawy- 270 rfc8478bis-00 (work in progress), October 2019. 272 [RFC1950] Deutsch, P. and J-L. Gailly, "ZLIB Compressed Data Format 273 Specification version 3.3", RFC 1950, 274 DOI 10.17487/RFC1950, May 1996, 275 . 277 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 278 Requirement Levels", BCP 14, RFC 2119, 279 DOI 10.17487/RFC2119, March 1997, 280 . 282 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 283 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 284 Transport Layer Security (TLS) and Datagram Transport 285 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 286 June 2014, . 288 [RFC7924] Santesson, S. and H. Tschofenig, "Transport Layer Security 289 (TLS) Cached Information Extension", RFC 7924, 290 DOI 10.17487/RFC7924, July 2016, 291 . 293 [RFC7932] Alakuijala, J. and Z. Szabadka, "Brotli Compressed Data 294 Format", RFC 7932, DOI 10.17487/RFC7932, July 2016, 295 . 297 [RFC8126] Cotton, M., Leiba, B., and T. Narten, "Guidelines for 298 Writing an IANA Considerations Section in RFCs", BCP 26, 299 RFC 8126, DOI 10.17487/RFC8126, June 2017, 300 . 302 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 303 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 304 May 2017, . 306 [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol 307 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 308 . 310 [RFC8447] Salowey, J. and S. Turner, "IANA Registry Updates for TLS 311 and DTLS", RFC 8447, DOI 10.17487/RFC8447, August 2018, 312 . 314 Appendix A. Acknowledgements 316 Certificate compression was originally introduced in the QUIC Crypto 317 protocol, designed by Adam Langley and Wan-Teh Chang. 319 This document has benefited from contributions and suggestions from 320 David Benjamin, Ryan Hamilton, Ilari Liusvaara, Piotr Sikora, Ian 321 Swett, Martin Thomson, Sean Turner and many others. 323 Authors' Addresses 325 Alessandro Ghedini 326 Cloudflare, Inc. 328 Email: alessandro@cloudflare.com 330 Victor Vasiliev 331 Google 333 Email: vasilvv@google.com