Re: [TLS] What does it mean to not include 0-RTT message in the handshake hash?

Eric Rescorla <ekr@rtfm.com> Thu, 24 December 2015 21:49 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 3306E1A6EE8 for <tls@ietfa.amsl.com>; Thu, 24 Dec 2015 13:49:40 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.277
X-Spam-Level:
X-Spam-Status: No, score=-1.277 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001] autolearn=no
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 KWeqEZNsFXDP for <tls@ietfa.amsl.com>; Thu, 24 Dec 2015 13:49:38 -0800 (PST)
Received: from mail-yk0-x22e.google.com (mail-yk0-x22e.google.com [IPv6:2607:f8b0:4002:c07::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6A31A1A6EED for <tls@ietf.org>; Thu, 24 Dec 2015 13:49:38 -0800 (PST)
Received: by mail-yk0-x22e.google.com with SMTP id x184so232509392yka.3 for <tls@ietf.org>; Thu, 24 Dec 2015 13:49:38 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=iwCneAgZ4HxtiowgSnaasj5rIr5BOVTrWZCG1HKxHTM=; b=BwLnk8/rirvQicWMlFUSdhXze+RlGbcVQug4vUTwU0CA1uD/w3B1SkgncCdCCmnHm+ DxTlEm5j4avBgUnJhdzYzAX1J8+vyqPZSX6BjGpRRzzCjDOGMUxZ2/iOb+Jf3yp5Ot1z LuAgrCYT3v9RXLByE/p6iK3+PqD/K3Z5zZjPFeebFCmS3acVoK0+Hm3h1xdNp+R97EE7 XCLNe+bFUl5AY0zGIrQqPRzd8biGlXhm13MZ+uf8417oPIFbKfxBl/gqTk9IqyaZWlfX KNRJZ3zBumpygbtWeBEhkMirCBC3T3W4jmHi6Dt6AFpkYVn06Sef7w226qTNsK4B0TbV 0qlw==
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=iwCneAgZ4HxtiowgSnaasj5rIr5BOVTrWZCG1HKxHTM=; b=KDNp2ZJ6NuOMCxwUcZcACD6Rm/iDqmWGaIJeuddEYcR9P8BaehckApahn5D9EyBSmw /CjB5BKyoJu5O9kqW0bBrpJcn0iWdqAScvZ6pWjLslKbm4g/KZnjYo7uV6FkdY07hPVM wuzTDj9rxkKr/WTXf5qFDjG184Of+quUGf6HXro28y5rlzyK035a9cER66hx60NElENt /DoRtU5IeG28R64psvjgLncYYrVLbYwvRDYXziWqrwWAqbBT/jtMvcIU+2T+IBFdj2Ee pdQq0erjpuA04I1EBMsvM9/hgmmmwSu4CuVcb0giTmfiKXS5vcUZ8WfV6ASg5wNCQtIy eg6Q==
X-Gm-Message-State: ALoCoQl70x/xT7oeM2qDnX8wVdBLtV3yda879eNdgGbjyDsCibKgSB4s7Fe6j7bSBcCbImZsvsSE9E0kGF0HYbQr5YRblYrLgw==
X-Received: by 10.129.153.3 with SMTP id q3mr32854938ywg.231.1450993777602; Thu, 24 Dec 2015 13:49:37 -0800 (PST)
MIME-Version: 1.0
Received: by 10.13.249.197 with HTTP; Thu, 24 Dec 2015 13:48:58 -0800 (PST)
In-Reply-To: <201512241626.41884.davemgarrett@gmail.com>
References: <DM2PR0301MB06555FC15830293E0C4E381AA8E50@DM2PR0301MB0655.namprd03.prod.outlook.com> <CABkgnnVZNbXWX-4xx-tS2nPv34btbPmkQVk2m5pVAP2XJsZ2KA@mail.gmail.com> <DM2PR0301MB065563D16424BA687357EAB3A8E70@DM2PR0301MB0655.namprd03.prod.outlook.com> <201512241626.41884.davemgarrett@gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 24 Dec 2015 16:48:58 -0500
Message-ID: <CABcZeBP4THDJn5djaZpbUcVTLJgugb=h+7Si0k4JeM-2ow1y6w@mail.gmail.com>
To: Dave Garrett <davemgarrett@gmail.com>
Content-Type: multipart/alternative; boundary="94eb2c0bbfaeafa57f0527abd0e5"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/JnRhC-cHlp3FVv7DQMD4aCpUJGQ>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] What does it mean to not include 0-RTT message in the handshake hash?
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: <https://mailarchive.ietf.org/arch/browse/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: Thu, 24 Dec 2015 21:49:40 -0000

On Thu, Dec 24, 2015 at 4:26 PM, Dave Garrett <davemgarrett@gmail.com>
wrote:

> On Thursday, December 24, 2015 03:40:26 pm Christian Huitema wrote:
> > On Monday, December 21, 2015 6:30 PM, Martin Thomson wrote:
> > > On 22 December 2015 at 13:25, Christian Huitema <huitema@microsoft.com
> >
> > > wrote:
> > > >> Unless I'm confused (which is possible given the time of night),
> > > >> the intention, as you say, is to separate out the 0-RTT handshake
> > > >> messages i.e., (cert, cert verify, finished) from the 1-RTT
> computations.
> > > >
> > > > OK. That does not simplify implementations using running hashes...
> > >
> > > It does if you consider the possibility of having to drop the 0-RTT
> data.
> >
> > That's right. In fact, it may be a good idea to add to the spec a
> description of a "Failed 0-RTT handshake." If I understand correctly, the
> following will happen:
> >
> > * Server will receive the client hello, ignore the Early Data Indication
> extension, and proceed as in 1-RTT.
> > * Server will indicate that by not adding an Early Data Indication to
> the server hello.
> > * Server will receive a series of 0-RTT messages that it cannot
> decipher, and just drop the messages.
> > * Client will receive server hello, and proceed as per 1-RTT. Client API
> will signal that 0-RTT data was lost, application may decide to retransmit.
> > * Server may send client authentication requests. Client will have to
> repeat the authentication messages, even if it already sent them as 0-RTT.
> >
> > In that scenario, the handshake hash cannot include the 0-RTT messages,
> since the server does not in fact receive them, and they do not contribute
> to the state of the connection.
> >
> > We can of course debate whether the 0-RTT messages should also not be
> included in the hash if the 0-RTT exchange was successful, the messages
> were received, and they contributed to the state of the connection. If they
> are not included, then the "Finished" HMAC does not offer a protection
> against tampering. This may open the possibility of some kind of
> substitution or replay attack.
> >
> > The failed 0-RTT handshake scenario also has interesting consequences on
> the Record layer. We have a legitimate scenario in which received records
> cannot be decrypted. This should not trigger alarms. And the numbering
> scheme should be robust against these missing records.
>
> Do we have anything that protects against an intermediary stripping 0RTT
> messages from a handshake to force a fallback?
>

Yes:
1. The EarlyDataIndication tells the server that some 0-RTT messages are
coming.
2. The Finished in the 0-RTT flight covers the entire handshake flight,
thus preventing
tampering with those messages.
3. The server's Finished covers the ClientHello, thus preventing tampering
with that.

-Ekr


Could we just make the handshake hash use the encrypted messages,
> regardless of if it can decrypt them? (maybe for all messages?)
>
>
> Dave
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>