Return-Path: <hugokraw@gmail.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 1DE1C12B15B
 for <tls@ietfa.amsl.com>; Fri,  9 Sep 2016 16:33:55 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.897
X-Spam-Level: 
X-Spam-Status: No, score=-1.897 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001,
 HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001,
 RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001]
 autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
 header.d=gmail.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 XSFt9q01sCyo for <tls@ietfa.amsl.com>;
 Fri,  9 Sep 2016 16:33:53 -0700 (PDT)
Received: from mail-yb0-x22a.google.com (mail-yb0-x22a.google.com
 [IPv6:2607:f8b0:4002:c09::22a])
 (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 BDC8812B041
 for <tls@ietf.org>; Fri,  9 Sep 2016 16:33:52 -0700 (PDT)
Received: by mail-yb0-x22a.google.com with SMTP id u125so33735689ybg.3
 for <tls@ietf.org>; Fri, 09 Sep 2016 16:33:52 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; 
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=19eq6R9IZpk33zJBciXN/ucBmoJUSIeo9Q6F97rV8lk=;
 b=H2K3W8FrK9HL8SBrI5fxqlcJ9rsed4pPHemXsc0h2N3SzEWtbIlSxXqCTbMPfsA06f
 u2HMhBNiOafpt3tiiadm2cPJwDAXnQwZ4pm6Hww7oVW6h1HLnYA4nN3ArL47qimeHbt1
 EjyypSIXL6GphhXd+cmU9K9PmEat1VP4yOpn7rfJqcLDa/3bAnf26QrAhDfgPORGBWtV
 73ZxwigNQwKXGOnTPEqQZG3fMGOI2se8El+e1o7hwMTwz7mNerz7Cwhx+2TIxCykass1
 CuEazYHHtNTkwFcre4tYSttmmLYMRJWxLsUbyjKDJt3UJhHla2lgA0GHUbuqsqpaRULa
 qIMA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20130820;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=19eq6R9IZpk33zJBciXN/ucBmoJUSIeo9Q6F97rV8lk=;
 b=VgwBIQe6K3aPyHOj2aFVZKsIbL97GeqToB1QKVmvddvZ51p6L3ntxeuUzLpDuOvmMJ
 PJFBL/OEq/Zc7itpD3GRaqyWimwOLMPENza9pzZOX3bZO2oLEmwqFbBIKAwvNzYsQhXu
 gU+BP/xGyS91steHfURV6zeE0Y04JEmMyKLYi8Kl/1o+J5RbJxaIph8bKViwmEqDkOSc
 IO2nwy+DKMOtAhXDYrJVHBsLfsa11OwyYlp4bC6JODfKGpJUyQGUHabg2+cX1dToommV
 HoBQ4UQ4FTunmZSKD8k81ZRDp5W9kcy25LbnQt8jsZ33Eb5x3bK7iDf8yvkbC6a4y55S
 SQGg==
X-Gm-Message-State: AE9vXwPLdcws11Ub+64D37HcDK/YmCzfVrz2mujxzDdyjZGp7mvj/DnrzE/Lem3DoXdbCf/bEyflNK5lJkwChA==
X-Received: by 10.37.206.84 with SMTP id x81mr6756973ybe.117.1473464031786;
 Fri, 09 Sep 2016 16:33:51 -0700 (PDT)
MIME-Version: 1.0
Sender: hugokraw@gmail.com
Received: by 10.37.33.10 with HTTP; Fri, 9 Sep 2016 16:33:21 -0700 (PDT)
In-Reply-To: <20160909082237.pvl4dh2g62zrqcsg@LK-Perkele-V2.elisa-laajakaista.fi>
References: <CAOgPGoD8YEr=+c8eG+YZ=6nSvFB2uk7MiKNgN7Z=wg7ihAUhzg@mail.gmail.com>
 <e7729a05efe1d204bc6ee2ab2f59ae9d@maxg.info>
 <CABcZeBM2wqgxdsLonLzTtPChyZ14KSMwzy1HQukTL_5gXXWLmw@mail.gmail.com>
 <CAF8qwaB=JJ_5V9RuJNdqSmj1c=yNMANzKBksM-6TLtfnf6j57g@mail.gmail.com>
 <CABcZeBMhthzSWbJa_Gkt6MB-RfrAOq=VT6GU9i7GTefq0Gj2Fw@mail.gmail.com>
 <CADi0yUNs1+j73seG653epbSk52OnTAxnw6sLCK8kJkZqS902nw@mail.gmail.com>
 <CABcZeBP1hNEbxbxwxQN===CT7XdBXwQ87MG5ibsOJDS7i4gBqw@mail.gmail.com>
 <CADi0yUPGFF5Hgq3Ws-iMGKSBcU=gRFWz9ECd9gmjX6uvYH0OhA@mail.gmail.com>
 <20160908092901.d4we5xgvmktx7pmd@LK-Perkele-V2.elisa-laajakaista.fi>
 <CADi0yUMgnYFaQzTrHHBR39NTFWDns_Tar6z0LTF9jagUBGrJ3Q@mail.gmail.com>
 <20160909082237.pvl4dh2g62zrqcsg@LK-Perkele-V2.elisa-laajakaista.fi>
From: Hugo Krawczyk <hugo@ee.technion.ac.il>
Date: Fri, 9 Sep 2016 19:33:21 -0400
X-Google-Sender-Auth: clsMrqdZD8GiIDmZioHDE8n_KFU
Message-ID: <CADi0yUOqGJDQKeNN=-tn+a-JNF52DPAbYqQ+5DK5-hGRyj7oNA@mail.gmail.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
Content-Type: multipart/alternative; boundary=94eb2c191dfa343d06053c1b94b8
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/lJaadxlna8EzRPTCM1oWh1AkywI>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Finished stuffing
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: Fri, 09 Sep 2016 23:33:55 -0000

--94eb2c191dfa343d06053c1b94b8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Fri, Sep 9, 2016 at 4:22 AM, Ilari Liusvaara <ilariliusvaara@welho.com>
wrote:

> On Thu, Sep 08, 2016 at 09:59:22PM -0400, Hugo Krawczyk wrote:
> > On Thu, Sep 8, 2016 at 5:29 AM, Ilari Liusvaara <
> ilariliusvaara@welho.com>
> > wrote:
> >
> > > On Wed, Sep 07, 2016 at 07:43:53PM -0400, Hugo Krawczyk wrote:
> > >
> > > - The hash has output length at most input length (true for all SHA-2
> > > variants)
> > >
> >
> > Just curious: Can you explain the need for this property? Note that if =
a
> > key to HMAC is  =E2=80=8Blarger than the (compression) function output =
size then
> > this key is first hashed into a full output hence preserving CR.
>
> Simply me not bothering to figure out what the heck HMAC does if this
> isn't true (or if it is even well-defined in all cases).
>
> > - HKDF-extract salt length is constant (in current draft, always
> hash_olen)
> > > - HKDF-expand PRK length is constant (in current draft, always
> hash_olen)
> > > - The HKDF-expand output output length is at least hash output length
> > >   (in current draft, hash_olen except in key expansions).
> > >
> >
> > These are a lot of restrictions that no one has spelled out as conditio=
ns
> > on the KDF and they do not follow from the natural properties of KDFs.
> > Collision resistance is never needed as far as I can tell for generatio=
n
> of
> > keys or to compute PRF and/or MAC values (e.g., for the original
> > functionality of Finished that is essentially a MAC/PRF on the
> transcript).
> > The reason we find ourselves considering the CR properties of HKDF is
> that
> > we are using it to derive *strings* that serve as binders/digests of pa=
st
> > transcripts. Luckily, HKDF with the right hash functions can provide th=
at
> > functionality but it is not a native KDF functionality.
>
> So I presume some more text for Security Considerations...
>
> > I do not mean this as an academic discussion (although we could have th=
at
> > too) but as a warning for future (if not present) misuse and an obstacl=
e
> in
> > replacing HKDF in the future.
> > I would be much happier if we had a clear distinction between PRF/MAC
> > =E2=80=8Bcomputations, KDF computations and digest computations., even =
if we
> > currently used HKDF for all these functions.
>
> Unfortunately there are things like exporter outputs, that need to be
> both "secret" (i.e. "keys") and "nonces" (i.e. "binders"). At least if
> application wants so... Dropping either would cause MAJOR security
> problems.
>
> I think those and the dynamically provisioned PSKs are the only ones
> that have that property of being both key and binder.
>

=E2=80=8BI would much prefer to have two elements associated with such keys=
. One is
the key itself and the other is a binder (or whatever other name one
chooses for it) that consists of a context string or digest associated to
that key. Then, you would use the key to key crypto algorithms and use the
descriptor as a binder to the key's original context, usually as input to a
crypto algorithm (and not as a key). This will make the functionality of
each element (key or binder) more explicit and will make it clear when is
that we need collision resistance and when we don't.

Hugo


> > > It is a bit more problematic than that:
> > >
> > > The hello_finished / "PSK Creation Binder" derives from the PSK key.
> > >
> > > Deriving separate value in context of dynamic PSK provisioning does n=
ot
> > > work properly as "static" PSKs lack this value, and if one then tries
> to
> > > use such key with combined authentication, you got an attack[1].
> > >
> >
> > =E2=80=8BI could not follow this argument.
>
> Basically, one can't make a distinction between static ("non-resumption)
> and dynamic ("resumption") PSKs here. Because such distinction would
> run into security problems with some other features.
>
>
>
> -Ilari
>

--94eb2c191dfa343d06053c1b94b8
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div class=3D"gmail_default" style=3D"font-family:verdana,=
sans-serif;font-size:small"><br></div><div class=3D"gmail_extra"><br><div c=
lass=3D"gmail_quote">On Fri, Sep 9, 2016 at 4:22 AM, Ilari Liusvaara <span =
dir=3D"ltr">&lt;<a href=3D"mailto:ilariliusvaara@welho.com" target=3D"_blan=
k">ilariliusvaara@welho.com</a>&gt;</span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><span>On Thu, Sep 08, 2016 at 09:59:22PM -0400, Hugo Krawczyk wrot=
e:<br>
&gt; On Thu, Sep 8, 2016 at 5:29 AM, Ilari Liusvaara &lt;<a href=3D"mailto:=
ilariliusvaara@welho.com" target=3D"_blank">ilariliusvaara@welho.com</a>&gt=
;<br>
&gt; wrote:<br>
&gt;<br>
&gt; &gt; On Wed, Sep 07, 2016 at 07:43:53PM -0400, Hugo Krawczyk wrote:<br=
>
&gt; &gt;<br>
</span><span>&gt; &gt; - The hash has output length at most input length (t=
rue for all SHA-2<br>
&gt; &gt; variants)<br>
&gt; &gt;<br>
&gt;<br>
&gt; Just curious: Can you explain the need for this property? Note that if=
 a<br>
&gt; key to HMAC is=C2=A0 =E2=80=8Blarger than the (compression) function o=
utput size then<br>
&gt; this key is first hashed into a full output hence preserving CR.<br>
<br>
</span>Simply me not bothering to figure out what the heck HMAC does if thi=
s<br>
isn&#39;t true (or if it is even well-defined in all cases).<br>
<span><br>
&gt; - HKDF-extract salt length is constant (in current draft, always hash_=
olen)<br>
&gt; &gt; - HKDF-expand PRK length is constant (in current draft, always ha=
sh_olen)<br>
&gt; &gt; - The HKDF-expand output output length is at least hash output le=
ngth<br>
&gt; &gt;=C2=A0 =C2=A0(in current draft, hash_olen except in key expansions=
).<br>
&gt; &gt;<br>
&gt;<br>
&gt; These are a lot of restrictions that no one has spelled out as conditi=
ons<br>
&gt; on the KDF and they do not follow from the natural properties of KDFs.=
<br>
&gt; Collision resistance is never needed as far as I can tell for generati=
on of<br>
&gt; keys or to compute PRF and/or MAC values (e.g., for the original<br>
&gt; functionality of Finished that is essentially a MAC/PRF on the transcr=
ipt).<br>
&gt; The reason we find ourselves considering the CR properties of HKDF is =
that<br>
&gt; we are using it to derive *strings* that serve as binders/digests of p=
ast<br>
&gt; transcripts. Luckily, HKDF with the right hash functions can provide t=
hat<br>
&gt; functionality but it is not a native KDF functionality.<br>
<br>
</span>So I presume some more text for Security Considerations...<br>
<span><br>
&gt; I do not mean this as an academic discussion (although we could have t=
hat<br>
&gt; too) but as a warning for future (if not present) misuse and an obstac=
le in<br>
&gt; replacing HKDF in the future.<br>
&gt; I would be much happier if we had a clear distinction between PRF/MAC<=
br>
&gt; =E2=80=8Bcomputations, KDF computations and digest computations., even=
 if we<br>
&gt; currently used HKDF for all these functions.<br>
<br>
</span>Unfortunately there are things like exporter outputs, that need to b=
e<br>
both &quot;secret&quot; (i.e. &quot;keys&quot;) and &quot;nonces&quot; (i.e=
. &quot;binders&quot;). At least if<br>
application wants so... Dropping either would cause MAJOR security<br>
problems.<br>
<br>
I think those and the dynamically provisioned PSKs are the only ones<br>
that have that property of being both key and binder.<br></blockquote><div>=
<br></div><div><div class=3D"gmail_default" style=3D"font-family:verdana,sa=
ns-serif;font-size:small;display:inline">=E2=80=8BI would much prefer to ha=
ve two elements associated with such keys. One is the key itself and the ot=
her is a binder (or whatever other name one chooses for it) that consists o=
f a context string or digest associated to that key. Then, you would use th=
e key to key crypto algorithms and use the descriptor as a binder to the ke=
y&#39;s original context, usually as input to a crypto algorithm (and not a=
s a key). This will make the functionality of each element (key or binder) =
more explicit and will make it clear when is that we need collision resista=
nce and when we don&#39;t.=C2=A0</div></div><div><div class=3D"gmail_defaul=
t" style=3D"font-family:verdana,sans-serif;font-size:small;display:inline">=
<br></div></div><div><div class=3D"gmail_default" style=3D"font-family:verd=
ana,sans-serif;font-size:small;display:inline">Hugo</div></div><div><div cl=
ass=3D"gmail_default" style=3D"font-family:verdana,sans-serif;font-size:sma=
ll;display:inline"><br></div></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
&gt; &gt; It is a bit more problematic than that:<br>
&gt; &gt;<br>
&gt; &gt; The hello_finished / &quot;PSK Creation Binder&quot; derives from=
 the PSK key.<br>
&gt; &gt;<br>
&gt; &gt; Deriving separate value in context of dynamic PSK provisioning do=
es not<br>
&gt; &gt; work properly as &quot;static&quot; PSKs lack this value, and if =
one then tries to<br>
&gt; &gt; use such key with combined authentication, you got an attack[1].<=
br>
&gt; &gt;<br>
&gt;<br>
</span><span>&gt; =E2=80=8BI could not follow this argument.<br>
<br>
</span>Basically, one can&#39;t make a distinction between static (&quot;no=
n-resumption)<br>
and dynamic (&quot;resumption&quot;) PSKs here. Because such distinction wo=
uld<br>
run into security problems with some other features.<br>
<span><font color=3D"#888888"><br>
<br>
<br>
-Ilari<br>
</font></span></blockquote></div><br></div></div>

--94eb2c191dfa343d06053c1b94b8--

