idnits 2.17.1 draft-ietf-tls-exported-authenticator-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 (May 03, 2019) is 1792 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) ** Obsolete normative reference: RFC 7540 (Obsoleted by RFC 9113) Summary: 3 errors (**), 0 flaws (~~), 1 warning (==), 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 May 03, 2019 5 Expires: November 4, 2019 7 Exported Authenticators in TLS 8 draft-ietf-tls-exported-authenticator-09 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 peer. 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 November 4, 2019. 33 Copyright Notice 35 Copyright (c) 2019 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 . . . . . . . . . . . . . . . . . . . 5 55 4.2. Authenticator Construction . . . . . . . . . . . . . . . 5 56 4.2.1. Certificate . . . . . . . . . . . . . . . . . . . . . 6 57 4.2.2. CertificateVerify . . . . . . . . . . . . . . . . . . 6 58 4.2.3. Finished . . . . . . . . . . . . . . . . . . . . . . 8 59 4.2.4. Authenticator Creation . . . . . . . . . . . . . . . 8 60 5. Empty Authenticator . . . . . . . . . . . . . . . . . . . . . 8 61 6. API considerations . . . . . . . . . . . . . . . . . . . . . 8 62 6.1. The "request" API . . . . . . . . . . . . . . . . . . . . 9 63 6.2. The "get context" API . . . . . . . . . . . . . . . . . . 9 64 6.3. The "authenticate" API . . . . . . . . . . . . . . . . . 9 65 6.4. The "validate" API . . . . . . . . . . . . . . . . . . . 10 66 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10 67 7.1. Update of the TLS ExtensionType Registry . . . . . . . . 10 68 7.2. Update of the TLS Exporter Labels Registry . . . . . . . 10 69 8. Security Considerations . . . . . . . . . . . . . . . . . . . 11 70 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 11 71 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 11 72 10.1. Normative References . . . . . . . . . . . . . . . . . . 11 73 10.2. Informative References . . . . . . . . . . . . . . . . . 12 74 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 12 76 1. Introduction 78 This document provides a way to authenticate one party of a Transport 79 Layer Security (TLS) communication to its peer using a certificate 80 after the session has been established. This allows both the client 81 and server to prove ownership of additional identities at any time 82 after the handshake has completed. This proof of authentication can 83 be exported and transmitted out of band from one party to be 84 validated by its peer. 86 This mechanism provides two advantages over the authentication that 87 TLS natively provides: 89 multiple identities - Endpoints that are authoritative for multiple 90 identities - but do not have a single certificate that includes 91 all of the identities - can authenticate additional identities 92 over a single connection. 94 spontaneous authentication - Endpoints can authenticate after a 95 connection is established, in response to events in a higher-layer 96 protocol, as well as integrating more context. 98 Versions of TLS prior to TLS 1.3 used renegotiation as a way to 99 enable post-handshake client authentication given an existing TLS 100 connection. The mechanism described in this document may be used to 101 replace the post-handshake authentication functionality provided by 102 renegotiation. Unlike renegotiation, exported Authenticator-based 103 post-handshake authentication does not require any changes at the TLS 104 layer. 106 Post-handshake authentication is defined in TLS 1.3, but it has the 107 disadvantage of requiring additional state to be stored as part of 108 the TLS state machine. Furthermore, the authentication boundaries of 109 TLS 1.3 post-handshake authentication align with TLS record 110 boundaries, which are often not aligned with the authentication 111 boundaries of the higher-layer protocol. For example, multiplexed 112 connection protocols like HTTP/2 [RFC7540] do not have a notion of 113 which TLS record a given message is a part of. 115 For simplicity, the mechanisms described in this document require a 116 TLS version 1.2 or later. 118 2. Conventions and Terminology 120 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 121 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 122 "OPTIONAL" in this document are to be interpreted as described in BCP 123 14 [RFC2119] [RFC8174] when, and only when, they appear in all 124 capitals, as shown here. 126 3. Authenticator Request 128 The authenticator request is a structured message that can be created 129 by either party of a TLS connection using data exported from that 130 connection. It can be transmitted to the other party of the TLS 131 connection at the application layer. The application layer protocol 132 used to send the authenticator SHOULD use TLS as its underlying 133 transport to keep the request confidential. 135 An authenticator request message can be constructed by either the 136 client or the server. This authenticator request uses the 137 CertificateRequest message structure from Section 4.3.2 of [TLS13]. 138 This message does not include any TLS framing and is not encrypted 139 with a handshake key. 141 The CertificateRequest is used to define the parameters in a request 142 for an authenticator. This message reuses the structure to the 143 CertificateRequest message in [TLS13]. The uniqueness requirements 144 of the certificate_request_context apply only to CertificateRequest 145 messages that are used as part of authenticator requests. There is 146 no impact if the value of a certificate_request_context used in an 147 authenticator request matches the value of a 148 certificate_request_context in the handshake or in a post-handshake 149 message. The structure is defined to be: 151 struct { 152 opaque certificate_request_context<0..2^8-1>; 153 Extension extensions<2..2^16-1>; 154 } CertificateRequest; 156 certificate_request_context: An opaque string which identifies the 157 certificate request and which will be echoed in the authenticator 158 message. A certificate_request_context value MUST be unique for 159 each authenticator request within the scope of a connection 160 (preventing replay and context confusion). The 161 certificate_request_context SHOULD be chosen to be unpredictable 162 to the peer (e.g., by randomly generating it) in order to prevent 163 an attacker who has temporary access to the peer's private key 164 from pre-computing valid authenticators. 166 extensions: The extensions that are allowed in this structure 167 include the extensions defined for CertificateRequest messages 168 defined in Section 4.2. of [TLS13] and the server_name [RFC6066] 169 extension, which is allowed for client-generated authenticator 170 requests. 172 4. Authenticator 174 The authenticator is a structured message that can be exported from 175 either party of a TLS connection. It can be transmitted to the other 176 party of the TLS connection at the application layer. The 177 application layer protocol used to send the authenticator SHOULD use 178 TLS as its underlying transport to keep the certificate confidential. 180 An authenticator message can be constructed by either the client or 181 the server given an established TLS connection, a certificate, and a 182 corresponding private key. Clients MUST NOT send an authenticator 183 without a preceding authenticator request; for servers an 184 authenticator request is optional. For authenticators that do not 185 correspond to authenticator requests, the certificate_request_context 186 is chosen by the server. 188 4.1. Authenticator Keys 190 Each authenticator is computed using a Handshake Context and Finished 191 MAC Key derived from the TLS session. These values are derived using 192 an exporter as described in [RFC5705] (for TLS 1.2) or [TLS13] (for 193 TLS 1.3). These values use different labels depending on the role of 194 the sender: 196 o The Handshake Context is an exporter value that is derived using 197 the label "EXPORTER-client authenticator handshake context" or 198 "EXPORTER-server authenticator handshake context" for 199 authenticators sent by the client and server respectively. 201 o The Finished MAC Key is an exporter value derived using the label 202 "EXPORTER-client authenticator finished key" or "EXPORTER-server 203 authenticator finished key" for authenticators sent by the client 204 and server respectively. 206 The context_value used for the exporter is empty (zero length) for 207 all four values. There is no need to include additional context 208 information at this stage since the application-supplied context is 209 included in the authenticator itself. The length of the exported 210 value is equal to the length of the output of the hash function 211 selected in TLS for the pseudorandom function (PRF). Exported 212 authenticators cannot be used with cipher suites that do not use the 213 TLS PRF and have not defined a hash function for this purpose. This 214 hash is referred to as the authenticator hash. 216 Exported Authenticators MUST NOT be generated or accepted on 217 connections not using the extended master secret [RFC7627] extension, 218 to avoid key synchronization attacks", to be very explicit about the 219 prohibited behavior. 221 4.2. Authenticator Construction 223 An authenticator is formed from the concatenation of TLS 1.3 [TLS13] 224 Certificate, CertificateVerify, and Finished messages. 226 If the peer creating the certificate_request_context has already 227 created or correctly validated an authenticator with the same value, 228 then no authenticator should be constructed. If there is no 229 authenticator request, the extensions are chosen from the TLS 230 handshake. Only servers can provide an authenticator without a 231 corresponding request. 233 ClientHello extensions are used to determine permissible extensions 234 in the Certificate message. This follows the general model for 235 extensions in TLS in which extensions can only be included as part of 236 a Certificate message if they were previously sent as part of a 237 CertificateRequest message or ClientHello message, to ensure that the 238 recipient will be able to process such extensions. 240 4.2.1. Certificate 242 The certificate to be used for authentication and any supporting 243 certificates in the chain. This structure is defined in [TLS13], 244 Section 4.4.2. 246 The certificate message contains an opaque string called 247 certificate_request_context, which is extracted from the 248 authenticator request if present. If no authenticator request is 249 provided, the certificate_request_context can be chosen arbitrarily 250 but MUST be unique within the scope of the connection and be 251 unpredictable to the peer. 253 The certificates chosen in the Certificate message MUST conform to 254 the requirements of a Certificate message in the negotiated version 255 of TLS. In particular, the certificate chain MUST be valid for the a 256 signature algorithms indicated by the peer in the 257 "signature_algorithms" and "signature_algorithms_cert" extension, as 258 described in Section 4.2.3 of [TLS13] for TLS 1.3 or the 259 "signature_algorithms" extension from Sections 7.4.2 and 7.4.6 of 260 [RFC5246] for TLS 1.2. 262 In addition to "signature_algorithms" and 263 "signature_algorithms_cert", the "server_name" [RFC6066], 264 "certificate_authorities" (Section 4.2.4. of [TLS13]), and 265 "oid_filters" (Section 4.2.5. of [TLS13]) extensions are used to 266 guide certificate selection. 268 Only the X509 certificate type defined in [TLS13] is supported. 269 Alternative certificate formats such as [RFC7250] Raw Public Keys are 270 not supported in this version of the specification and their use in 271 this context has not yet been analysed. 273 If an authenticator request was provided, the Certificate message 274 MUST contain only extensions present in the authenticator request. 275 Otherwise, the Certificate message MUST contain only extensions 276 present in the TLS handshake. Unrecognized extensions in the 277 authenticator request MUST be ignored. 279 4.2.2. CertificateVerify 281 This message is used to provide explicit proof that an endpoint 282 possesses the private key corresponding to its certificate. The 283 definition for TLS 1.3 is: 285 struct { 286 SignatureScheme algorithm; 287 opaque signature<0..2^16-1>; 288 } CertificateVerify; 290 The algorithm field specifies the signature algorithm used (see 291 Section 4.2.3 of [TLS13] for the definition of this field). The 292 signature is a digital signature using that algorithm. 294 The signature scheme MUST be a valid signature scheme for TLS 1.3. 295 This excludes all RSASSA-PKCS1-v1_5 algorithms and combinations of 296 ECDSA and hash algorithms that are not supported in TLS 1.3. 298 If an authenticator request is present, the signature algorithm MUST 299 be chosen from one of the signature schemes present in the 300 authenticator request. Otherwise, the signature algorithm used 301 should be chosen from the "signature_algorithms" sent by the peer in 302 the ClientHello of the TLS handshake. If there are no available 303 signature algorithms, then no authenticator should be constructed. 305 The signature is computed using the chosen signature scheme over the 306 concatenation of: 308 o A string that consists of octet 32 (0x20) repeated 64 times 310 o The context string "Exported Authenticator" (which is not NULL- 311 terminated) 313 o A single 0 byte which serves as the separator 315 o The hashed authenticator transcript 317 The authenticator transcript is the hash of the concatenated 318 Handshake Context, authenticator request (if present), and 319 Certificate message: 321 Hash(Handshake Context || authenticator request || Certificate) 323 Where Hash is the authenticator hash defined in section 4.1. If the 324 authenticator request is not present, it is omitted from this 325 construction (that is, it is zero length). 327 If the party that generates the exported authenticator does so with a 328 different connection than the party that is validating it, then the 329 Handshake Context will not match, resulting in a CertificateVerify 330 message that does not validate. This includes situations in which 331 the application data is sent via TLS-terminating proxy. Given a 332 failed CertificateVerify validation, it may be helpful for the 333 application to confirm that both peers share the same connection 334 using a value derived from the connection secrets before taking a 335 user-visible action. 337 4.2.3. Finished 339 A HMAC [HMAC] over the hashed authenticator transcript, which is the 340 concatenated Handshake Context, authenticator request (if present), 341 Certificate, and CertificateVerify: 343 Hash(Handshake Context || authenticator request || 344 Certificate || CertificateVerify) 346 The HMAC is computed using the authenticator hash, using the Finished 347 MAC Key as a key. 349 4.2.4. Authenticator Creation 351 An endpoint constructs an authenticator by serializing the 352 Certificate, CertificateVerify, and Finished as TLS handshake 353 messages and concatenating the octets: 355 Certificate || CertificateVerify || Finished 357 An authenticator is valid if the CertificateVerify message is 358 correctly constructed given the authenticator request (if used) and 359 the Finished message matches the expected value. When validating an 360 authenticator, a constant-time comparison SHOULD be used. 362 5. Empty Authenticator 364 If, given an authenticator request, the endpoint does not have an 365 appropriate certificate or does not want to return one, it constructs 366 an authenticated refusal called an empty authenticator. This is an 367 HMAC over the hashed authenticator transcript with a Certificate 368 message containing no CertificateEntries and the CertificateVerify 369 message omitted: 371 "Hash(Handshake Context || authenticator request || Certificate) " 373 The HMAC is computed using the authenticator hash, using the Finished 374 MAC Key as a key. This message does not include any TLS framing. 376 6. API considerations 378 The creation and validation of both authenticator requests and 379 authenticators SHOULD be implemented inside the TLS library even if 380 it is possible to implement it at the application layer. TLS 381 implementations supporting the use of exported authenticators SHOULD 382 provide application programming interfaces by which clients and 383 servers may request and verify exported authenticator messages. 385 Notwithstanding the success conditions described below, all APIs MUST 386 fail if: 388 o the connection uses a TLS version of 1.1 or earlier, or 390 o the connection is TLS 1.2 and the extended master secret extension 391 [RFC7627] was not negotiated 393 The following sections describes APIs that are considered necessary 394 to implement exported authenticators. These are informative only. 396 6.1. The "request" API 398 The "request" API takes as input: 400 o certificate_request_context (from 0 to 255 bytes) 402 o set of extensions to include (this MUST include 403 signature_algorithms) 405 It returns an authenticator request, which is a sequence of octets 406 that comprises a CertificateRequest message. 408 6.2. The "get context" API 410 The "get context" API takes as input: 412 o authenticator or authenticator request 414 It returns the certificate_request_context. 416 6.3. The "authenticate" API 418 The "authenticate" API takes as input: 420 o a reference to an active connection 422 o a set of certificate chains and associated extensions (OCSP, SCT, 423 etc.) 425 o a signer (either the private key associated with the certificate, 426 or interface to perform private key operations) for each chain 428 o an authenticator request or certificate_request_context (from 0 to 429 255 bytes) 431 It returns either the exported authenticator or an empty 432 authenticator as a sequence of octets. It is RECOMMENDED that the 433 logic for selecting the certificates and extensions to include in the 434 exporter is implemented in the TLS library. Implementing this in the 435 TLS library lets the implementer take advantage of existing extension 436 and certificate selection logic and more easily remember which 437 extensions were sent in the ClientHello. 439 It is also possible to implement this API outside of the TLS library 440 using TLS exporters. This may be preferable in cases where the 441 application does not have access to a TLS library with these APIs or 442 when TLS is handled independently of the application layer protocol. 444 6.4. The "validate" API 446 The "validate" API takes as input: 448 o a reference to an active connection 450 o an optional authenticator request 452 o an authenticator 454 It returns the certificate chain and extensions and a status to 455 indicate whether the authenticator is valid or not. If the 456 authenticator was empty - that is, it did not contain a certificate - 457 the certificate chain will contain no certificates. The API MUST 458 return a failure if the certificate_request_context of the 459 authenticator was used in a previously validated authenticator. 460 Well-formed empty authenticators are returned as valid. 462 7. IANA Considerations 464 7.1. Update of the TLS ExtensionType Registry 466 IANA is requested to update the entry for server_name(0) in the 467 registry for ExtensionType (defined in [TLS13]) by replacing the 468 value in the "TLS 1.3" column with the value "CH, EE, CR". 470 7.2. Update of the TLS Exporter Labels Registry 472 IANA is requested to add the following entries to the registry for 473 Exporter Labels (defined in [RFC5705]): "EXPORTER-server 474 authenticator handshake context", "EXPORTER-client authenticator 475 finished key" and "EXPORTER-server authenticator finished key". 477 8. Security Considerations 479 The Certificate/Verify/Finished pattern intentionally looks like the 480 TLS 1.3 pattern which now has been analyzed several times. For 481 example, [SIGMAC] presents a relevant framework for analysis. 483 Authenticators are independent and unidirectional. There is no 484 explicit state change inside TLS when an authenticator is either 485 created or validated. The application in possession of a validated 486 authenticator can rely on any semantics associated with data in the 487 certificate_request_context. 489 o This property makes it difficult to formally prove that a server 490 is jointly authoritative over multiple certificates, rather than 491 individually authoritative over each. 493 o There is no indication in the TLS layer about which point in time 494 an authenticator was computed. Any feedback about the time of 495 creation or validation of the authenticator should be tracked as 496 part of the application layer semantics if required. 498 The signatures generated with this API cover the context string 499 "Exported Authenticator" and therefore cannot be transplanted into 500 other protocols. 502 9. Acknowledgements 504 Comments on this proposal were provided by Martin Thomson. 505 Suggestions for Section 8 were provided by Karthikeyan Bhargavan. 507 10. References 509 10.1. Normative References 511 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 512 Hashing for Message Authentication", RFC 2104, 513 DOI 10.17487/RFC2104, February 1997, . 516 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 517 Requirement Levels", BCP 14, RFC 2119, 518 DOI 10.17487/RFC2119, March 1997, . 521 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 522 (TLS) Protocol Version 1.2", RFC 5246, 523 DOI 10.17487/RFC5246, August 2008, . 526 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 527 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 528 March 2010, . 530 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 531 Extensions: Extension Definitions", RFC 6066, 532 DOI 10.17487/RFC6066, January 2011, . 535 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 536 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 537 Transport Layer Security (TLS) and Datagram Transport 538 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 539 June 2014, . 541 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 542 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 543 DOI 10.17487/RFC7540, May 2015, . 546 [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., 547 Langley, A., and M. Ray, "Transport Layer Security (TLS) 548 Session Hash and Extended Master Secret Extension", 549 RFC 7627, DOI 10.17487/RFC7627, September 2015, 550 . 552 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 553 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 554 May 2017, . 556 [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol 557 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 558 . 560 10.2. Informative References 562 [SIGMAC] Krawczyk, H., "A Unilateral-to-Mutual Authentication 563 Compiler for Key Exchange (with Applications to Client 564 Authentication in TLS 1.3)", 2016, 565 . 567 Author's Address 569 Nick Sullivan 570 Cloudflare Inc. 572 Email: nick@cloudflare.com