Re: [TLS] KeyUpdate and unbounded write obligations

Eric Rescorla <ekr@rtfm.com> Thu, 01 September 2016 21:33 UTC

Return-Path: <ekr@rtfm.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 EF3C112D0A3 for <tls@ietfa.amsl.com>; Thu, 1 Sep 2016 14:33:24 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 1oi1SwYEmjQ5 for <tls@ietfa.amsl.com>; Thu, 1 Sep 2016 14:33:23 -0700 (PDT)
Received: from mail-yb0-x231.google.com (mail-yb0-x231.google.com [IPv6:2607:f8b0:4002:c09::231]) (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 3AD0412B076 for <tls@ietf.org>; Thu, 1 Sep 2016 14:33:23 -0700 (PDT)
Received: by mail-yb0-x231.google.com with SMTP id 125so33162280ybe.3 for <tls@ietf.org>; Thu, 01 Sep 2016 14:33:23 -0700 (PDT)
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; bh=pXEvFOAD0PbqNObC93rN3vOXF6QKcNPhAxFYYz2Qnsc=; b=IFM2h+sCSh9MJspgxZBtuRWupiPHKZsxqhDpHz0TjDJpf+fJap1yeAA8M7MgTGrcEy ttptWmVpmyO/gb+51QAVvDn85+fQzB43Lh7FFvgxkGt6es/adFe1zB5TTz96OagLZ0fa almq/3cmdWywE4grWt8TIlsgIwpqECoB7UFQTsP6kq/XGy+F9knqDKijcPPvl1fshf2u llFTe+EOdfu9ZlkKJnR5tAI8m9ycri7Osw/FnUAJuLi0oXVpvlj0xd3EAKyeb+zMoYiv fxa+3yh3jDHPwxSv8T7XJNCUZM6M0zUGHBqOWbiraiN8Nm4G0gZWa76CCwlNzTKj1g46 pY3A==
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; bh=pXEvFOAD0PbqNObC93rN3vOXF6QKcNPhAxFYYz2Qnsc=; b=IWtDLvg8PXK3d6W6ryYFsNKzHnQTGpoRYGK7Z0E1/C+OuIbkpy4l+2ZE4EinFPUU5J eeZc+5CcAF66C2t82dBtlm8vlQ4DuIZBbvj2cWH9GX2iR2FMMoWRuYSfK24ui8f7f2x5 1qd4sVhSf2NyNRJ5K9k1Ea6BxoXAxOKkV6zHR/3FZ/4Z+ALhCefebnD28oVeMfYEb+6D kvs6VhLFlR1qcGn49VzwwGI3qLPNjK/wnsiB8aBY/Ta8nOtL4D9uI6HJ/6MzssKNd24c 3s2UEit6EUUZ0xvh2BAW1Kn0ZMUFBI+nhuJugDmbXSAWvsbVf5dYPMiFseiF6HE8sSQu c1GA==
X-Gm-Message-State: AE9vXwOLcufDGXSC5Wp/sdIcoXrF4tONVCBth0NAuuwCc3aTx0slp7U2hSbepYpzIRv3NuczTShEMdLjjk3M6A==
X-Received: by 10.37.64.78 with SMTP id n75mr14335805yba.162.1472765602520; Thu, 01 Sep 2016 14:33:22 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.48.193 with HTTP; Thu, 1 Sep 2016 14:32:41 -0700 (PDT)
In-Reply-To: <20160901212923.wixkxurtmyxmnsi2@LK-Perkele-V2.elisa-laajakaista.fi>
References: <CAMzhQmM+msOti4rChS=dwRpo5YGh4VMpnqQvy4x=GG=rKA7kew@mail.gmail.com> <20160825042343.w6bg6kg75tujhexg@LK-Perkele-V2.elisa-laajakaista.fi> <CAMzhQmPFwE7H5gN-Ua1unGyFCpxh8aZuX4-2u55R0hmLD52FKQ@mail.gmail.com> <CABcZeBNjRvvKWctCy0oNYDpqgFoTck2Ai8iYuVeYQg1d5Jyk-g@mail.gmail.com> <20160828184105.yvrnbispbnpomk4s@LK-Perkele-V2.elisa-laajakaista.fi> <CABcZeBM=3RPpmGygMmrTU8DMNHQo=k0VTweKjCrY53GR3X4p1A@mail.gmail.com> <95C31431-189C-41ED-A2D2-E370A5FB8F7A@vigilsec.com> <CABcZeBNA_MVO5e-bsnPML4epRjSDVUBf4tewqQ6EY+F1sqooPA@mail.gmail.com> <20160901210952.hj34o2ycel2ssd65@LK-Perkele-V2.elisa-laajakaista.fi> <CABcZeBPNrNziYoE7T9UcjxUYZr4RN3COm=hazikAsmVF6A11_A@mail.gmail.com> <20160901212923.wixkxurtmyxmnsi2@LK-Perkele-V2.elisa-laajakaista.fi>
From: Eric Rescorla <ekr@rtfm.com>
Date: Thu, 01 Sep 2016 14:32:41 -0700
Message-ID: <CABcZeBNkS+0R-gpRAt2AOJpeoyJSrR6E_L_R7SpMfJ310Q28rQ@mail.gmail.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
Content-Type: multipart/alternative; boundary="001a11c03ea093928d053b78f66c"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/WeTLXZhyRttB91mGm7YW5Y4Av8c>
Cc: IETF TLS <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, 01 Sep 2016 21:33:25 -0000

On Thu, Sep 1, 2016 at 2:29 PM, Ilari Liusvaara <ilariliusvaara@welho.com>
wrote:

> On Thu, Sep 01, 2016 at 02:20:02PM -0700, Eric Rescorla wrote:
> > On Thu, Sep 1, 2016 at 2:09 PM, Ilari Liusvaara <
> ilariliusvaara@welho.com>
> > wrote:
> >
> > > I tried to implement this, and discovered an issue:
> > >
> > > The client handshake traffic secret is needed for deriving client
> > > Finished, and client application traffic secret is only needed after
> > > that point. However, the derivation of client application traffic
> > > secret uses handshake hash post Server Finished.
> > >
> > > So you either need to buffer the handshake hash value, or have two
> > > overlapping client traffic secrets.
> > >
> > > Changing the client application traffic secret context to extend
> > > up to Client Finished would solve the issue.
> > >
> >
> > Hmm.... having the keys in one direction cover the client's certificate
> and
> > certverify
> > and the keys in the other direction not seems pretty sketchy.
> >
> > As I understand this, it's just an aesthetic issue, right?
>
> I don't think this is just aesthetic issue:
>

Perhaps I should have said "minor implementation inconvenience"


- If you derive the traffic secret at the moment the right hash is
>   available, you need to stash the traffic secret for later (one
>   can't overwrite the existing one, since you will need that for
>   ClientFinished).
>

Yes, but this was already true for handshake_secret, no?

-Ekr

- If you derive the traffic secret just before use, you need to
>   have saved the hash value used for derivation, since the
>   ClientFinished (and possibly Certificate(Verify)) has altered it.
>
>
> -Ilari
>