Re: [TLS] confirming the room’s consensus: adopt HKDF PRF for TLS 1.3

Watson Ladd <watsonbladd@gmail.com> Wed, 22 April 2015 22:00 UTC

Return-Path: <watsonbladd@gmail.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 3D5E41B2AD3 for <tls@ietfa.amsl.com>; Wed, 22 Apr 2015 15:00:18 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.699
X-Spam-Level:
X-Spam-Status: No, score=-1.699 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, MIME_8BIT_HEADER=0.3, SPF_PASS=-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 jlz-Kqo75ys3 for <tls@ietfa.amsl.com>; Wed, 22 Apr 2015 15:00:16 -0700 (PDT)
Received: from mail-wg0-x236.google.com (mail-wg0-x236.google.com [IPv6:2a00:1450:400c:c00::236]) (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 A443F1B2AD4 for <tls@ietf.org>; Wed, 22 Apr 2015 15:00:15 -0700 (PDT)
Received: by wgyo15 with SMTP id o15so261288610wgy.2 for <tls@ietf.org>; Wed, 22 Apr 2015 15:00:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=TBr+RSuRvN3wdXi+13Y4vD+KtNmywsYjM0FnbCWtYd4=; b=DyxL9ELwr0q+u/BANr42gOex0HZ/FKLSf5DwABNgnyVdxbE/k9TY8xE5XUYFzphSqk jBxkl8G/UM3ZMYtEH08WjEe656+5S0D3KXrCl8ENTW8n73JtPsQnCKl2DMUKbWozQLVT 7En4yvfD1h/TAVqVCCIzu68LvVDKMu1oqrnJKEfBesGbxvJ52V0JLgxi9mHOhTkuHspo +5YwniDTSSfnyF8QfmLA2InVzzT7TkLK6wlBmaXEi44l2KSUUYqPVpXXju8ciI4xc/2Y 73lfpJCc/teVw1vlPbbP9e9kO+ny/HwwtaJZNzke/PQfENW3R+Sfr++G12FtDVYf+QlP QOdA==
MIME-Version: 1.0
X-Received: by 10.180.105.233 with SMTP id gp9mr9899231wib.83.1429740014368; Wed, 22 Apr 2015 15:00:14 -0700 (PDT)
Received: by 10.194.20.97 with HTTP; Wed, 22 Apr 2015 15:00:13 -0700 (PDT)
Received: by 10.194.20.97 with HTTP; Wed, 22 Apr 2015 15:00:13 -0700 (PDT)
In-Reply-To: <55381768.8010402@nthpermutation.com>
References: <4A5C6D8F-6A28-4374-AF1F-3B202738FB1D@ieca.com> <551DDD4E.5070509@nthpermutation.com> <F7F3EB83-FEA2-477C-8810-38C49B71C977@ieca.com> <551E290D.7020207@nthpermutation.com> <55381768.8010402@nthpermutation.com>
Date: Wed, 22 Apr 2015 15:00:13 -0700
Message-ID: <CACsn0cm5A50dP4JDKq9R0XdB83hyzPPLQHAMnUcXFb+DCSwV7g@mail.gmail.com>
From: Watson Ladd <watsonbladd@gmail.com>
To: Michael StJohns <msj@nthpermutation.com>
Content-Type: multipart/alternative; boundary=f46d0442883ead7d780514574973
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/47XqmghpW29o8ZMGghDood33UgM>
Cc: tls@ietf.org
Subject: Re: [TLS] =?utf-8?q?confirming_the_room=E2=80=99s_consensus=3A_adopt_?= =?utf-8?q?HKDF_PRF_for_TLS_1=2E3?=
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, 22 Apr 2015 22:00:18 -0000

On Apr 22, 2015 2:49 PM, "Michael StJohns" <msj@nthpermutation.com> wrote:
>
> I'm top posting my own post....
>
>
> Sean et al:
>
> After spending a bit more time looking at things from the view point of
HSMs and cryptographic isolation, I'm now of the opinion that HKDF
shouldn't be specified.
>
> The specific issue is the difference between HDKF step 2 and the
SP800-108 expansion functions.   Cryptographically, these specifications
are close to identical except for the inclusion of a mandatory length term
in the mixin values.   Without this term, a key stream produced from the
same mixins (e.g. same label, randoms etc) for the same master key will be
identical regardless of the length of the output key(s).
>
> E.g. if one call to the KDF has a target key of AES128 and another call
to the KDF using the same master key and mixins has a target key of a
single octet HMAC key, the first octet of the AES key will be identical to
that single octet HMAC key.    Using this construct with increasingly
longer HMAC keys (thanks to HMAC's impedance matching function) will
eventually reveal each and every byte of the AES key.

What if the first call for the HMAC key is 128 bits, and we use a broken
variant?

Your example demonstrates why the sane data shouldn't be used for two
different purposes. In fact, it's not clear to me that we can make an HSM
friendly design without telling the HSM which derived values are exportable
and which not.

If we ensured that no value derived by HKDF ever is not used as an
encryption key, this would solve the problem at the cost of some pain with
channel binding. But this would be a very large change.

>
> In an HSM, there is no way to differentiate these two different KDF calls
for legitimacy.
>
> If the KDF mixes in the length of the to be output key material, then any
change in the length of the requested key changes the entire key stream.
>
> I see three different approaches to fix this - 1) specify the SP800-56C
with SP800-108 HMAC, 2) add the length term to the HKDF RFC and republish
it, 3) ensure one or more length terms are included in the "info" for ALL
KDF calls for TLS and document why.
>
>
> Mike
>
>
>
>
> On 4/3/2015 1:45 AM, Michael StJohns wrote:
>>
>> On 4/2/2015 10:04 PM, Sean Turner wrote:
>>>
>>> On Apr 02, 2015, at 20:22, Michael StJohns <msj@nthpermutation.com>
wrote:
>>>
>>>>  I will note that the author claimed in his paper that the IETF was
standardizing this, but I can't find any data suggesting this actually went
through the IETF standardization process (vs independent informational RFC
submission process).  It did garner some review on the CFRG mailing list,
but not to what I normally think of as comprehensive and resolving all
comments.
>>>
>>> The pre-5869 draft was AD sponsored by Tim Polk.  The IETF LC can be
found here:
>>>
>>>
https://mailarchive.ietf.org/arch/msg/ietf-announce/8rYOi-6zUEljAX4XprWbjP7on0s
>>
>> I saw that, but that's for Informational, not Standard.  Different bar.
>>
>>>
>>> We can refer to it normatively if we want to, we just have to make sure
the DOWNREF is explicitly cited, as per RFC 3647.
>>
>> Yup.  But considering that the difference between HKDF vs the
combination of SP800-56C plus SP800-108 section 5.2 is the placement of the
iteration value in what gets HMAC'd and the fact that the HDKF doesn't mix
in the total length of the data to be output,  I'd rather use the latter
cites if we could even if they require an extra paragraph to describe the
selected sizes of L and i and what goes in to Label and Context (basically
"info" by another name).
>>
>> AFAICT, the addition of the L of the output to the data HMAC'd is there
to force a change to the key stream if the length of the output key stream
changes and that's probably a good additional security property.  Other
than that, I would say that these are pretty much identical in
cryptographic composition.
>>
>> Lastly, I still have hopes one day to remove the requirement for the
dependency on a HASH function in the handshake and this construct allows
for a CMAC based MAC.
>>
>>
>> Again - I can live with HKDF, but I'm unclear of why citing the RFC is a
better choice given the above comparison.
>>
>> Thanks - Mike
>>
>> ps - I will write the paragraph for SP800-56C/108 inclusion if you want
if we go that way.
>>
>>
>>>
>>> spt
>>
>>
>
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>