RFC 6358

Additional Master Secret Inputs for TLS

πŸ“… published January 2012, from ietf

RFC 6358: Additional Master Secret Inputs for TLS πŸ’–βœ¨

Okay bestie, this one is from the IETF, and it was written by Paul Hoffman of the VPN Consortium πŸŽ€. It's dated January 2012 and it's an Experimental doc πŸ§ͺ, which means it's published for people to try out and poke at, not as a full Internet Standard. It's a product of the IETF and went through the whole consensus and IESG approval thing 🫢. The ISSN is 2070-1721 πŸ“š. It doesn't obsolete anything and it doesn't update anything 🌸.


Abstract πŸ¦‹

Here's the tea: this doc is about a way to use extra "additional master secret inputs" with Transport Layer Security (TLS) and Datagram TLS (DTLS) πŸ”βœ¨. Iconic, right?


Status of This Memo πŸ“œ

Okay so, this is not an Internet Standards Track spec πŸ™…β€β™€οΈ. It's published for examination, experimental implementation, and evaluation πŸ§ͺ. It defines an Experimental Protocol for the Internet community 🌈. It's a product of the IETF, it reflects IETF consensus, it got public review, and the IESG approved it for publication πŸ‘‘. Not every IESG-approved doc is a candidate for any level of Internet Standard, so check Section 2 of RFC 5741 for that πŸ’….

For the latest status, errata, and feedback info, you can look at http://www.rfc-editor.org/info/rfc6358 πŸ“.


Copyright (c) 2012 IETF Trust and the persons identified as the document authors. All rights reserved πŸ’œ.

This doc is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) as of the publication date πŸ“. Read those carefully, bestie, because they explain your rights and restrictions πŸ™ˆ. Code pulled out of this doc has to include Simplified BSD License text, as described in Section 4.e of the Trust Legal Provisions, and it comes with no warranty 🫧.

This doc might include material from IETF Documents or Contributions published before November 10, 2008 πŸ•°οΈ. Some of that copyright might belong to people who never gave the IETF Trust permission to allow changes outside the IETF Standards Process 😭. So without an adequate license from those copyright holders, this doc can't be modified outside the IETF Standards Process, and derivative works can't be made outside it either. The exceptions are formatting it as an RFC or translating it into languages other than English 🌍.


1. Introduction πŸŽ€

Okay, so some TLS 1.2 [RFC5246] and DTLS 1.2 [RFC6347] extensions want to mix particular data into the calculation of the master secret 🧁. This mixing creates a cryptographic binding of the added material right into the secret that protects the TLS session πŸ”’. For example, some systems want to be sure there's enough randomness in the TLS master secret, and adding it straight into the master secret calculation is how they get that 🎲✨.

This doc describes a framework for TLS and DTLS extensions to meet these needs πŸ’…. In an extension that uses this framework, a client and server provide data in the handshake using normal TLS extensions, and then that data gets combined with the ClientHello and ServerHello random values while the master_secret is derived 🧚.

Extensions that specify data to be added to the master secret are called "extensions with master secret input" πŸ’œ. An extension with master secret input MUST specify the additional input that comes from the client and/or the server 🫢. The "and/or" is there on purpose, because the extension's definition might mean the input only comes from one of the two participants πŸ™ˆ.

Quick note, because it matters: extensions that don't say they're extensions with master secret input CANNOT be extensions with master secret input 🚫. So anything that doesn't call itself one is treated just like a normal extension πŸ’–. Also, this doc only describes a framework πŸ¦‹. If an extension uses it and both the client and server implement that extension, no signaling about master secret input is needed, because it comes as part of the extension definition itself ✨.

Using one or more of these extensions changes how the master secret gets calculated in TLS and DTLS 🌸. So if the handshake has no extensions, or only extensions that aren't extensions with master secret input, the master secret calculation stays exactly the same πŸ“.

1.1. Conventions Used in This Document πŸ“–

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this doc are to be interpreted as described in [RFC2119] πŸ’…πŸŒˆ.


2. Master Secret Calculation Modifications for TLS and DTLS πŸ”

When an extension with master secret input is in the handshake, the additional master secret input values MUST be mixed into the pseudorandom function (PRF) calculation along with the client and server random values while the master secret is computed 🧁. For the master secret calculation, the extensions MUST be sorted by extension type order πŸŽ€. TLS 1.2 says there can only be one extension per type, and the extensions can show up in mixed order πŸ™ƒ.

Each extension with master secret input adds its own specified input πŸ’œ. It's called "additional_ms_input_1" for the extension with master secret input that has the lowest type number, "additional_ms_input_2" for the one with the second lowest type number, and so on πŸ¦‹.

The master secret calculation becomes:

   master_secret = PRF(pre_master_secret, "master secret",
                       ClientHello.random +
                       ClientHello.additional_ms_input_1 +
                       ClientHello.additional_ms_input_2 +
                       . . .
                       ClientHello.additional_ms_input_N +
                       ServerHello.random +
                       ServerHello.additional_ms_input_1 +
                       ServerHello.additional_ms_input_2 +
                       . . .
                       ServerHello.additional_ms_input_N +
                       )[0..47];

Using the specified order of the additional_ms_input_n fields in the master_secret is REQUIRED for interoperability 🫢. Otherwise, a server and a client wouldn't know how to unambiguously calculate the same master_secret 😭.

Heads up, bestie: that order is a must-have. If the fields aren't in the specified order, the client and server won't land on the same master_secret πŸ’€.

3. Security Considerations πŸ›‘οΈ

This modification to TLS and DTLS increases the amount of data an attacker can inject into the master secret calculation 😱. That could potentially let an attacker who had partially compromised the inputs to the master secret calculation have a bigger say in the output πŸ‘€. Hash-based PRFs like the one used in TLS master secret calculations are designed to be pretty indifferent to input size 🧠.

The additional master secret input might have no entropy at all; in fact, it could be completely predictable to an attacker πŸ™ˆ. TLS is designed to keep working even when the PRF used in the master secret calculation has a lot of predictable material, because the PRF generates distinct keying material for each connection πŸ”‘. So even with completely predictable additional master secret input values, no harm is done to the resulting PRF output 🫧. When there is entropy in these values, that entropy shows up in the PRF output ✨.


4. Acknowledgments 🌷

Much of the text in this doc is derived from text written by Eric Rescorla, Margaret Salter, and Jerry Solinas πŸ’–.


5. Normative References πŸ“š

   [RFC2119]   Bradner, S., "Key words for use in RFCs to Indicate
               Requirement Levels", BCP 14, RFC 2119, March 1997.

   [RFC5246]   Dierks, T. and E. Rescorla, "The Transport Layer Security
               (TLS) Protocol Version 1.2", RFC 5246, August 2008.

   [RFC6347]   Rescorla, E. and N. Modadugu, "Datagram Transport Layer
               Security version 1.2", RFC 6347, January 2012.

Author's Address πŸŽ€

Paul Hoffman VPN Consortium

EMail: paul.hoffman@vpnc.org πŸ’Œ

πŸ“¦ where this page comes from