idnits 2.17.1 draft-ietf-tls-exported-authenticator-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 (March 05, 2018) is 2243 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) ** Downref: Normative reference to an Informational RFC: RFC 2104 (ref. 'HMAC') ** Obsolete normative reference: RFC 5246 (Obsoleted by RFC 8446) == Outdated reference: A later version (-28) exists of draft-ietf-tls-tls13-26 Summary: 2 errors (**), 0 flaws (~~), 2 warnings (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TLS N. Sullivan 3 Internet-Draft Cloudflare Inc. 4 Intended status: Standards Track March 05, 2018 5 Expires: September 6, 2018 7 Exported Authenticators in TLS 8 draft-ietf-tls-exported-authenticator-06 10 Abstract 12 This document describes a mechanism in Transport Layer Security (TLS) 13 to provide an exportable proof of ownership of a certificate that can 14 be transmitted out of band and verified by the other party. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on September 6, 2018. 33 Copyright Notice 35 Copyright (c) 2018 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 2. Conventions and Terminology . . . . . . . . . . . . . . . . . 3 52 3. Authenticator Request . . . . . . . . . . . . . . . . . . . . 3 53 4. Authenticator . . . . . . . . . . . . . . . . . . . . . . . . 4 54 4.1. Authenticator Keys . . . . . . . . . . . . . . . . . . . 4 55 4.2. Authenticator Construction . . . . . . . . . . . . . . . 5 56 4.2.1. Certificate . . . . . . . . . . . . . . . . . . . . . 5 57 4.2.2. CertificateVerify . . . . . . . . . . . . . . . . . . 6 58 4.2.3. Finished . . . . . . . . . . . . . . . . . . . . . . 7 59 4.2.4. Authenticator Creation . . . . . . . . . . . . . . . 7 60 5. API considerations . . . . . . . . . . . . . . . . . . . . . 7 61 5.1. The "request" API . . . . . . . . . . . . . . . . . . . . 8 62 5.2. The "get context" API . . . . . . . . . . . . . . . . . . 8 63 5.3. The "authenticate" API . . . . . . . . . . . . . . . . . 8 64 5.4. The "validate" API . . . . . . . . . . . . . . . . . . . 9 65 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 9 66 7. Security Considerations . . . . . . . . . . . . . . . . . . . 9 67 8. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 9 68 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 69 9.1. Normative References . . . . . . . . . . . . . . . . . . 10 70 9.2. Informative References . . . . . . . . . . . . . . . . . 11 71 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 11 73 1. Introduction 75 This document provides a way to authenticate one party of a Transport 76 Layer Security (TLS) communication to another using a certificate 77 after the session has been established. This allows both the client 78 and server to prove ownership of additional identities at any time 79 after the handshake has completed. This proof of authentication can 80 be exported and transmitted out of band from one party to be 81 validated by the other party. 83 This mechanism provides two advantages over the authentication that 84 TLS natively provides: 86 multiple identities - Endpoints that are authoritative for multiple 87 identities - but do not have a single certificate that includes 88 all of the identities - can authenticate with those identities 89 over a single connection. 91 spontaneous authentication - Endpoints can authenticate after a 92 connection is established, in response to events in a higher-layer 93 protocol, as well as integrating more context. 95 This document intends to replace much of the functionality of 96 renegotiation in previous versions of TLS. It has the advantages 97 over renegotiation of not requiring additional on-the-wire changes 98 during a connection. For simplicity, only TLS 1.2 and later are 99 supported. 101 Post-handshake authentication is defined in TLS 1.3, but it has the 102 disadvantage of requiring additional state to be stored in the TLS 103 state machine and it composes poorly with multiplexed connection 104 protocols like HTTP/2. It is also only available for client 105 authentication. This mechanism is intended to be used as part of a 106 replacement for post-handshake authentication in applications. 108 2. Conventions and Terminology 110 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 111 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 112 "OPTIONAL" in this document are to be interpreted as described in BCP 113 14 [RFC2119] [RFC8174] when, and only when, they appear in all 114 capitals, as shown here. 116 3. Authenticator Request 118 The authenticator request is a structured message that can be 119 exported from either party of a TLS connection. It can be 120 transmitted to the other party of the TLS connection at the 121 application layer. The application layer protocol used to send the 122 authenticator SHOULD use TLS as its underlying transport to keep the 123 request confidential. 125 An authenticator request message can be constructed by either the 126 client or the server. This authenticator request uses the 127 CertificateRequest message structure from Section 4.3.2 of [TLS13]. 128 This message does not include the TLS record layer and is therefore 129 not encrypted with a handshake key. 131 The CertificateRequest is used to define the parameters in a request 132 for an authenticator. The definition for TLS 1.3 is: 134 struct { 135 opaque certificate_request_context<0..2^8-1>; 136 Extension extensions<2..2^16-1>; 137 } CertificateRequest; 139 certificate_request_context: An opaque string which identifies the 140 certificate request and which will be echoed in the authenticator 141 message. The certificate_request_context MUST be unique within 142 the scope of this connection (thus preventing replay of 143 authenticators). The certificate_request_context SHOULD be chosen 144 to be unpredictable to the peer (e.g., by randomly generating it) 145 in order to prevent an attacker who has temporary access to the 146 peer's private key from pre-computing valid authenticators. 148 extensions: The extensions that are allowed in this structure 149 include the extensions defined for CertificateRequest messages 150 defined in Section 4.2. of [TLS13] and the server_name [RFC6066] 151 extension, which is allowed for client-generated authenticator 152 requests. 154 4. Authenticator 156 The authenticator is a structured message that can be exported from 157 either party of a TLS connection. It can be transmitted to the other 158 party of the TLS connection at the application layer. The 159 application layer protocol used to send the authenticator SHOULD use 160 TLS as its underlying transport to keep the certificate confidential. 162 An authenticator message can be constructed by either the client or 163 the server given an established TLS connection, a certificate, and a 164 corresponding private key. For clients, an authenticator request is 165 required; for servers an authenticator request is optional. The 166 authenticator uses the message structures from Section 4.4 of 167 [TLS13], but different parameters. These messages do not include the 168 TLS record layer and are therefore not encrypted with a handshake 169 key. 171 4.1. Authenticator Keys 173 Each authenticator is computed using a Handshake Context and Finished 174 MAC Key derived from the TLS session. These values are derived using 175 an exporter as described in [RFC5705] (for TLS 1.2) or [TLS13] (for 176 TLS 1.3). These values use different labels depending on the role of 177 the sender: 179 o The Handshake Context is an exporter value that is derived using 180 the label "EXPORTER-client authenticator handshake context" or 181 "EXPORTER-server authenticator handshake context" for 182 authenticators sent by the client and server respectively. 184 o The Finished MAC Key is an exporter value derived using the label 185 "EXPORTER-client authenticator finished key" or "EXPORTER-server 186 authenticator finished key" for authenticators sent by the client 187 and server respectively. 189 The context_value used for the exporter is absent (length zero) for 190 all four values. The length of the exported value is equal to the 191 length of the output of the hash function selected in TLS for the 192 pseudorandom function (PRF). Cipher suites that do not use the TLS 193 PRF MUST define a hash function that can be used for this purpose or 194 they cannot be used. 196 If the connection is TLS 1.2, the master secret MUST have been 197 computed with the extended master secret [RFC7627] to avoid key 198 synchronization attacks. 200 4.2. Authenticator Construction 202 An authenticator is formed from the concatenation of TLS 1.3 [TLS13] 203 Certificate, CertificateVerify, and Finished messages. 205 If an authenticator request is present, the extensions used to guide 206 the construction of these messages are taken from the authenticator 207 request. If there is no authenticator request, the extensions are 208 chosen from the TLS handshake. That is, the extensions received in a 209 ClientHello (for servers), ServerHello (for clients in TLS 1.2), or 210 EncryptedExtensions (for clients in TLS 1.3). 212 4.2.1. Certificate 214 The certificate to be used for authentication and any supporting 215 certificates in the chain. This structure is defined in [TLS13], 216 Section 4.4.2. 218 The certificate message contains an opaque string called 219 certificate_request_context, which is extracted from the 220 authenticator request if present. If no authenticator request is 221 provided, the certificate_request_context can be chosen arbitrarily. 223 The certificates chosen in the Certificate message MUST conform to 224 the requirements of a Certificate message in the negotiated version 225 of TLS. In particular, the certificate MUST be valid for the a 226 signature algorithm indicated by the peer in a "signature_algorithms" 227 extension, as described in Section 4.2.3 of [TLS13] and Sections 228 7.4.2 and 7.4.6 of [RFC5246]. 230 In addition to "signature_algorithms", the "server_name" [RFC6066], 231 "certificate_authorities" (Section 4.2.4. of [TLS13]), or 232 "oid_filters" (Section 4.2.5. of [TLS13]) extensions are used to 233 guide certificate selection. These extensions are taken from the 234 authenticator request if present, or the TLS handshake if not. 236 Alternative certificate formats such as [RFC7250] Raw Public Keys are 237 not supported in this version of the specification. 239 If an authenticator request was provided, the Certificate message 240 MUST contain only extensions present in the authenticator request. 241 Otherwise, the Certificate message MUST contain only extensions 242 present in the TLS handshake. 244 4.2.2. CertificateVerify 246 This message is used to provide explicit proof that an endpoint 247 possesses the private key corresponding to its certificate. The 248 definition for TLS 1.3 is: 250 struct { 251 SignatureScheme algorithm; 252 opaque signature<0..2^16-1>; 253 } CertificateVerify; 255 The algorithm field specifies the signature algorithm used (see 256 Section 4.2.3 of [TLS13] for the definition of this field). The 257 signature is a digital signature using that algorithm. 259 The signature scheme MUST be a valid signature scheme for TLS 1.3. 260 This excludes all RSASSA-PKCS1-v1_5 algorithms and combinations of 261 ECDSA and hash algorithms that are not supported in TLS 1.3. 263 If an authenticator request is present, the signature algorithm MUST 264 be chosen from one of the signature schemes in the authenticator 265 request. Otherwise, the signature algorithm used should be chosen 266 from the "signature_algorithms" extension sent by the peer in the TLS 267 handshake. 269 The signature is computed using the over the concatenation of: 271 o A string that consists of octet 32 (0x20) repeated 64 times 273 o The context string "Exported Authenticator" (which is not NULL- 274 terminated) 276 o A single 0 byte which serves as the separator 278 o The hashed authenticator transcript 280 The authenticator transcript is the hash of the concatenated 281 Handshake Context, authenticator request (if present), and 282 Certificate message: 284 "Hash(Handshake Context || authenticator request || Certificate) " 285 Where Hash is the hash function negotiated by TLS. If the 286 authenticator request is not present, it is omitted from this 287 construction (that is, it is zero length). 289 4.2.3. Finished 291 A HMAC [HMAC] over the hashed authenticator transcript, which is the 292 concatenated Handshake Context, authenticator request (if present), 293 Certificate, and CertificateVerify: 295 "Hash(Handshake Context || authenticator request || Certificate || 296 CertificateVerify) " 298 The HMAC is computed using the same hash function using the Finished 299 MAC Key as a key. 301 4.2.4. Authenticator Creation 303 An endpoint constructs an authenticator by serializing the 304 Certificate, CertificateVerify, and Finished as TLS handshake 305 messages and concatenating the octets: 307 "Certificate || CertificateVerify || Finished " 309 A given authenticator can be validated by checking the validity of 310 the CertificateVerify message given the authenticator request (if 311 used) and recomputing the Finished message to see if it matches. 313 5. API considerations 315 The creation and validation of both authenticator requests and 316 authenticators SHOULD be implemented inside the TLS library even if 317 it is possible to implement it at the application layer. TLS 318 implementations supporting the use of exported authenticators MUST 319 provide application programming interfaces by which clients and 320 servers may request and verify exported authenticator messages. 322 Notwithstanding the success conditions described below, all APIs MUST 323 fail if: 325 o the connection uses a TLS version of 1.1 or earlier, or 327 o the connection is TLS 1.2 and the extended master secret [RFC7627] 328 was not used 330 The following sections describes APIs that are considered necessary 331 to implement exported authenticators. These are informative only. 333 5.1. The "request" API 335 The "request" API takes as input: 337 o certificate_request_context (from 0 to 255 bytes) 339 o set of extensions to include (this MUST include 340 signature_algorithms) 342 It returns an authenticator request, which is a sequence of octets 343 that includes a CertificateRequest message. 345 5.2. The "get context" API 347 The "get context" API takes as input: 349 o authenticator 351 It returns the certificate_request_context. 353 5.3. The "authenticate" API 355 The "authenticate" takes as input: 357 o a set of certificate chains and associated extensions (OCSP, SCT, 358 etc.) 360 o a signer (either the private key associated with the certificate, 361 or interface to perform private key operation) for each chain 363 o an optional authenticator request or certificate_request_context 364 (from 0 to 255 bytes) 366 It returns the exported authenticator as a sequence of octets. It is 367 RECOMMENDED that the logic for selecting the certificates and 368 extensions to include in the exporter is implemented in the TLS 369 library. Implementing this in the TLS library lets the implementer 370 take advantage of existing extension and certificate selection logic. 372 It is also possible to implement this API outside of the TLS library 373 using TLS exporters. This may be preferable in cases where the 374 application does not have access to a TLS library with these APIs or 375 when TLS is handled independently of the application layer protocol. 377 5.4. The "validate" API 379 The "validate" API takes as input: 381 o an optional authenticator request 383 o an authenticator 385 It returns the certificate chain and extensions. 387 6. IANA Considerations 389 This document has no IANA actions. 391 7. Security Considerations 393 The Certificate/Verify/Finished pattern intentionally looks like the 394 TLS 1.3 pattern which now has been analyzed several times. In the 395 case where the client presents an authenticator to a server, [SIGMAC] 396 presents a relevant framework for analysis. 398 Authenticators are independent and unidirectional. There is no 399 explicit state change inside TLS when an authenticator is either 400 created or validated. 402 o This property makes it difficult to formally prove that a server 403 is jointly authoritative over multiple certificates, rather than 404 individually authoritative over each. 406 o There is no indication in the TLS layer about which point in time 407 an authenticator was computed. Any feedback about the time of 408 creation or validation of the authenticator should be tracked as 409 part of the application layer semantics if required. 411 The signatures generated with this API cover the context string 412 "Exported Authenticator" and therefore cannot be transplanted into 413 other protocols. 415 8. Acknowledgements 417 Comments on this proposal were provided by Martin Thomson. 418 Suggestions for Section 7 were provided by Karthikeyan Bhargavan. 420 9. References 421 9.1. Normative References 423 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 424 Hashing for Message Authentication", RFC 2104, 425 DOI 10.17487/RFC2104, February 1997, . 428 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 429 Requirement Levels", BCP 14, RFC 2119, 430 DOI 10.17487/RFC2119, March 1997, . 433 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 434 (TLS) Protocol Version 1.2", RFC 5246, 435 DOI 10.17487/RFC5246, August 2008, . 438 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 439 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 440 March 2010, . 442 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 443 Extensions: Extension Definitions", RFC 6066, 444 DOI 10.17487/RFC6066, January 2011, . 447 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 448 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 449 Transport Layer Security (TLS) and Datagram Transport 450 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 451 June 2014, . 453 [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., 454 Langley, A., and M. Ray, "Transport Layer Security (TLS) 455 Session Hash and Extended Master Secret Extension", 456 RFC 7627, DOI 10.17487/RFC7627, September 2015, 457 . 459 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 460 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 461 May 2017, . 463 [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol 464 Version 1.3", draft-ietf-tls-tls13-26 (work in progress), 465 March 2018. 467 9.2. Informative References 469 [SIGMAC] Krawczyk, H., "A Unilateral-to-Mutual Authentication 470 Compiler for Key Exchange (with Applications to Client 471 Authentication in TLS 1.3)", 2016, 472 . 474 Author's Address 476 Nick Sullivan 477 Cloudflare Inc. 479 Email: nick@cloudflare.com