Internet Engineering Task Force | M. Ray |
Internet-Draft | PhoneFactor, Inc. |
Intended status: Informational | May 04, 2012 |
Expires: November 03, 2012 |
Transport Layer Security (TLS) Encrypted Handshake Extension
draft-ray-tls-encrypted-handshake-00
This specification defines a Transport Layer Security (TLS) extension which allows endpoints to negotiate the use of encryption with forward secrecy at the beginning of the handshake. Two levels of functionality are defined. Implementations are free to support one or both levels, with the first level incurring no additional computational or round-trip overhead. The TLS cryptographic calculations are unchanged.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on November 03, 2012.
Copyright (c) 2012 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 (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
Although TLS [RFC 5246] provides a variety of cryptographic options for securing application data it exposes an unnecessarily large amount of plaintext during its initial handshake. The server's identity, session resumption data, and session ticket data are all sent in the clear. When client cert authentication is used, the client's identity and the server's list of trusted root CAs is also exposed. Typically the leaked information is sufficient to allow a passive observer to fingerprint the TLS client and server applications in use, and even to learn something about the connection history of the user. This is arguably not a characteristic of an ideal data security protocol.
Currently, the only defined way to fully encrypt a TLS handshake is to first perform an unencrypted TLS handshake as an anonymous client and server and then immediately renegotiate the connection all over again in the new encrypted channel. The overhead this imposes is significant, effectively doubling the number of (relatively expensive) public key operations and requiring several additional round trips. Furthermore, implementations often completely forbid both the initial anon-anon TLS connection as well as client-initiated renegotiation. Consequently, renegotiation is of limited use to endpoints desiring greater protection for their handshake data.
The amount of interesting information sent in the clear will continue to increase as new protocol features and applications are enabled by new TLS extensions. But some interesting new applications may be limited by the lack of encryption during the initial handshake.
In the unmodified TLS handshake, encryption of the record layer begins seemingly as late in the process as possible. The reasons for this design decision are unclear but it seems likely to be an artifact of the historical under-use of ephemeral Diffie-Hellman (DHE) cipher suites at the time (SSLv2 did not support them at all). At the time, the need for the additional computation required by traditional Diffie-Hellman key exchange was considered expensive and for the RC4 cipher (very popular for its efficiency) DHE cipher suites have never even been defined. Before the Server Name Indication (SNI) extension [RFC 6066], it was not possible to serve multiple HTTPS sites from a single IP address, so the specific site to which the user was connecting was effectively already known. There were no TLS extensions to carry interesting plaintext, so there was little interesting plaintext to protect (client certs being a notable exception).
Today we have a greater amount of interesting information present in the handshake, faster hardware, and the far more efficient Elliptic Curve DH algorithms. Some very high-traffic sites are configured to select (EC)DHE cipher suites whenever the option is presented by the client.[XXX cite] There are new extensions being proposed that would benefit from encryption in the handshake.[XXX cite NP(N)] So this appears to be an appropriate time to introduce early encryption via ephemeral key exchange into the handshake.
XXX reference presentation language in 5246 here?
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [RFC2119].
The Encrypted Handshake (EH) extension allows endpoints to perform a key exchange and begin record layer encryption as early in the handshake as possible. Two levels of protection provide flexibility for the client and server (and the implementation) to manage practical considerations and level of effort.
While in general it is not possible to protect pre-authentication data from an active man-in-the-middle type attacker, this extension hides the bulk of the handshake data from a passive observer and can detect active attacks as a failed handshake.
Level one provides encryption with forward secrecy for all data in the Server Hello message (including Server Hello extensions) and all data following. This level incurs no additional computational or round-trip overhead over the traditional handshake and is intended to require minimal changes to the implementation of existing libraries, but it has the limitation that data sent by the client in the Client Hello continues to be sent in the clear.
The second level of implementation encrypts all the same handshake data as the first and additionally encrypts the most interesting parts of the Client Hello (e.g. the extensions), but it requires an additional round trip to the server.
Note that in the following diagrams, an asterisk (*) is used to indicate a optional or situation-dependent messages, while square brackets are placed around the [ChangeCipherSpec] message to reflect its distinct record type.
For reference, the traditional TLS full handshake without Encrypted Handshake looks like this:
Client Server ClientHello --------> ServerHello Certificate* ServerKeyExchange* CertificateRequest* <-------- ServerHelloDone Certificate* ClientKeyExchange CertificateVerify* [ChangeCipherSpec] Finished --------> [ChangeCipherSpec] <-------- Finished Application Data <-------> Application Data
Figure 1. Unencrypted TLS full handshake.
When the use of EH level one has been negotiated, the ServerHello message is split to allow the ChangeCipherSpec record to be sent as soon as possible:
Client Server ClientHello (with EH ext) --------> ServerHello2a [ChangeCipherSpec] ServerHello2b Certificate* ServerKeyExchange* CertificateRequest* <-------- ServerHelloDone [ChangeCipherSpec] Certificate* ClientKeyExchange CertificateVerify* Finished --------> <-------- Finished Application Data <-------> Application Data
Figure 2. TLS full handshake using EH level one.
When the use of EH level two has been negotiated, the ServerHello message is split and the ChangeCipherSpec record is sent early (as in level one). The protocol then performs an additional round-trip in order to allow the complete ClientHello2 to be transmitted within the encrypted channel:
Client Server ClientHello (with EH ext) --------> ServerHello2a <-------- [ChangeCipherSpec] [ChangeCipherSpec] ClientHello2 --------> ServerHello2b Certificate* ServerKeyExchange* CertificateRequest* <-------- ServerHelloDone Certificate* ClientKeyExchange CertificateVerify* Finished --------> <-------- Finished Application Data <-------> Application Data
Figure 3. TLS full handshake using EH level two.
This document defines a new TLS extension, "encrypted_handshake" (having extension type [TBD]), which both negotiates the level of EH implementation used for this handshake as well as transmits the (EC)DH parameters necessary for early key exchange. This extension is sent in both the client-to-server and server-to-client directions, however server acceptance of the use of EH is also indicated by the presence of a ServerHello2a message in response. The "extension data" field of this extension contains one of two different structures, or is empty, depending on the type of the message carrying it.
enum { zero(0), one(1), two(2), inquire(255) } EncryptedHandshakeLevel;
Levels of support are indicated by the following enumeration. However, levels higher than are defined here are reserved for future use and receivers should treat them accordingly.
struct { EncryptedHandshakeLevel client_requested; EncryptedHandshakeLevel client_required; ClientDHParamSet client_dh_params_sets<0..2^16-1>; Extension conditional_extensions<0..2^16-1>; } EncryptedHandshakeInfoCH;
When the extension is carried on the Client Hello message it contains an EncryptedHandshakeInfoCH structure:
struct { EncryptedHandshakeLevel server_max_supported; } EncryptedHandshakeInfoSH;
When the extension is carried on the Server Hello message it contains an EncryptedHandshakeInfoSH structure:
The EH extension MAY be included on the ServerHello2a or ServerHello2b message, or it may be omitted. If present, it MUST be empty.
struct { CipherSuite cipher_suites<2..2^16-2>; uint16 params_size; select (KeyExchangeAlgorithm) { case dh_anon: // [TLS] case dhe_dss: case dhe_rsa: DHParams params; case ec_diffie_hellman: // [RFC 4492] ClientECDiffieHellmanPublic params; }; } ClientDHParamSet;
The ClientDHParamSet structure represents a set of (EC)DH parameters and specifies with which cipher suites they may be used:
This message forms the (unencrypted) first part of the modified Server Hello handshake message when the use of EH level one or level two has been accepted. Its purpose is to transmit to the client the minimum information necessary to complete the key exchange subsequent to a Client Hello which proposed the use of EH.
struct { ProtocolVersion server_version; Random random; CipherSuite cipher_suite; EncryptedHandshakeLevel server_accepted; CompressionMethod compression_method; uint16 params_size; select (KeyExchangeAlgorithm) { case dh_anon: case dhe_dss: case dhe_rsa: ServerDHParams params; // [TLS] case ec_diffie_hellman: ServerECDHParams params; // [RFC 4492] }; Extension extensions<0..2^16-1>; } ServerHello2a;
This message forms the (encrypted) second part of the modified ServerHello handshake message. Its purpose is to transmit to the client the information present in an ordinary ServerHello that was not transmitted in the ServerHello1a.
It is sent by the server subsequent to receiving from the client either:
struct { EncryptedHandshakeLevel server_max_supported; SessionID session_id; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ServerHello2b;
struct { SessionID session_id; select (extensions_present) { case false: struct {}; case true: Extension extensions<0..2^16-1>; }; } ClientHello2;
This message is used to transmit information under encryption that would have otherwise been sent in the clear in the ClientHello. Certain fields such as protocol_version, client_random, and cipher_suite are always necessary in order to proceed with any type of handshake. However, in anticipation of successful negotiation of EH level two, a client MAY elect to leave the session_id field empty and extensions absent in the ClientHello in order to supply them later under encryption in ClientHello2.
TLS provides a means to efficiently resume a previously established session without having to perform any asymmetric crypto or cert validation operations (often referred to as an "abbreviated handshake"). Session resumption generally involves the presence of the same Client/ServerHello extensions as a full handshake, so it has equal need of encryption. EH levels one and two are both compatible with session resumption.
Traditional TLS session resumption without EH looks like this:
Client Server ClientHello --------> ServerHello [ChangeCipherSpec] <-------- Finished [ChangeCipherSpec] Finished --------> Application Data <-------> Application Data
Figure 4. Unencrypted TLS abbreviated handshake.
When the use of EH level one has been negotiated a handshake with session resumption looks like this:
Client Server ClientHello (with EH ext) --------> ServerHello2a [ChangeCipherSpec] ServerHello2b <-------- Finished [ChangeCipherSpec] Finished --------> Application Data <-------> Application Data
Figure 5. TLS abbreviated handshake with EH level one.
With EH level two, the client MAY leave the session_id field empty when it is transmitted in the clear on the ClientHello, and still perform resumption based on the session_id field on ClientHello2. However, if client withholds the session_id value and the server then declines EH level two session resumption will not be possible. But because session resumption depends on the client having had recent prior interaction with the server anyway, this unpredictability is thought unlikely to become an issue in practice.
Client Server ClientHello (with EH ext) --------> ServerHello2a <-------- [ChangeCipherSpec] [ChangeCipherSpec] ClientHello2 --------> ServerHello2b <-------- Finished Finished --------> Application Data <-------> Application Data
Figure 6. TLS abbreviated handshake with EH level two.
XXX TODO possible optimization: the client could indicate that it wants to allow resumption without involving the key exchange. This would seem to leave any ServerHello extensions completely in the clear. But many extensions seem to be ignored or are required to hold identical values on resumption, if they could be shown to be redundant perhaps they could simply be eliminated.
The client initiates the connection and begins the handshake using the following sequence, after which the connection generally follows the TLS specification.
From the server's perspective, the handshake proceeds as follows:
Implementers of TLS libraries that allow configuration of cipher suites (e.g. a permitted cipher suites list ordered by preference) are encouraged provide a means to configure this list separately for EH-requesting clients. This is to prevent a situation where server support of this extension is restricted by a simple server preference for non-DHE cipher suites.
There are reportedly some defective servers [XXX cite?] that fail in an ungraceful manner if sent a Client Hello message larger than a certain size which is smaller than the defined maximum. Clients wishing to minimize the risk of interoperability with such servers may consider limiting the number of parameter sets they include in the Client Hello, or sending only the smaller ECDH types. It is possible that these noncompliant servers are older and less well-maintained implementations and tend not to support newer features such as ECDH.
XXX allocation of encrypted_handshake Hello extension
XXX allocation of ServerHello2a handshake message id
XXX allocation of ServerHello2b handshake message id
XXX allocation of ClientHello2 handshake message id
Insofar as TLS is inherently a data security protocol, this entire document is about security. However, a few points of concern are probably worth mentioning.
[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. |
[RFC4492] | Blake-Wilson, S., Bolyard, N., Gupta, V., Hawk, C. and B. Moeller, "Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS)", RFC 4492, May 2006. |
[RFC5746] | Rescorla, E., Ray, M., Dispensa, S. and N. Oskov, "Transport Layer Security (TLS) Renegotiation Indication Extension", RFC 5746, February 2010. |
[RFC6066] | Eastlake, D., "Transport Layer Security (TLS) Extensions: Extension Definitions", RFC 6066, January 2011. |