Re: [TLS] Issue #964: Shortened HKDF labels

Eric Rescorla <ekr@rtfm.com> Mon, 24 April 2017 22:05 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 B9EEE131949 for <tls@ietfa.amsl.com>; Mon, 24 Apr 2017 15:05:22 -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 AKub15zgT-9T for <tls@ietfa.amsl.com>; Mon, 24 Apr 2017 15:05:21 -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 119D013194C for <tls@ietf.org>; Mon, 24 Apr 2017 15:05:21 -0700 (PDT)
Received: by mail-yb0-x231.google.com with SMTP id 6so62253614ybq.2 for <tls@ietf.org>; Mon, 24 Apr 2017 15:05:21 -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=y3ypO3G7UvqHaJtQUe6dGDyJHwwgPdyeih1amJ1K38s=; b=1bbwDMLvlAwNtaP/AR9psQU23Pp4rOcsV28zGgAJSqDQPYCOVo2bKs3hng9yf6rAtk 5m3h1fSCQVl1248IH3/+VKqlLpVYTtEJU9+wqYthknr6E0Flz6Fdjq6mzeYVLE/LaYcv +IxmtNAnYUeu7Y82IikHKjKUGGjNITBTKUi4q3uxe69cWVwmIWbLR+gSOeBFuGucy8v5 zbUFAMEm4dPVQ+iSt87wVgwVtANR3lYXAYzEYfT3CwGpJ1jxeV3QS+2FKxmCfYe+2zyW yBCf1DHESNLWABhFX0wo8gECuGI4++3m0qJg8sGwgOer1s5vIA/nghT8MCDhJH3Xr0SU HYMQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=y3ypO3G7UvqHaJtQUe6dGDyJHwwgPdyeih1amJ1K38s=; b=Nh43uboxrMrL2lePk40aDX/Z1hsFAfS2iS3TGmSzRR3ZaU4Eotlyzhm4+DvyedC68t vGhg4zZ7hmfG61+bWeAbPMC9jVteduaCal7Nev94mpJJtIyPfsTiGXAPJaV3agv7MCWG fCMoqHf3ZGKu9GTlVLsHxd9HvM6ogViaR4qAyhLqb6CKeVn/xWkOubYn0X/Uac+9Xs/Q 5f2tz8MwJ8IYDWSpzEQoUdPxzZ6WTChH4nwOXjodH6yuo2YOLgR3BBLnM26cU7P+S3VY lnBVDGfg3cQt5vWhV3HdtGT+M7SCbDe2RMo5i1U9Sr/ceEsKIC1XeE8M0RiWM9v+hVDx LKcA==
X-Gm-Message-State: AN3rC/5OcBwcLrH3Nx9s0F92u9crgkN0jjURQMbThZBJdO7wDYR1f7DU bmnliEwNQbKq2r41C56hY7nHMzEnnQ==
X-Received: by 10.37.179.30 with SMTP id l30mr6881783ybj.107.1493071520289; Mon, 24 Apr 2017 15:05:20 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.113.7 with HTTP; Mon, 24 Apr 2017 15:04:39 -0700 (PDT)
In-Reply-To: <201704241657.30874.davemgarrett@gmail.com>
References: <CABcZeBP_0d+14_3SQ3sk+knytxpo4yxq5eYwGn++GC8H9BpUfw@mail.gmail.com> <20170424161619.GA18783@LK-Perkele-V2.elisa-laajakaista.fi> <CABcZeBMriYeFZO5OJnBZvDbhw57V0F5_SBXwvcq8FAXTASa9Bw@mail.gmail.com> <201704241657.30874.davemgarrett@gmail.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 24 Apr 2017 15:04:39 -0700
Message-ID: <CABcZeBOGqXfFp3kqqvurkw6Y53xYyoJxP=+RTTY1X=yq-C0v0g@mail.gmail.com>
To: Dave Garrett <davemgarrett@gmail.com>
Cc: "tls@ietf.org" <tls@ietf.org>, Ilari Liusvaara <ilariliusvaara@welho.com>
Content-Type: multipart/alternative; boundary="f403045f2abe977e27054df0cd8a"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/XqeViUgetiFZs4rj-yxUyp6qWKA>
Subject: Re: [TLS] Issue #964: Shortened HKDF labels
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.22
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: Mon, 24 Apr 2017 22:05:23 -0000

On Mon, Apr 24, 2017 at 1:57 PM, Dave Garrett <davemgarrett@gmail.com>
wrote:

> On Monday, April 24, 2017 12:39:32 pm Eric Rescorla wrote:
> > 9 bytes seems a bit cramped. What I suggest here is that we remove the
> "TLS
> > 1.3, ", as it was just there by analogy to the handshake context and then
> > we are back to having 18 bytes.
> >
> > If people feel like we should have some "TLS" prefix, I think "TLS "
> would
> > be enough, giving us 1 bytes.
>
> (assuming you mean 14 bytes here)
>
> If I remember correctly, in some discussion quite a while back, we decided
> we wanted to bake the version number into the labels.


I don't remember there really being a reason for that...


This could be done more compactly by adding a ProtocolVersion value (2
> bytes) to the HkdfLabel struct. "TLS" could be stuck in there as a static 3
> byte opaque string, with no length or space. (yeah, the combined plaintext
> will go "TLSclient hs traffic", but nobody needs to care)
>

How is this better than "TLS13client hs traffic" in the label?

Note that we could do "T13"...


With ProtocolVersion + "TLS" + dropped length byte, that results in a label
> space of 14 bytes, whilst still keeping the version number baked into the
> label directly.
>
> An extra couple of bytes could even be salvaged out of the HkdfLabel
> struct by ditching the lengths of the 'label' and 'hash_value' fields,
> though going this far may be overkill.


That seems very dangerous.

-Ekr


>
>
> Dave
>