Re: [TLS] 0-RTT (Was: Re: 0-RTT and Anti-Replay)

Nico Williams <nico@cryptonector.com> Wed, 13 May 2015 22:29 UTC

Return-Path: <nico@cryptonector.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 A8B3D1A9062 for <tls@ietfa.amsl.com>; Wed, 13 May 2015 15:29:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.666
X-Spam-Level:
X-Spam-Status: No, score=-1.666 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, IP_NOT_FRIENDLY=0.334, RCVD_IN_DNSWL_NONE=-0.0001] 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 3ORK5XSIZN0E for <tls@ietfa.amsl.com>; Wed, 13 May 2015 15:29:41 -0700 (PDT)
Received: from homiemail-a36.g.dreamhost.com (sub4.mail.dreamhost.com [69.163.253.135]) by ietfa.amsl.com (Postfix) with ESMTP id 34F9F1ACEDE for <tls@ietf.org>; Wed, 13 May 2015 15:29:30 -0700 (PDT)
Received: from homiemail-a36.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTP id 0D790778093; Wed, 13 May 2015 15:29:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=cryptonector.com; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=cryptonector.com; bh=kqam7CMbZclyy+ wIPook4jz98xY=; b=Zi/7VsVw7oqXlLf42diQSZ7ioIr07wxx5iv+uzayZMZ6qT KEAXa7hrKeVOtT5tQgVPpSkP89KNw+NtywPnWuByUZUkHC1DIqdcaelq/sE47SIr S5AHsHp5iT8s59GvIH6hiwW9FgSXvbvqelPVRioGk9UhUIxhbyg2pSdHe3OsQ=
Received: from localhost (108-207-244-174.lightspeed.austtx.sbcglobal.net [108.207.244.174]) (Authenticated sender: nico@cryptonector.com) by homiemail-a36.g.dreamhost.com (Postfix) with ESMTPA id A981177808C; Wed, 13 May 2015 15:29:29 -0700 (PDT)
Date: Wed, 13 May 2015 17:29:29 -0500
From: Nico Williams <nico@cryptonector.com>
To: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Message-ID: <20150513222927.GZ7287@localhost>
References: <CABcZeBP9LaGhDVETsJeecnAtSPUj=Kv37rb_2esDi3YaGk9b4w@mail.gmail.com> <20150412165542.GA19481@LK-Perkele-VII>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <20150412165542.GA19481@LK-Perkele-VII>
User-Agent: Mutt/1.5.21 (2010-09-15)
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/R7wluSO4zmG5ekv9e33NeWD-Nlc>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] 0-RTT (Was: Re: 0-RTT and Anti-Replay)
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: Wed, 13 May 2015 22:29:42 -0000

On Sun, Apr 12, 2015 at 07:55:42PM +0300, Ilari Liusvaara wrote:
> I thought about 0-RTT some more, here are some questions. Few
> might be protocol-relevant, most are only about guidance.
> 
> 1) What is the recommended 0-RTT API model on server side
>    (also consider server apps or app implementations that don't
>    support 0-RTT)?

The app should request 0-RTT data; server should drop it if not
requested before receipt of ClientHello.

> 2) What are the semantics of successfully received 0-RTT transfer
>    (especially considering the client-side autoretransmit on
>    failure)?

Leave it to the app.  A replay cache option would be nice, but the app
probably needs to provide this itself (since, after all, it's not just a
question of "have we seen this before", but also, "have we processed
this before").

> 3) How does 0-RTT interact with ALPN (especially considering
>    potential for multiple protocol candidates)?

The client has committed to an application protocol.

Although that's not necessarily quite so true: elsewhere we're talking
about an RFC2712 (Kerberos in TLS) replacement where ideally we could
start sending GSS-API context tokens as early as possible (when the
client doesn't want confidentiality protection for its name).  Such a
protocol could still negotiate from N>1 application protocols.

(GSS-in-TLS as an application protocol using 0-RTT data is a perfect
example of a *safe* use of 0-RTT data, provided that the intention is to
also do channel binding.  Don't think about GSS too hard here.  Just
think about the point that some 0-RTT uses will be quite safe.)

> 4) Can handshake with attempted 0-RTT be securely downgraded to
>    v1.2 (obviously causes the 0-RTT to fail)?

Sure, but the 0-RTT data must get dropped.

> 5) There is potential footgun if 0-RTT is used with (DH-)PSK: The
>    PSK authenticates the connection immediately, but 0-RTT is
>    as replayable as ever. What to do with that?

0-RTT is a footgun.  Choice of ciphersuite seems a bit beside the point,
though it's possible that positive authentication status of the client
may cause applications to fire the footgun.  I'd insist on the
authentication status not being complete until the handshake completes
in all cases, and I'd insist on pointing out that the 0-RTT data is a
lot of rope.

> 6) The same as above, but when attempting to resume a session.
>    with a client certificate (since cc is property of session)?

Ditto.

> 7) What guidance to give regarding what data can be put to 0-RTT,
>    considering its replayability?

First, that it's replayable.  Second, that the application should only
send such data where doing so is idempotent, or where it is part of
something like an application-layer authentication protocol that will do
its own replay protection, or where the application has its own replay
detection cache.

> 8) If resumption attempt has 0-RTT data, what keying material is
>    used for the 0-RTT?

In principle, none.  However, a key derived from the resumption ticket's
session key would be nice.  See below.

The PSK case could be similar as well.

> 9) Can server roll over its 0-RTT keys without waiting for the
>    previous ones to expire?

In relation to (8)?  No.  But we could do something where we use
timestamps, a la Kerberos, to greatly reduce the time window that any
replay caches have to protect, at least for session resumption 0-RTT
data!

> 10) How is attacker establishing a session (or at least decoding
>     server's first application flight) replaying captured
>     0-RTT data prevented (since that could leak quite a bit of
>     info about what's in 0-RTT blob)? Or not?

IIUC, it isn't.

Nico
--