RFC 8773
TLS 1.3 Extension for Certificate-Based Authentication with an External Pre-Shared Key
RFC 8773 ๐ TLS 1.3 Extension for Certificate-Based Authentication with an External Pre-Shared Key
okay bestie, this one is a TLS 1.3 extension, and it's giving "keep the certificate AND bring your own secret" ๐โจ
- Author: R. Housley, from Vigil Security ๐
- Category: Experimental ๐งช (not a Standards Track thing, it's for trying stuff out and gathering deployment experience)
- Date: March 2020 ๐
- ISSN: 2070-1721
- Obsoletes / Updates: the title block doesn't list any RFCs this one obsoletes or updates, so it stands on its own ๐ฆ
Abstract โจ
okay so the big idea is this: this doc defines a TLS 1.3 extension that lets a server prove who it is using both a certificate and an external pre-shared key (PSK) ๐ซถ
Status of This Memo ๐
so this document is NOT an Internet Standards Track spec. it's been published so people can look at it, implement it experimentally, and evaluate it ๐งช
it defines an Experimental Protocol for the Internet community ๐ it's a product of the IETF, it represents the consensus of the IETF community, and it got public review and was approved for publication by the IESG. not every IESG-approved doc is a candidate for any level of Internet Standard, which is lowkey a whole thing, so check Section 2 of RFC 7841 if you want the deets ๐
for the current status, errata, and how to send feedback, go to https://www.rfc-editor.org/info/rfc8773 ๐
Copyright Notice โ๏ธ
Copyright (c) 2020 IETF Trust and the persons identified as the document authors. All rights reserved. ๐
this document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) as they were in effect on the date of publication. please actually read these, bestie, because they explain your rights and restrictions for this doc ๐ any Code Components pulled out of this document have to include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and they come with no warranty, as the Simplified BSD License describes ๐
Table of Contents ๐๏ธ
1. Introduction
2. Terminology
3. Motivation and Design Rationale
4. Extension Overview
5. Certificate with External PSK Extension
5.1. Companion Extensions
5.2. Authentication
5.3. Keying Material
6. IANA Considerations
7. Security Considerations
8. Privacy Considerations
9. References
9.1. Normative References
9.2. Informative References
Acknowledgments
Author's Address
1. Introduction ๐ธ
okay so TLS 1.3 [RFC8446] handshakes give you two mutually exclusive ways for a server to authenticate. option one: the server shows a signature certificate and makes a valid digital signature, which proves it has the matching private key ๐ option two: the server proves it has a pre-shared key (PSK) that was set up in a previous handshake. a PSK set up that way is called a resumption PSK. any PSK set up some other way is called an external PSK ๐ง
this doc adds a TLS 1.3 extension that lets certificate-based server auth get combined with an external PSK as an input to the TLS 1.3 key schedule. so you get both at once, which is so iconic ๐
several implementors wanted more experience with this before making a Standards Track RFC, so this spec is being published as an Experimental RFC. that way people can build interoperable implementations and collect deployment and operational experience ๐ฆ
2. Terminology ๐
the key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. ๐ so the caps are doing the heavy lifting here, iykyk
3. Motivation and Design Rationale ๐ฎ
okay the scary part first ๐ญ a large-scale quantum computer would be a serious problem for the crypto algorithms we use everywhere today, including the digital signature algorithms that authenticate the server in the TLS 1.3 handshake. it's an open question whether we can actually build one, and if we can, nobody knows when. but if one does get invented, a lot of these algorithms and the security protocols built on them would become vulnerable ๐
the TLS 1.3 handshake uses key agreement and digital signature algorithms that a large-scale quantum computer could break [TRANSITION]. the key agreement algorithms include Diffie-Hellman (DH) [DH1976] and Elliptic Curve Diffie-Hellman (ECDH) [IEEE1363]. the digital signature algorithms include RSA [RFC8017] and the Elliptic Curve Digital Signature Algorithm (ECDSA) [FIPS186]. so an adversary who stores a TLS 1.3 handshake exchange today could decrypt the encrypted communications later, once a large-scale quantum computer shows up ๐ฑ
so in the near term, this doc describes an extension that protects today's communications from a future large-scale quantum computer. it does this by adding a strong external PSK as an input to the TLS 1.3 key schedule, while keeping the authentication that the existing certificate and digital signature mechanisms already give you ๐ก๏ธโจ
4. Extension Overview ๐งโโ๏ธ
this section is a quick overview of the "tls_cert_with_extern_psk" extension ๐
the client includes the "tls_cert_with_extern_psk" extension in the ClientHello message. the "tls_cert_with_extern_psk" extension MUST be accompanied by the "key_share", "psk_key_exchange_modes", and "pre_shared_key" extensions. the client MAY also find it useful to include the "supported_groups" extension. since the "tls_cert_with_extern_psk" extension is only meant for initial handshakes, it MUST NOT be sent alongside the "early_data" extension. these extensions are all described in Section 4.2 of [RFC8446], which also requires the "pre_shared_key" extension to be the last extension in the ClientHello message ๐
if the client includes both the "tls_cert_with_extern_psk" extension and the "early_data" extension, then the server MUST terminate the connection with an "illegal_parameter" alert. ๐จ yikes, don't do that one
if the server is willing to use one of the external PSKs listed in the "pre_shared_key" extension and do certificate-based authentication, then the server includes the "tls_cert_with_extern_psk" extension in the ServerHello message. the "tls_cert_with_extern_psk" extension MUST be accompanied by the "key_share" and "pre_shared_key" extensions. if none of the external PSKs in the client's list is acceptable to the server, then the "tls_cert_with_extern_psk" extension gets left out of the ServerHello message ๐ฅ
when the "tls_cert_with_extern_psk" extension is successfully negotiated, the TLS 1.3 key schedule includes both the selected external PSK and the (EC)DHE shared secret value. (EC)DHE just means Diffie-Hellman over either finite fields or elliptic curves ๐งฎ so the Early Secret, Handshake Secret, and Master Secret all depend on the value of the selected external PSK. of course, the Early Secret does NOT depend on the (EC)DHE shared secret ๐
server authentication, and optional client authentication, depend on being able to make a signature that validates against the public key in their certificates. the authentication processing is not changed in any way by the selected external PSK ๐ the vibes stay the same, the PSK just joins the key schedule
each external PSK is tied to a single hash algorithm, which is required by Section 4.2.11 of [RFC8446]. the hash algorithm MUST be set when the PSK is established, and the default is SHA-256 ๐
5. Certificate with External PSK Extension ๐
this section specifies the "tls_cert_with_extern_psk" extension. it MAY appear in the ClientHello message and the ServerHello message. it MUST NOT appear in any other messages. the "tls_cert_with_extern_psk" extension MUST NOT appear in the ServerHello message unless it also appeared in the preceding ClientHello message. if an implementation recognizes the "tls_cert_with_extern_psk" extension and receives it in any other message, then the implementation MUST abort the handshake with an "illegal_parameter" alert ๐ซ
the general extension mechanisms let clients and servers negotiate specific extensions. clients ask servers for extended functionality using the extensions field in the ClientHello message. if the server responds with a HelloRetryRequest message, then the client sends another ClientHello as described in Section 4.1.2 of [RFC8446], including the same "tls_cert_with_extern_psk" extension as the original ClientHello message, or else it aborts the handshake ๐
lots of server extensions ride along in the EncryptedExtensions message, but the "tls_cert_with_extern_psk" extension is carried in the ServerHello message instead. successful negotiation of this extension affects the key used for encryption, so it can't go in the EncryptedExtensions message ๐ that's why the "tls_cert_with_extern_psk" extension only shows up in the ServerHello message if the server recognizes it AND has one of the external PSKs the client offered in the "pre_shared_key" extension of the ClientHello ๐ง
the Extension structure is defined in [RFC8446]. it's repeated here for convenience ๐
struct {
ExtensionType extension_type;
opaque extension_data<0..2^16-1>;
} Extension;
the "extension_type" identifies the particular extension type, and the "extension_data" holds information specific to that extension type ๐
this document specifies the "tls_cert_with_extern_psk" extension, which adds one new type to ExtensionType:
enum {
tls_cert_with_extern_psk(33), (65535)
} ExtensionType;
the "tls_cert_with_extern_psk" extension matters when the client and server both have an external PSK in common that can be used as an input to the TLS 1.3 key schedule ๐ it's basically just a flag that says "use the external PSK in the key schedule," and it has this syntax:
struct {
select (Handshake.msg_type) {
case client_hello: Empty;
case server_hello: Empty;
};
} CertWithExternPSK;
5.1. Companion Extensions ๐
Okay bestie, Section 4 has the full list of extensions that have to tag along with tls_cert_with_extern_psk โจ Most of them are totally unaffected by this spec, so honestly you can relax ๐
This section is for the ones that need a little extra thought ๐ง
First up is psk_key_exchange_modes, which is defined in Section 4.2.9 of [RFC8446] ๐ธ This one limits which PSKs can be used, both the ones offered in this ClientHello and the ones the server might hand out later in a NewSessionTicket. So when psk_key_exchange_modes shows up in the ClientHello, clients MUST include psk_dhe_ke mode. Clients MAY also include psk_ke mode if they want to support a NewSessionTicket later ๐ฆ When psk_key_exchange_modes shows up in the ServerHello, servers MUST select psk_dhe_ke mode for the initial handshake. For later handshakes that bring in the resumption PSK from that first handshake, servers MUST select a key exchange mode the client listed ๐ซถ
Next, the pre_shared_key extension, defined in Section 4.2.11 of [RFC8446] ๐ I'm copying the syntax below so you don't have to flip back. All of the listed PSKs MUST be external PSKs. If a resumption PSK is listed along with tls_cert_with_extern_psk, the server MUST abort the handshake with an illegal_parameter alert. Not allowed, periodt ๐
โโ๏ธ
struct {
opaque identity<1..2^16-1>;
uint32 obfuscated_ticket_age;
} PskIdentity;
opaque PskBinderEntry<32..255>;
struct {
PskIdentity identities<7..2^16-1>;
PskBinderEntry binders<33..2^16-1>;
} OfferedPsks;
struct {
select (Handshake.msg_type) {
case client_hello: OfferedPsks;
case server_hello: uint16 selected_identity;
};
} PreSharedKeyExtension;
So OfferedPsks is basically the client's shopping list: the PSK identities plus their binders, for every external PSK the client is willing to use with the server ๐๏ธ
The identities are the external PSK identities the client is willing to negotiate with the server ๐ Each external PSK has an identity that both the client and server know. Other parties might know those identities too, which is fine. The binder validation (more on that below) is what confirms that the client and server really share the same key for that identity ๐
Now obfuscated_ticket_age is a total non-factor for external PSKs ๐ As Section 4.2.11 of [RFC8446] says, clients SHOULD set this value to 0, and servers MUST ignore the value. Easy ๐
The binders are a series of HMAC [RFC2104] values, one for each external PSK the client offers, in the same order as the identities list ๐ Each HMAC is computed with a binder_key, which is derived from the external PSK, plus a partial transcript of the current handshake. The binder_key derivation is in Section 7.1 of [RFC8446] โจ The partial transcript covers a partial ClientHello, up to and including the PreSharedKeyExtension.identities field, as described in Section 4.2.11.2 of [RFC8446] ๐งพ
Last one, selected_identity. This holds the index of the external PSK identity the server picked from the client's list ๐ As described in Section 4.2.11 of [RFC8446], the server MUST validate the binder that goes with the selected external PSK. If the binder doesn't validate, the server MUST abort the handshake with an illegal_parameter alert. No binder, no handshake, no excuses ๐ญ
5.2. Authentication ๐
When tls_cert_with_extern_psk is successfully negotiated, server authentication depends on being able to generate a signature that validates against the public key in the server's certificate ๐ That happens when the server sends the Certificate and CertificateVerify messages, as described in Sections 4.4.2 and 4.4.3 of [RFC8446]. Cute and simple ๐
Here's the plot twist: TLS 1.3 doesn't let the server send a CertificateRequest message when a PSK is being used ๐ This extension removes that restriction, so certificate-based authentication works for both the client and the server ๐ซถ If the client wants certificate-based client authentication, it does that by sending the Certificate and CertificateVerify messages, as described in Sections 4.4.2 and 4.4.3 of [RFC8446] ๐ฆ
5.3. Keying Material ๐๏ธ
Section 7.1 of [RFC8446] is where the TLS 1.3 key schedule lives ๐ Successfully negotiating tls_cert_with_extern_psk means the key schedule processing has to include both the external PSK and the (EC)DHE shared secret value. Both ingredients, every time ๐ณ
Now, if the client and server have different values for the selected external PSK identifier, they'll compute different values for every entry in the key schedule ๐ฌ That leads to the client aborting the handshake with a decrypt_error alert. Mismatched keys, mismatched everything ๐
6. IANA Considerations ๐
IANA has updated the "TLS ExtensionType Values" registry [IANA] ๐๏ธ The new entry is "tls_cert_with_extern_psk" with a value of 33, and the messages it may appear in are listed as "CH, SH". Registered and official ๐ธ
7. Security Considerations ๐ก๏ธ
Okay, bestie, this part is serious, so I'm going full focus mode ๐ฅ Pay attention to every bit of it ๐
The Security Considerations in [RFC8446] remain relevant ๐
TLS 1.3 [RFC8446] does not permit the server to send a CertificateRequest message when a PSK is being used. This restriction is removed when tls_cert_with_extern_psk is offered by the client and accepted by the server. However, TLS 1.3 does not allow an external PSK to be used the same way as a resumption PSK, and this extension doesn't change those restrictions ๐
โโ๏ธ So a certificate MUST NOT be used with a resumption PSK. Hard stop ๐
Implementations must protect the external pre-shared key (PSK) ๐ Compromise of the external PSK will make the encrypted session content vulnerable to the future development of a large-scale quantum computer ๐ฑ The generation, distribution, and management of external PSKs is out of scope for this specification, though, so that's on you ๐งพ
Implementers should not transmit the same content on a connection protected with an external PSK and on a connection that isn't. Doing so may let an eavesdropper correlate the connections, which would make the content vulnerable to the future invention of a large-scale quantum computer ๐
Implementations must generate external PSKs with a secure key-management technique, such as pseudorandom generation of the key or derivation of the key from one or more other secure keys ๐ Using inadequate pseudorandom number generators (PRNGs) to generate external PSKs can result in little or no security. An attacker may find it much easier to reproduce the PRNG environment that produced the external PSKs and search the resulting small set of possibilities, rather than brute-force searching the whole key space ๐ Generating quality random numbers is genuinely hard. [RFC4086] offers important guidance in this area ๐
If the external PSK is known to any party other than the client and the server, then the external PSK MUST NOT be the sole basis for authentication ๐ซ The reasoning is explained in Section 4.2 of [K2016]. When this extension is used, authentication is based on certificates, not the external PSK ๐
In this extension, the external PSK preserves confidentiality if the (EC)DH key agreement is ever broken by cryptanalysis or by the future invention of a large-scale quantum computer โจ As long as the attacker doesn't know the PSK and the key derivation algorithm remains unbroken, the attacker can't derive the session secrets, even if they can compute the (EC)DH shared secret ๐ก๏ธ Should the attacker be able to compute the (EC)DH shared secret, the forward-secrecy advantages usually tied to ephemeral (EC)DH keys stop being relevant. The ephemeral private keys used during a TLS session are destroyed at the end of that session, so the attacker can't access them later. But those private keys would still be recoverable because of the break in the algorithm ๐ญ A more general notion of "secrecy after key material is destroyed" would still be achievable with external PSKs, though, as long as they're managed so they're destroyed once they're no longer needed, and as long as the algorithms using the external PSKs remain quantum-safe ๐
TLS 1.3 key derivation uses the HMAC-based Key Derivation Function (HKDF) algorithm, which depends on the HMAC [RFC2104] construction and a hash function ๐งช This extension provides the desired protection for the session secrets, as long as HMAC with the selected hash function is a pseudorandom function (PRF) [GGM1986] ๐
This specification does not require that the external PSK be known only by the client and server ๐ซ The external PSK may be known to a group. Since authentication depends on the public key in a certificate, other parties knowing the external PSK doesn't enable impersonation. Since confidentiality depends on the shared secret from (EC)DH, other parties knowing the external PSK doesn't enable eavesdropping. However, group members can record each other's traffic and then decrypt it if they ever gain access to a large-scale quantum computer ๐ฌ Also, when many parties know the external PSK, there are many chances for an attacker to steal it. Once an attacker has the external PSK, they can decrypt stored traffic if they ever gain access to a large-scale quantum computer, the same way a legitimate group member could ๐
TLS 1.3 [RFC8446] takes a conservative approach to PSKs: they're bound to a specific hash function and KDF ๐ง By contrast, TLS 1.2 [RFC5246] allows PSKs to be used with any hash function and the TLS 1.2 PRF. So the safest approach is to use a PSK exclusively with TLS 1.2 or exclusively with TLS 1.3. Given one PSK, you can derive one PSK for exclusive use with TLS 1.2 and another for exclusive use with TLS 1.3, using the mechanism specified in [IMPORT] ๐
TLS 1.3 [RFC8446] has received careful security analysis, and the following informal reasoning shows that adding this extension doesn't introduce any security defects ๐ง This extension requires certificates for authentication, but the processing of certificates is unchanged by it. The extension places an external PSK in the key schedule as part of computing the Early Secret. Without this extension, in the initial handshake, the Early Secret is computed as:
Early Secret = HKDF-Extract(0, 0)
With this extension, the Early Secret is computed as:
Early Secret = HKDF-Extract(External PSK, 0)
Any entropy the external PSK contributes can only make the Early Secret better. The External PSK cannot make it worse ๐ For these two reasons, TLS 1.3 keeps meeting its security goals when this extension is used ๐ธโจ
8. Privacy Considerations ๐ซฃ
Okay so, [RFC8446] has an appendix (Appendix E.6) all about identity-exposure attacks on PSKs, and bestie, it is still 100% relevant to everything in this section ๐โจ
This extension uses external PSKs so it can hold up better against attackers who might get their hands on a large-scale quantum computer someday ๐ฎ๐ก๏ธ. It is always paired with the pre_shared_key extension, which sends the PSK identities in plaintext inside the ClientHello message ๐. So if someone is just passively watching traffic, they can see those PSK identities, and that helps them track the people using this extension. Not me being dramatic, it's a real privacy leak ๐ญ๐ซ
9. References ๐
9.1. Normative References
- [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997,
https://www.rfc-editor.org/info/rfc2119. - [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017,
https://www.rfc-editor.org/info/rfc8174. - [RFC8446] Rescorla, E., "The Transport Layer Security (TLS) Protocol Version 1.3", RFC 8446, DOI 10.17487/RFC8446, August 2018,
https://www.rfc-editor.org/info/rfc8446.
9.2. Informative References ๐ง
- [DH1976] Diffie, W. and M. Hellman, "New Directions in Cryptography", IEEE Transactions on Information Theory, Vol. 22, No. 6, DOI 10.1109/TIT.1976.1055638, November 1976,
https://ieeexplore.ieee.org/document/1055638. - [FIPS186] NIST, "Digital Signature Standard (DSS)", Federal Information Processing Standards Publication (FIPS) 186-4, DOI 10.6028/NIST.FIPS.186-4, July 2013,
https://doi.org/10.6028/NIST.FIPS.186-4. - [GGM1986] Goldreich, O., Goldwasser, S., and S. Micali, "How to construct random functions", Journal of the ACM, Vol. 33, No. 4, pp. 792-807, DOI 10.1145/6490.6503, August 1986,
https://doi.org/10.1145/6490.6503. - [IANA] IANA, "TLS ExtensionType Values",
https://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml. - [IEEE1363] IEEE, "IEEE Standard Specifications for Public-Key Cryptography", IEEE Std 1363-2000, DOI 10.1109/IEEESTD.2000.92292, August 2000,
https://ieeexplore.ieee.org/document/891000. - [IMPORT] Benjamin, D. and C. Wood, "Importing External PSKs for TLS", Work in Progress, Internet-Draft, draft-ietf-tls-external-psk-importer-03, 15 February 2020,
https://tools.ietf.org/html/draft-ietf-tls-external-psk-importer-03. - [K2016] Krawczyk, H., "A Unilateral-to-Mutual Authentication Compiler for Key Exchange (with Applications to Client Authentication in TLS 1.3)", CCS '16: Proceedings of the 2016 ACM Communications Security, pp. 1438-50, DOI 10.1145/2976749.2978325, October 2016,
https://dl.acm.org/doi/10.1145/2976749.2978325. - [RFC2104] Krawczyk, H., Bellare, M., and R. Canetti, "HMAC: Keyed-Hashing for Message Authentication", RFC 2104, DOI 10.17487/RFC2104, February 1997,
https://www.rfc-editor.org/info/rfc2104. - [RFC4086] Eastlake 3rd, D., Schiller, J., and S. Crocker, "Randomness Requirements for Security", BCP 106, RFC 4086, DOI 10.17487/RFC4086, June 2005,
https://www.rfc-editor.org/info/rfc4086. - [RFC5246] Dierks, T. and E. Rescorla, "The Transport Layer Security (TLS) Protocol Version 1.2", RFC 5246, DOI 10.17487/RFC5246, August 2008,
https://www.rfc-editor.org/info/rfc5246. - [RFC8017] Moriarty, K., Ed., Kaliski, B., Jonsson, J., and A. Rusch, "PKCS #1: RSA Cryptography Specifications Version 2.2", RFC 8017, DOI 10.17487/RFC8017, November 2016,
https://www.rfc-editor.org/info/rfc8017. - [TRANSITION] Hoffman, P., "The Transition from Classical to Post-Quantum Cryptography", Work in Progress, Internet-Draft, draft-hoffman-c2pq-06, 25 November 2019,
https://tools.ietf.org/html/draft-hoffman-c2pq-06.
Acknowledgments ๐ซถ
Huge thank-yous to Liliya Akhmetzyanova, Roman Danyliw, Christian Huitema, Ben Kaduk, Geoffrey Keating, Hugo Krawczyk, Mirja Kรผhlewind, Nikos Mavrogiannopoulos, Nick Sullivan, Martin Thomson, and Peter Yee for reviewing this and leaving comments ๐. Their work made this doc so much better โจ
Author's Address ๐
Russ Housley Vigil Security, LLC 516 Dranesville Road Herndon, VA 20170 United States of America
Email: housley@vigilsec.com
๐ฆ where this page comes from
- ietf: rfc8773 2020-03
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms