idnits 2.17.1 draft-ietf-tls-exported-authenticator-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 (October 18, 2018) is 2015 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 informational reference (is this intentional?): RFC 7540 (Obsoleted by RFC 9113) Summary: 2 errors (**), 0 flaws (~~), 1 warning (==), 2 comments (--). 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 October 18, 2018 5 Expires: April 21, 2019 7 Exported Authenticators in TLS 8 draft-ietf-tls-exported-authenticator-08 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 April 21, 2019. 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 . . . . . . . . . . . . . . . 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 . . . . . . . . . . . . . . . . . . . 10 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 another 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 the other party. 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 with those 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 This document intends to replace much of the functionality of 99 renegotiation in previous versions of TLS. It has the advantages 100 over renegotiation of not requiring additional on-the-wire changes 101 during a connection. For simplicity, only TLS 1.2 and later are 102 supported. 104 Post-handshake authentication is defined in TLS 1.3, but it has the 105 disadvantage of requiring additional state to be stored in the TLS 106 state machine and it composes poorly with multiplexed connection 107 protocols like HTTP/2 [RFC7540]. It is also only available for 108 client authentication. This mechanism is intended to be used as part 109 of a replacement for post-handshake authentication in applications. 111 2. Conventions and Terminology 113 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 114 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 115 "OPTIONAL" in this document are to be interpreted as described in BCP 116 14 [RFC2119] [RFC8174] when, and only when, they appear in all 117 capitals, as shown here. 119 3. Authenticator Request 121 The authenticator request is a structured message that can be 122 exported from either party of a TLS connection. It can be 123 transmitted to the other party of the TLS connection at the 124 application layer. The application layer protocol used to send the 125 authenticator SHOULD use TLS as its underlying transport to keep the 126 request confidential. 128 An authenticator request message can be constructed by either the 129 client or the server. This authenticator request uses the 130 CertificateRequest message structure from Section 4.3.2 of [TLS13]. 131 This message does not include the TLS record layer and is therefore 132 not encrypted with a handshake key. 134 The CertificateRequest is used to define the parameters in a request 135 for an authenticator. The definition for TLS 1.3 is: 137 struct { 138 opaque certificate_request_context<0..2^8-1>; 139 Extension extensions<2..2^16-1>; 140 } CertificateRequest; 142 certificate_request_context: An opaque string which identifies the 143 certificate request and which will be echoed in the authenticator 144 message. A certificate_request_context value MUST be unique for 145 each authenticator request within the scope of a connection 146 (preventing replay and context confusion). The 147 certificate_request_context SHOULD be chosen to be unpredictable 148 to the peer (e.g., by randomly generating it) in order to prevent 149 an attacker who has temporary access to the peer's private key 150 from pre-computing valid authenticators. This value is unrelated 151 to the certificate_request_context used in post-handshake 152 authentication and collisions do not need to be avoided. 154 extensions: The extensions that are allowed in this structure 155 include the extensions defined for CertificateRequest messages 156 defined in Section 4.2. of [TLS13] and the server_name [RFC6066] 157 extension, which is allowed for client-generated authenticator 158 requests. 160 4. Authenticator 162 The authenticator is a structured message that can be exported from 163 either party of a TLS connection. It can be transmitted to the other 164 party of the TLS connection at the application layer. The 165 application layer protocol used to send the authenticator SHOULD use 166 TLS as its underlying transport to keep the certificate confidential. 168 An authenticator message can be constructed by either the client or 169 the server given an established TLS connection, a certificate, and a 170 corresponding private key. Clients MUST NOT send an authenticator 171 without a preceding authenticator request; for servers an 172 authenticator request is optional. The authenticator uses the 173 message structures from Section 4.4 of [TLS13], but different 174 parameters. These messages do not include the TLS record layer and 175 are therefore not encrypted with a handshake key. 177 4.1. Authenticator Keys 179 Each authenticator is computed using a Handshake Context and Finished 180 MAC Key derived from the TLS session. These values are derived using 181 an exporter as described in [RFC5705] (for TLS 1.2) or [TLS13] (for 182 TLS 1.3). These values use different labels depending on the role of 183 the sender: 185 o The Handshake Context is an exporter value that is derived using 186 the label "EXPORTER-client authenticator handshake context" or 187 "EXPORTER-server authenticator handshake context" for 188 authenticators sent by the client and server respectively. 190 o The Finished MAC Key is an exporter value derived using the label 191 "EXPORTER-client authenticator finished key" or "EXPORTER-server 192 authenticator finished key" for authenticators sent by the client 193 and server respectively. 195 The context_value used for the exporter is empty (zero length) for 196 all four values. The length of the exported value is equal to the 197 length of the output of the hash function selected in TLS for the 198 pseudorandom function (PRF). Cipher suites that do not use the TLS 199 PRF MUST define a hash function that can be used for this purpose or 200 they cannot be used. For TLS 1.3 symmetric cipher suites, the hash 201 algorithm used with HKDF is used. 203 If the connection is TLS 1.2, the master secret MUST have been 204 computed with the extended master secret [RFC7627] to avoid key 205 synchronization attacks. 207 4.2. Authenticator Construction 209 An authenticator is formed from the concatenation of TLS 1.3 [TLS13] 210 Certificate, CertificateVerify, and Finished messages. 212 If an authenticator request is present, the extensions used to guide 213 the construction of these messages are taken from the authenticator 214 request. Unrecognized extensions MUST be ignored. If the 215 certificate_request_context from the authenticator request has 216 already been used in the connection, then no authenticator should be 217 constructed. If there is no authenticator request, the extensions 218 are chosen from the TLS handshake. Only servers can provide an 219 authenticator without a corresponding request. In such cases, 220 ClientHello extensions are used to determine permissible extensions 221 in the Certificate message. 223 4.2.1. Certificate 225 The certificate to be used for authentication and any supporting 226 certificates in the chain. This structure is defined in [TLS13], 227 Section 4.4.2. 229 The certificate message contains an opaque string called 230 certificate_request_context, which is extracted from the 231 authenticator request if present. If no authenticator request is 232 provided, the certificate_request_context can be chosen arbitrarily 233 but MUST be unique within the scope of the connection and be 234 unpredictable to the peer. 236 The certificates chosen in the Certificate message MUST conform to 237 the requirements of a Certificate message in the negotiated version 238 of TLS. In particular, the certificate chain MUST be valid for the a 239 signature algorithms indicated by the peer in the 240 "signature_algorithms" and "signature_algorithms_cert" extension, as 241 described in Section 4.2.3 of [TLS13] for TLS 1.3 or the 242 "signature_algorithms" extension from Sections 7.4.2 and 7.4.6 of 243 [RFC5246] for TLS 1.2. 245 In addition to "signature_algorithms" and 246 "signature_algorithms_cert", the "server_name" [RFC6066], 247 "certificate_authorities" (Section 4.2.4. of [TLS13]), and 248 "oid_filters" (Section 4.2.5. of [TLS13]) extensions are used to 249 guide certificate selection. The extensions, or others that might 250 affect certificate selection, are taken from the authenticator 251 request if present, or the TLS handshake if not. 253 Alternative certificate formats such as [RFC7250] Raw Public Keys are 254 not supported in this version of the specification. 256 If an authenticator request was provided, the Certificate message 257 MUST contain only extensions present in the authenticator request. 258 Otherwise, the Certificate message MUST contain only extensions 259 present in the TLS handshake. 261 4.2.2. CertificateVerify 263 This message is used to provide explicit proof that an endpoint 264 possesses the private key corresponding to its certificate. The 265 definition for TLS 1.3 is: 267 struct { 268 SignatureScheme algorithm; 269 opaque signature<0..2^16-1>; 270 } CertificateVerify; 272 The algorithm field specifies the signature algorithm used (see 273 Section 4.2.3 of [TLS13] for the definition of this field). The 274 signature is a digital signature using that algorithm. 276 The signature scheme MUST be a valid signature scheme for TLS 1.3. 277 This excludes all RSASSA-PKCS1-v1_5 algorithms and combinations of 278 ECDSA and hash algorithms that are not supported in TLS 1.3. 280 If an authenticator request is present, the signature algorithm MUST 281 be chosen from one of the signature schemes in the authenticator 282 request. Otherwise, the signature algorithm used should be chosen 283 from the "signature_algorithms" sent by the peer in the TLS 284 handshake. 286 The signature is computed using the chosen signature scheme over the 287 concatenation of: 289 o A string that consists of octet 32 (0x20) repeated 64 times 291 o The context string "Exported Authenticator" (which is not NULL- 292 terminated) 294 o A single 0 byte which serves as the separator 296 o The hashed authenticator transcript 298 The authenticator transcript is the hash of the concatenated 299 Handshake Context, authenticator request (if present), and 300 Certificate message: 302 Hash(Handshake Context || authenticator request || Certificate) 304 Where Hash is the hash function negotiated by TLS. If the 305 authenticator request is not present, it is omitted from this 306 construction (that is, it is zero length). 308 If the party that generates the exported authenticator does so with a 309 different connection than the party that is validating it, then the 310 Handshake Context will not match, resulting in a CertificateVerify 311 message that does not validate. This includes situations in which 312 the application data is sent via TLS-terminating proxy. Given a 313 failed CertificateVerify validation, it may be helpful for the 314 application to confirm that both peers share the same connection 315 using a value derived from the connection secrets before taking a 316 user-visible action. 318 4.2.3. Finished 320 A HMAC [HMAC] over the hashed authenticator transcript, which is the 321 concatenated Handshake Context, authenticator request (if present), 322 Certificate, and CertificateVerify: 324 Hash(Handshake Context || authenticator request || 325 Certificate || CertificateVerify) 327 The HMAC is computed using the same hash function using the Finished 328 MAC Key as a key. 330 4.2.4. Authenticator Creation 332 An endpoint constructs an authenticator by serializing the 333 Certificate, CertificateVerify, and Finished as TLS handshake 334 messages and concatenating the octets: 336 Certificate || CertificateVerify || Finished 338 A given authenticator can be validated by checking the validity of 339 the CertificateVerify message given the authenticator request (if 340 used) and recomputing the Finished message to see if it matches. 342 5. Empty Authenticator 344 If, given an authenticator request, the endpoint does not have an 345 appropriate certificate or does not want to return one, it constructs 346 an authenticated refusal called an empty authenticator. This is an 347 HMAC over the hashed authenticator transcript with a Certificate 348 message containing no CertificateEntries and the CertificateVerify 349 message omitted: 351 "Hash(Handshake Context || authenticator request || Certificate) " 353 The HMAC is computed using the same hash function using the Finished 354 MAC Key as a key. 356 6. API considerations 358 The creation and validation of both authenticator requests and 359 authenticators SHOULD be implemented inside the TLS library even if 360 it is possible to implement it at the application layer. TLS 361 implementations supporting the use of exported authenticators MUST 362 provide application programming interfaces by which clients and 363 servers may request and verify exported authenticator messages. 365 Notwithstanding the success conditions described below, all APIs MUST 366 fail if: 368 o the connection uses a TLS version of 1.1 or earlier, or 370 o the connection is TLS 1.2 and the extended master secret [RFC7627] 371 was not used 373 The following sections describes APIs that are considered necessary 374 to implement exported authenticators. These are informative only. 376 6.1. The "request" API 378 The "request" API takes as input: 380 o certificate_request_context (from 0 to 255 bytes) 382 o set of extensions to include (this MUST include 383 signature_algorithms) 385 It returns an authenticator request, which is a sequence of octets 386 that includes a CertificateRequest message. 388 6.2. The "get context" API 390 The "get context" API takes as input: 392 o authenticator 394 It returns the certificate_request_context. 396 6.3. The "authenticate" API 398 The "authenticate" takes as input: 400 o a set of certificate chains and associated extensions (OCSP, SCT, 401 etc.) 403 o a signer (either the private key associated with the certificate, 404 or interface to perform private key operation) for each chain 406 o an optional authenticator request or certificate_request_context 407 (from 0 to 255 bytes) 409 It returns either the exported authenticator or an empty 410 authenticator as a sequence of octets. It is RECOMMENDED that the 411 logic for selecting the certificates and extensions to include in the 412 exporter is implemented in the TLS library. Implementing this in the 413 TLS library lets the implementer take advantage of existing extension 414 and certificate selection logic. 416 It is also possible to implement this API outside of the TLS library 417 using TLS exporters. This may be preferable in cases where the 418 application does not have access to a TLS library with these APIs or 419 when TLS is handled independently of the application layer protocol. 421 6.4. The "validate" API 423 The "validate" API takes as input: 425 o an optional authenticator request 427 o an authenticator 429 It returns the certificate chain and extensions and a status to 430 indicate whether the authenticator is valid or not. If the 431 authenticator was empty - that is, it did not contain a certificate - 432 the certificate chain will contain no certificates. 434 7. IANA Considerations 436 7.1. Update of the TLS ExtensionType Registry 438 IANA is requested to update the entry for server_name(0) in the 439 registry for ExtensionType (defined in [TLS13]) by replacing the 440 value in the "TLS 1.3" column with the value "CH, EE, CR". 442 7.2. Update of the TLS Exporter Labels Registry 444 IANA is requested to add the following entries to the registry for 445 Exporter Labels (defined in [RFC5705]): "EXPORTER-server 446 authenticator handshake context", "EXPORTER-client authenticator 447 finished key" and "EXPORTER-server authenticator finished key". 449 8. Security Considerations 451 The Certificate/Verify/Finished pattern intentionally looks like the 452 TLS 1.3 pattern which now has been analyzed several times. In the 453 case where the client presents an authenticator to a server, [SIGMAC] 454 presents a relevant framework for analysis. 456 Authenticators are independent and unidirectional. There is no 457 explicit state change inside TLS when an authenticator is either 458 created or validated. 460 o This property makes it difficult to formally prove that a server 461 is jointly authoritative over multiple certificates, rather than 462 individually authoritative over each. 464 o There is no indication in the TLS layer about which point in time 465 an authenticator was computed. Any feedback about the time of 466 creation or validation of the authenticator should be tracked as 467 part of the application layer semantics if required. 469 The signatures generated with this API cover the context string 470 "Exported Authenticator" and therefore cannot be transplanted into 471 other protocols. 473 9. Acknowledgements 475 Comments on this proposal were provided by Martin Thomson. 476 Suggestions for Section 8 were provided by Karthikeyan Bhargavan. 478 10. References 480 10.1. Normative References 482 [HMAC] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed- 483 Hashing for Message Authentication", RFC 2104, 484 DOI 10.17487/RFC2104, February 1997, . 487 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 488 Requirement Levels", BCP 14, RFC 2119, 489 DOI 10.17487/RFC2119, March 1997, . 492 [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security 493 (TLS) Protocol Version 1.2", RFC 5246, 494 DOI 10.17487/RFC5246, August 2008, . 497 [RFC5705] Rescorla, E., "Keying Material Exporters for Transport 498 Layer Security (TLS)", RFC 5705, DOI 10.17487/RFC5705, 499 March 2010, . 501 [RFC6066] Eastlake 3rd, D., "Transport Layer Security (TLS) 502 Extensions: Extension Definitions", RFC 6066, 503 DOI 10.17487/RFC6066, January 2011, . 506 [RFC7250] Wouters, P., Ed., Tschofenig, H., Ed., Gilmore, J., 507 Weiler, S., and T. Kivinen, "Using Raw Public Keys in 508 Transport Layer Security (TLS) and Datagram Transport 509 Layer Security (DTLS)", RFC 7250, DOI 10.17487/RFC7250, 510 June 2014, . 512 [RFC7627] Bhargavan, K., Ed., Delignat-Lavaud, A., Pironti, A., 513 Langley, A., and M. Ray, "Transport Layer Security (TLS) 514 Session Hash and Extended Master Secret Extension", 515 RFC 7627, DOI 10.17487/RFC7627, September 2015, 516 . 518 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 519 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 520 May 2017, . 522 [TLS13] Rescorla, E., "The Transport Layer Security (TLS) Protocol 523 Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018, 524 . 526 10.2. Informative References 528 [RFC7540] Belshe, M., Peon, R., and M. Thomson, Ed., "Hypertext 529 Transfer Protocol Version 2 (HTTP/2)", RFC 7540, 530 DOI 10.17487/RFC7540, May 2015, . 533 [SIGMAC] Krawczyk, H., "A Unilateral-to-Mutual Authentication 534 Compiler for Key Exchange (with Applications to Client 535 Authentication in TLS 1.3)", 2016, 536 . 538 Author's Address 540 Nick Sullivan 541 Cloudflare Inc. 543 Email: nick@cloudflare.com