Re: [TLS] KeyUpdate and unbounded write obligations

Ilari Liusvaara <ilariliusvaara@welho.com> Thu, 25 August 2016 04:23 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A825012D58A for <tls@ietfa.amsl.com>; Wed, 24 Aug 2016 21:23:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.448
X-Spam-Level:
X-Spam-Status: No, score=-2.448 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.548] autolearn=ham autolearn_force=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 t2iAG8xWO1l3 for <tls@ietfa.amsl.com>; Wed, 24 Aug 2016 21:23:56 -0700 (PDT)
Received: from welho-filter1.welho.com (welho-filter1.welho.com [83.102.41.23]) by ietfa.amsl.com (Postfix) with ESMTP id C511712D1AD for <tls@ietf.org>; Wed, 24 Aug 2016 21:23:55 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter1.welho.com (Postfix) with ESMTP id DDC8BF468; Thu, 25 Aug 2016 07:23:53 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp3.welho.com ([IPv6:::ffff:83.102.41.86]) by localhost (welho-filter1.welho.com [::ffff:83.102.41.23]) (amavisd-new, port 10024) with ESMTP id QFjaJ1RjudIq; Thu, 25 Aug 2016 07:23:53 +0300 (EEST)
Received: from LK-Perkele-V2 (87-100-177-32.bb.dnainternet.fi [87.100.177.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by welho-smtp3.welho.com (Postfix) with ESMTPSA id 935CD2310; Thu, 25 Aug 2016 07:23:53 +0300 (EEST)
Date: Thu, 25 Aug 2016 07:23:44 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Keith Winstein <keithw@cs.stanford.edu>
Message-ID: <20160825042343.w6bg6kg75tujhexg@LK-Perkele-V2.elisa-laajakaista.fi>
References: <CAMzhQmOmOou6SvmZygJ6emfn2xAnU_jT7zb005fD4NRuOLmnPg@mail.gmail.com> <CAMfhd9UQaiWH_CAKNUMymARJAsWv4+3AatjgNEqrD78-rakubA@mail.gmail.com> <CAMzhQmMnG2cgbfOZE0VDgFRpF15B+yjx2E5G-V2fh2TwLiDcBQ@mail.gmail.com> <CAMfhd9UQ3jHLcUObBORi0Z_QQi2n4-fL9_KCwLvcDKTkJN1z5A@mail.gmail.com> <CAMzhQmMaBp0sPca9xb9jVrC=mjtZ8Rq3FnH8R8x6jcOxBO=9nA@mail.gmail.com> <CAMfhd9XxLq-S6c5K-JE50Wgm24JHihN++OawnVgQueMM8BuGuA@mail.gmail.com> <7e9c315a-f0e6-f547-e5e9-a3f48f8d12ff@cs.tcd.ie> <CAMzhQmN8=pw4LGHtZHyRQcVsx4DGwE89GNpHPUSENfbxcTHwRA@mail.gmail.com> <974CF78E8475CD4CA398B1FCA21C8E99565C26C5@PRN-MBX01-4.TheFacebook.com> <CAMzhQmM+msOti4rChS=dwRpo5YGh4VMpnqQvy4x=GG=rKA7kew@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
In-Reply-To: <CAMzhQmM+msOti4rChS=dwRpo5YGh4VMpnqQvy4x=GG=rKA7kew@mail.gmail.com>
User-Agent: Mutt/1.6.2-neo (2016-08-21)
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/fbkmMaRHHv5Rx3BlBolAv3dBTFU>
Cc: Adam Langley <agl@imperialviolet.org>, "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] KeyUpdate and unbounded write obligations
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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, 25 Aug 2016 04:23:59 -0000

On Wed, Aug 24, 2016 at 04:01:45PM -0700, Keith Winstein wrote:
> Hi Subodh,
> 
> Interesting points.
> 
> On the form of the generation identifier: The draft does already
> specify the generations as integers (traffic_secret_N, N+1, etc.), and
> the semantics of a KeyUpdate are that when you receive one, you
> increment the generation of the receive key. So the proposed
> "receive_generation" field is really just echoing the generation
> number back. I could imagine a different system where the KeyUpdate
> instead includes an opaque identifier, and the receiving
> implementation is then supposed to echo back the most recent opaque
> identifier that it got. That would also provide Property P3, and so I
> would be totally fine with it. But now we're talking about adding
> *two* fields to a KeyUpdate (the sender's opaque identifier, and also
> an echo of the most recently received opaque identifier), instead of
> one field, so I'd be surprised if there were more consensus around
> this alternate approach!

The generations are not specified as integers. It is just some abstract
sequence (nowhere in protocol is that generations are integers used).

And echoing identifiers doesn't work. The key updates can cross in
flight, so neither is after one another.

> On the API that a TLS implementation would expose: Obviously the WG
> doesn't have to specify this, but here are three APIs I could imagine:
> 
> (1) No change to current APIs. The TLS implementation itself triggers
> KeyUpdate when it wants to (e.g. per recommendation on when the
> underlying cipher wants to be rekeyed), but doesn't expose this to the
> application.

The intended application of KeyUpdate is mostly this, with optional
knobs controlling the frequency of rekeying.

> (2) Fire-and-forget. The TLS implementation exposes a
> `rekey_session()` function, which initiates a KeyUpdate. [If we adopt
> the proposal described earlier in this thread, maybe there's a boolean
> parameter about whether to request a reciprocal rekey from the other
> side...]

Due to design, one can't do a reciproal rekey.
 
> (3) Fire-and-later-check. The TLS implementation exposes #2 above, but
> also `tls_session_generations()`, which returns a pair of integers
> giving the current sending and receiving generations.
> 
> Any application we might want to build can be built on top of #3.

Nope, the KeyUpdate is designed to deal with arbitrary latency in
order to fully decouple the direction (any coupling there would lead
to API problems, which apparently are more major than I initially
thought).

And if that is combined with request-response protocol, if you just
send a KeyUpdate without application data, the response will NEVER
come.


-Ilari