Re: [TLS] on sharing PSKs between TLS 1.2 and TLS 1.3

Jonathan Hoyland <jonathan.hoyland@gmail.com> Mon, 23 July 2018 12:02 UTC

Return-Path: <jonathan.hoyland@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 84BCB130E17 for <tls@ietfa.amsl.com>; Mon, 23 Jul 2018 05:02:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, 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 8pOdYOl7BF8q for <tls@ietfa.amsl.com>; Mon, 23 Jul 2018 05:02:51 -0700 (PDT)
Received: from mail-ua0-x232.google.com (mail-ua0-x232.google.com [IPv6:2607:f8b0:400c:c08::232]) (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 E2297130DD4 for <tls@ietf.org>; Mon, 23 Jul 2018 05:02:50 -0700 (PDT)
Received: by mail-ua0-x232.google.com with SMTP id x24-v6so216886ual.10 for <tls@ietf.org>; Mon, 23 Jul 2018 05:02:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qd7y5kjmlzj5OtJpHNYW86LbZEGA52tEElV6YOjtWBc=; b=ijjitg1wVf6t0QnBJQ9+MSsosCkVd6okWW/T2X72wSjP+cRHMUrBTlcbGcZ3wTYarq ZrqcVm31chtJaCSB1A22+S2tNBjjUrMAvfcG0Y2k4lr7XBh1MMc887xNAXJBmbmxdwZK ejEnTyojzBd894aIwKU74Eb/jk6pUyEwnYMBfBObLgQVmyK1uiO16FO4h8DDfJYEOY8Z TEyLJhNCFHnMFjyIJyjcRaEGoeMseXFAyQJcbXx8U4NpcynkJ/s3Vblt7yO1ww6ge082 LH1Hp8otwyZdqE2d5VNvJVDvKBNS0IUcFizM5SPUPQa0vMm6MkeqnM+0cQ4ZzcWF+083 Hjyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qd7y5kjmlzj5OtJpHNYW86LbZEGA52tEElV6YOjtWBc=; b=JIEx+Sn6oG3qlvfUvQp0ijXf71KrULaQ8b59mJheGbJdQ9QTMjhFYioMq2dGYH4Paw 57AEbOk3jre7tXYHGuvRq+B09y4bEvbK2g3yMOZTQB7udvDAlCmpaDNJGvoESpirsDet 20dV1IwiD/nziWdS1DHPFFCGpqQ/5gb/FbKKtmcdUlYpBSY/NC5aYkax6/V9PHC79Ezd gNjcqaXyBoWqNTIx0wuwReqaUZ0+vYaCwyDfU1yEbnOV4HKZfRNMmCtCdmoJex8P2bmG Bkx1tbg2ZJ7bMf3bXScWz2pXnHjAy4DqR01usO0HlOWrIW12mnEn8sXYZ60IUP3ysMOp MDKA==
X-Gm-Message-State: AOUpUlGCFsxTYaDdhaf80iOqByLGxKWHABq+IP61wKkv29siaxh77UY4 UvcYZ8tEz6o+CADx/nm6dTxfe3dEVoeTMnj3iXw=
X-Google-Smtp-Source: AAOMgpcD+oVTdqV+r1krjVuELGM8niMgIGgg1d9JOkZibwyCJsG0I7tfpHct+kU0YGYonJFMv2Pl/sK+WR27YbCf0ag=
X-Received: by 2002:ab0:622:: with SMTP id f31-v6mr8901149uaf.189.1532347369842; Mon, 23 Jul 2018 05:02:49 -0700 (PDT)
MIME-Version: 1.0
References: <20180719230009.GD14551@akamai.com> <ce4cb23be8939e57574062e17c4f204f7145d020.camel@redhat.com> <CABcZeBN4tdHZ_fzqqEJNR46BP5bxiy6gWa17xxhfj9YXVAR0rw@mail.gmail.com> <86b69d7d0534d7c711d13182c18774cf484e6431.camel@redhat.com> <CAF8qwaBDXw1vur5eaLhGyMcZefgwX66QBzfXMB+E6mBKsUnwdA@mail.gmail.com> <20180720142104.GA27715@LK-Perkele-VII>
In-Reply-To: <20180720142104.GA27715@LK-Perkele-VII>
From: Jonathan Hoyland <jonathan.hoyland@gmail.com>
Date: Mon, 23 Jul 2018 14:02:38 +0200
Message-ID: <CACykbs0Ohb2BpWS5NNR7HTZatX-ZRW6SpJc1H=fFuF93azGJQw@mail.gmail.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
Cc: David Benjamin <davidben@chromium.org>, "<tls@ietf.org>" <tls@ietf.org>
Content-Type: multipart/alternative; boundary="000000000000a6eb6e0571a96c28"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/7b-3yK2jvJrWjav7HN0rX6cqXik>
Subject: Re: [TLS] on sharing PSKs between TLS 1.2 and TLS 1.3
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.27
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, 23 Jul 2018 12:02:54 -0000

Hi all,

Couldn't make it to the second TLS session, but I did suggest on the
mailing list a tweak to the universal PSK draft that achieves
compatibility, unambiguity, and is straight-forward to prove secure
formally. (By which I mean prove independent of the security of TLS 1.2,
and thus any hash function it uses, even a pathalogical one.)
https://www.ietf.org/mail-archive/web/tls/current/msg26419.html
In brief I suggest that you transform both the PSK ID and the PSK itself in
such a way that a server that accepts them tacitly acknowledges the upgrade
of the PSK from 1.2 to 1.3.
You can achieve compatibility with a server that doesn't support this by
offering the untransformed PSK ID also, at the cost of a more complex
formal analysis / potentially weaker security.

Regards,

Jonathan

On Fri, 20 Jul 2018 at 15:22 Ilari Liusvaara <ilariliusvaara@welho.com>
wrote:

> On Fri, Jul 20, 2018 at 08:42:47AM -0400, David Benjamin wrote:
> >
> > (I suspect using the same key with TLS1.2-PRF-SHA256 and HKDF-SHA256 is
> > probably *more* risky than mixing HKDF-SHA256 and HKDF-SHA384. I don't
> > think we actually believe SHA256 and SHA384 give related output. It's
> just
> > nice to avoid the assumption. Whereas TLS1.2-PRF-SHA256 and HKDF-SHA256
> > actually a chance of misbehavior. Perhaps it's worth doing that
> analysis?)
>
> TLS 1.3 does this with PSK:
>
> HMAC(<zeroes>, PSK)
>
> And TLS 1.2 does:
>
> HMAC(<expanded PSK>, <some data>)
>
> (where <some data> actually depends on <expanded psk>). Now, it is
> possible that there is second similar block in there, but that uses
> the same <expanded PSK>.
>
>
> However, noteworthy point is that there is only two ways to end up in
> situation where the effective key in TLS 1.2 is all zeroes:
>
> 1) <expanded psk> is longer than hash block and is preimage of 0.
>    Finding such thing is supposed to be infeasible.
> 2) The PSK is empty. However, the <some data> on TLS 1.2 side is
>    not empty in this case (it starts with gunk from HMAC that
>    involves at least both randoms). Also, empty PSK is not secure.
>
>
> The definition of HMAC is:
>
> H(C(key) XOR opad | H(C(key) XOR ipad, data))
>
> Which preserves collision resistance on C(key) and data. Now, C(key)
> is not collision resistant. However, the only possible cases where
> C(key) can collide are the two above.
>
>
> So it seems to me that TLS 1.2 and TLS 1.3 compute independent
> things from PSK values, in all practical cases.
>
>
>
> -Ilari
>
> _______________________________________________
> TLS mailing list
> TLS@ietf.org
> https://www.ietf.org/mailman/listinfo/tls
>