Re: [TLS] Pull request for 1RTT Handshake

Eric Rescorla <ekr@rtfm.com> Fri, 04 July 2014 04:01 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4DB2B1A0522 for <tls@ietfa.amsl.com>; Thu, 3 Jul 2014 21:01:07 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.976
X-Spam-Level:
X-Spam-Status: No, score=-1.976 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, NORMAL_HTTP_TO_IP=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dLBNgl7ibUnb for <tls@ietfa.amsl.com>; Thu, 3 Jul 2014 21:01:00 -0700 (PDT)
Received: from mail-we0-f171.google.com (mail-we0-f171.google.com [74.125.82.171]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 4B8A51B2B82 for <tls@ietf.org>; Thu, 3 Jul 2014 21:00:59 -0700 (PDT)
Received: by mail-we0-f171.google.com with SMTP id q58so1079713wes.30 for <tls@ietf.org>; Thu, 03 Jul 2014 21:00:57 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type; bh=EaJDx21lJefZti4aNNw6STITUTgIcRCrjlJLcNPC30A=; b=mzmB1vJBboCcL3rgfDkYchLSjpIYagyWx7I7yYunj53PUTy6m145a3dP5U5y4nxZR5 4UeBnWrd2rUE+OFVsrESPUDp0gr7R8zfWk3eu6uIgeseesnUF414LWSd1oWMSrcgh8+i ClfG0a3t3cxTs2z7xmnvNWMKGYO08jiiqdjR8gjbWsFLUPLxWPnRFtIzq1CQ2qixBq7N nVnWIzRGBq1dUi0jG3sZHn4sUUGS8Adz+0400rRHqs5276AMa+3kGravsi0JFbQQd22R 22DhJGOsUP0SQOfjsjxQfYBDotlWTkJwJls6Q+VwkKSK8Yu1W3l+olZ2q8Jn96ZLVvUw YdCQ==
X-Gm-Message-State: ALoCoQliygJ5l+nYG2b9CfeCXv2YIU+l3J3ilTRcibvbkynEf8sUhJXwOL+v1dTjAgd4CF2aP9S2
X-Received: by 10.194.238.6 with SMTP id vg6mr9053273wjc.24.1404446457664; Thu, 03 Jul 2014 21:00:57 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.216.57.202 with HTTP; Thu, 3 Jul 2014 21:00:17 -0700 (PDT)
X-Originating-IP: [74.95.2.168]
In-Reply-To: <CACsn0c=2pFnjt2FWryH+N=kLAL7rnWswnqZbH8C4Q1aNM=qsLg@mail.gmail.com>
References: <CABcZeBNTJZo+ua6eV8H1Pwb2MqzD=o20=s+XkiQUL9fftspJrQ@mail.gmail.com> <CACsn0c=2pFnjt2FWryH+N=kLAL7rnWswnqZbH8C4Q1aNM=qsLg@mail.gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 03 Jul 2014 21:00:17 -0700
Message-ID: <CABcZeBNoycR_PCKarK+PkK8rHs0LeO=_9h7_h-GYftOvzZfLKA@mail.gmail.com>
To: Watson Ladd <watsonbladd@gmail.com>
Content-Type: multipart/alternative; boundary="089e013d0b54372e3704fd562ce9"
Archived-At: http://mailarchive.ietf.org/arch/msg/tls/62r9jZrVulRKxasH_TFS9wuIvJ4
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Pull request for 1RTT Handshake
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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/options/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: Fri, 04 Jul 2014 04:01:08 -0000

On Thu, Jul 3, 2014 at 7:29 PM, Watson Ladd <watsonbladd@gmail.com> wrote:

> On Thu, Jul 3, 2014 at 7:54 AM, Eric Rescorla <ekr@rtfm.com> wrote:
> > I've just put up a pull request that makes the first cut changes from
> > the consensus from Denver for 1-RTT handshake without SNI
> > protection. As we discussed, I'm leaving the door open for SNI
> > protection, but since these are separable work items, and this is
> > already a fairly signficant change I wanted to get the 1-RTT stuff
> > down first.
> >
> > The PR can be found at:
> >
> >   https://github.com/tlswg/tls13-spec/pull/52
> >
> > It's still kind of rough and there are a bunch of open issues (and
> > most likely several mistakes) but I think it's clear what direction
> > it's going in.
> >
> > I wanted to explicitly called out some known open issues in the draft,
> > both so I can get feedback/discussion on these and so that people know
> > they haven't been forgotten:
> >
> > - Based on the mailing list and interim discussion and a bunch of
> >   private conversations, I wrote this up as requiring named DHE groups
> >   (and assuming we will want named ECDHE groups). This makes things
> >   quite a bit simpler and seemed like a good idea anyway. I recognize
> >   that I'm a bit ahead of the list consensus here, but my sense is
> >   that this was the emerging consensus.  If there are major objections
> >   to this change, I can rework things otherwise, but I believe it will
> >   make things more confusing.
> >
> > - I have partly removed dh_rsa and dh_dss because they get in the way
> >   of having a common handshake pattern and nobody seemed to want
> >   them. Assuming nobody screams I will do a separate PR to remove them
> >   entirely.
> >
> > - We need to take care that we don't introduce a downgrade issue in
> >   the 2-RTT flow (Figure 2) where the server tells the client he has
> >   sent an incorrect CKE. There are some open issues noted in the draft
> >   about how to do this exactly. Comments welcome.
> >
> > - MT convinced me that the client should be able to make multiple
> >   ClientKeyExchange offers for different parameter sets, so I did
> >   that.
>
> So I don't why a client would change their Client Hello in response to
> a Server Hello, and hence
> why there can be a downgrade.
> The client says "here are my capabilities, and some early guesses as
> to what you want to see"
> If those guesses are incorrect, there is no need for another Hello:
> the server already knows what
> the client wants to tell it, and the client knows what the server would
> see.
>
> There is no state machine issue, because the server knows if it got
> the data or not, and
> the client will know if the negotiated curve and suite were among the
> guesses.
>

I'm not saying that the client should change it's ClientHello, but since
there
are two messages, it could in principle do so, right?

The draft currently requires that the client not do so, in S 7.4.1.2:

      When a client first connects to a server, it is required to send
      the ClientHello as its first message.  The client can also send a
      ClientHello in response to a HelloRequest or on its own initiative
      in order to renegotiate the security parameters in an existing
      connection.  Finally, the client will send a ClientHello when the
      server has responded to its ClientHello with a ServerHello that
      selects cryptographic parameters that don't match the client's
      ClientKeyExchange.  In that case, the client MUST send the same
      ClientHello (without modification) along with the new
      ClientKeyExchange.

Does that seem problematic to you?



> Another misfeature is the Finished message ordering: it slows down one
> side or another.
> If we fix Triple Handshake the right way, it's safe to send data
> before receiving the other
> Finished message.


I'm not following your analysis here as to why this slows things down:

1. The client can't safely send data before it receives the server's
Certificate and CertificateVerify, since that's the first thing that
authenticates the server. These messages are sent in the same flight as the
Finished, so will arrive at more or less the same time.

2. If the server doesn't want client authentication for the data, it can
send data as soon as it receives the client's first flight. If not, then it
needs to wait for the client's Certificate and CertificateVerify, which
again is sent with the client's Finished. [0]

Why does the Finished slow things down in this case? What am I
missing?



>  > - The EarlyData mechanism is a bit overgeneral as opposed to an
> >   explicit ClientKeyExchange extension, but it seems like it's going
> >   to be useful when we do SNI encryption and 0-RTT.
>
> Are we ever going to be able to turn it off? Clients initially will
> use only it for compatibility. Servers will develop bugs
> because clients all use it. Lather, rinse, reiterate.
>

Obviously, that's a potential problem, but it also seems pretty clear
that any extra data has to go in an extension for compatibility.

Best,
-Ekr


[0] DKG points out that the rules might be relaxable if the
server wants authentication for the client's data but might be willing
to send some data, such as a banner message, without client
auth, but let's deal with that later.