Re: [TLS] Ephemeral key exchange in TLS Snap Start (was RE: TLS Snap Start)

"Brian Smith" <brian@briansmith.org> Tue, 10 August 2010 15:48 UTC

Return-Path: <brian@briansmith.org>
X-Original-To: tls@core3.amsl.com
Delivered-To: tls@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id C3A053A67A1 for <tls@core3.amsl.com>; Tue, 10 Aug 2010 08:48:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.386
X-Spam-Level:
X-Spam-Status: No, score=-0.386 tagged_above=-999 required=5 tests=[AWL=-0.387, BAYES_50=0.001]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xIBIi0Dmmeoc for <tls@core3.amsl.com>; Tue, 10 Aug 2010 08:48:55 -0700 (PDT)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) by core3.amsl.com (Postfix) with ESMTP id 13B3E3A6884 for <tls@ietf.org>; Tue, 10 Aug 2010 08:48:54 -0700 (PDT)
Received: from T60 (unknown [98.200.150.199]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id BA5F0509DD; Tue, 10 Aug 2010 11:49:23 -0400 (EDT)
From: Brian Smith <brian@briansmith.org>
To: 'Adam Langley' <agl@google.com>
References: <001201cb1c6b$b24f9730$16eec590$@briansmith.org> <AANLkTil_u_ZUj-suzrdJryzS7cIqofFLGIwXUk2eIB4x@mail.gmail.com> <001301cb3100$ef203ee0$cd60bca0$@briansmith.org> <AANLkTimM=mRqCMqvO+vCR_t==Wjz1Jd5jMM_43-6sAbS@mail.gmail.com>
In-Reply-To: <AANLkTimM=mRqCMqvO+vCR_t==Wjz1Jd5jMM_43-6sAbS@mail.gmail.com>
Date: Tue, 10 Aug 2010 10:49:22 -0500
Message-ID: <003c01cb38a3$9d5c55d0$d8150170$@briansmith.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 14.0
Thread-Index: AQG/yiGAso7HZOsbN9ePveYgcrF8tAIKWdVtASYzm2UCcRh8AwFUymAk
Content-Language: en-us
Cc: tls@ietf.org
Subject: Re: [TLS] Ephemeral key exchange in TLS Snap Start (was RE: TLS Snap Start)
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.9
Precedence: list
List-Id: "This is the mailing list for the Transport Layer Security working group of the IETF." <tls.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/tls>
List-Post: <mailto:tls@ietf.org>
List-Help: <mailto:tls-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/tls>, <mailto:tls-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Aug 2010 15:48:56 -0000

Adam Langley wrote:
> On Sat, Jul 31, 2010 at 6:37 PM, Brian Smith <brian@briansmith.org> wrote:
> > 1. An extension (or new cipher suites) for indicating that the (EC)DH
> parameters in a ServerKeyExchange message are not really ephemeral, but
> rather are reusable for a certain duration of time. This part could be used reused
> independently of the other parts.
> 
> I believe that this is isomorphic to (EC)DH_(RSA|DSS). Although I must admit that
> I've never seen a fixed DH TLS connection, and a brief check of the RFC wasn't
> enlightening. I'm not aware of the standard format for (EC)DH_(RSA|DSS)
> certificates, although I suppose that the
> X.509 PublicKey field is flexible enough to admit a fixed DH value.

A certificate with fixed D-H parameters (ECDH or DH) puts the D-H parameters in the public key field. The _RSA|_DSS|_ECDSA at the end simply refers to the signature algorithm used to signed the certificate by the CA. That means you cannot use the same certificate for ECDH_RSA and RSA or for DH_RSA and RSA, because the public key formats don't match. So, if you want to support fixed D-H parameters AND also support regular RSA key exchange, you need TWO certificates, at least. And, you need a server that is willing and able to choose a certificate based on the negotiated cipher suite, which Apache/mod_ssl/OpenSSL cannot even do, and which many clients (including NSS and many other very popular ones) do not support. So, it isn't surprising that we don't see fixed DH parameter certificates in the wild. Further, I searched around and I could not find any indication from *any* commercial CA that they would be willing to issue a certificate with a ECDH, DH, or general-purpose ECC (which allows ECDH and ECDSA) public key.

But, even without those obstacles, there is another major one: rotating encryption keys by replacing certificates is a very tedious and error-prone manual process that has no tools available to automate it. And, setting up this kind of certificate rotation seems beyond what we can reasonably expect typical web server administrators to understand and care about, as the vast majority of documentation on configuring a SSL server is of the form "Here's the bare minimum to get a client to connect; don't touch anything after you see it working."

> If the server
> knew that the client could trust the fixed DH value via another means (i.e.
> DNSSEC) then the signature of the certificate could be omitted and the
> _(RSA|DSS) part rendered moot.

I agree that DNSSEC seems like a great idea, except we are still very far off from being able to rely on DNSSEC anywhere, and in some parts of the world, DNSSEC may not happen for a very long time. IMO, we can achieve the same effects much faster by creating a new set of "short-term static ECDH" cipher suites that allow one to use a plain old RSA certificate to sign a timestamped set of reusable ECDH parameters that are transmitted in the ServerKeyExchange message--much like ECDHE, but with additional signed parameters indicating the validity of the ECDH parameters.

> > 2. An extension that allows the client to put its ClientKeyExchange in a
> ClientHello extension. For DHE key exchanges, this would depend on the
> preceding extension.
> 
> I believe that the fixed DH value would be included in the client's certificate with
> (EC)DH_(RSA|DSS). Again, probably unsigned.

I think we have some miscommunication here. The vast majority of the time, there will be no client certificate. And, when there is a client certificate, it will almost never have fixed DH parameters. And, when it does have them, they mean something different than what I understand you to mean here.

> > Given #1 and #2, the handshake would be optimized to a sequence similar to
> session resumption, but allowing a request for client authentication:
> 
> (I intended that Snap start already allow for client-side certificates, although
> none of my unittests verify this.)

The current formulation of snap start requires the client to prove proof of possession of the user's private key (i.e. prove the user's identity) before the server identifies itself. This is a problem inherited from regular TLS's RSA key exchange. The (EC)DH(E) cipher suites require the server to prove possession of the server private key first, which is extremely helpful when the user has to decide whether or not to send his certificate. IMO, this means that client certificates shouldn't be used at all with RSA key exchange.

> In general, I see EDH as much more of a spectrum than the dichotomy that I
> often find it presented as. At one extreme, multiple EDH handshakes could be
> performed in a single connection to protect different time spans of that
> connection. At the other, the practice of rotating RSA keys every year provides
> some forward security: a compromise of this year's key doesn't allow for
> retrospective decryption of last year's traffic.

Almost all of the incentives for a server operator are to use RSA key as long as possible, unless they somehow have an understanding of forward secrecy. First, CAs give you deep discounts for buying certificates with longer validity periods (up to five or even ten years). And, nothing forces (and little documentation even encourages) a sysadmin to generate a new RSA private key when renewing certificates. I wouldn't be surprised to find that a huge number of servers on the internet are using the same RSA keys basically in perpetuity. When key rotation does happen, the tools available are so error-prone that they key rotation process itself becomes a very likely point of key compromise. And, how many server private keys get backed up every day, unprotected, in virtually permanent storage? These are the main reasons I advocate against using RSA key exchange. A new "short-term static ECDH" key exchange method would allow a server (cluster) to securely and frequently (e.g. daily) rotate encryption keys, autonomously, in a way that is much less error prone while potentially being much less expensive computationally than RSA key exchange.

> When using ECDHE with a 224-bit curve (or larger), I think key compromise is the
> greatest danger. The work required to calculate discrete logs in such a large
> group suggests that, if accomplished, the attacker probably has such a
> monumental breakthrough (i.e. a quantum computer) that per-connection EDH
> probably isn't going to present much more of a challenge.
> 
> Therefore, rotating a fixed DH value at some frequency may well provide a
> better performance/security trade-off than per-connection EDH.

I agree. 

> (And I'm
> probably pointing out the obvious when I say that DNSSEC seems to provide a
> convenient, dynamic trust base for that.)

It seems unlikely that we will be able to depend on any such mechanism any time soon. I am not even sure that we'll need TLS at the time that such a mechanism becomes generally useful. That's why I think an in-protocol solution is better.

Regards,
Brian