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

Benjamin Kaduk <bkaduk@akamai.com> Thu, 26 July 2018 18:38 UTC

Return-Path: <bkaduk@akamai.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 83ECA130E09 for <tls@ietfa.amsl.com>; Thu, 26 Jul 2018 11:38:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.711
X-Spam-Level:
X-Spam-Status: No, score=-2.711 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_DKIMWL_WL_HIGH=-0.01] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=akamai.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 f0vqkZuG6BIq for <tls@ietfa.amsl.com>; Thu, 26 Jul 2018 11:38:40 -0700 (PDT)
Received: from mx0a-00190b01.pphosted.com (mx0a-00190b01.pphosted.com [IPv6:2620:100:9001:583::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 76E1F130DBE for <tls@ietf.org>; Thu, 26 Jul 2018 11:38:40 -0700 (PDT)
Received: from pps.filterd (m0050095.ppops.net [127.0.0.1]) by m0050095.ppops.net-00190b01. (8.16.0.22/8.16.0.22) with SMTP id w6QIbvjQ010461; Thu, 26 Jul 2018 19:38:40 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=akamai.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : content-transfer-encoding : in-reply-to; s=jan2016.eng; bh=zJXCGlc8gnsfMd5bLV0G9zH12t5qdONwsFAkgYWQJxs=; b=PVpQy5Q1GMAKemDJ/+wXP/z8OkPLyy7vhgqr4J2pgvfSyEc4F+9qf3SgQVCGdDe5YBxW SC5aNVSt7MBL1qWrNy4JcwD+9iuz0OJLv7rjwMWSIrQy7NuaqWDgt9W7GWVubpbCTo/1 IqRIZh3GT4r7uEeNEiNmGgYv/5Svu+w2HKSh9BiZ0CwBkeK10uXYkKA//9Bs37n8EruT 1FUhfApo7wMkQ14SvWIjSMfHBT7FKyhtqStRUL4DPoQa/3lohDWnFgdOovZOHyUShya+ 3TT3A7BCEUxZKtkasMC9JzoXhrPJTRwDpqMSZcCwCPqPh0hfFvptZbKDjYDhC7GxsmYS VA==
Received: from prod-mail-ppoint2 (prod-mail-ppoint2.akamai.com [184.51.33.19]) by m0050095.ppops.net-00190b01. with ESMTP id 2ke39bgu9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 26 Jul 2018 19:38:39 +0100
Received: from pps.filterd (prod-mail-ppoint2.akamai.com [127.0.0.1]) by prod-mail-ppoint2.akamai.com (8.16.0.21/8.16.0.21) with SMTP id w6QIYjSC006348; Thu, 26 Jul 2018 14:38:38 -0400
Received: from prod-mail-relay10.akamai.com ([172.27.118.251]) by prod-mail-ppoint2.akamai.com with ESMTP id 2kc05uxgym-1; Thu, 26 Jul 2018 14:38:37 -0400
Received: from bos-lpczi.kendall.corp.akamai.com (bos-lpczi.kendall.corp.akamai.com [172.19.17.86]) by prod-mail-relay10.akamai.com (Postfix) with ESMTP id 815942099F; Thu, 26 Jul 2018 18:38:36 +0000 (GMT)
Received: from bkaduk by bos-lpczi.kendall.corp.akamai.com with local (Exim 4.86_2) (envelope-from <bkaduk@akamai.com>) id 1fil9n-00021M-SS; Thu, 26 Jul 2018 13:38:35 -0500
Date: Thu, 26 Jul 2018 13:38:35 -0500
From: Benjamin Kaduk <bkaduk@akamai.com>
To: Eric Rescorla <ekr@rtfm.com>
Cc: "<tls@ietf.org>" <tls@ietf.org>
Message-ID: <20180726183835.GQ14551@akamai.com>
References: <20180719230009.GD14551@akamai.com> <CABcZeBO=LnxybFq2uog3UYoGgnb0KiE3oG=hGY5UWYauOtwMBw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CABcZeBO=LnxybFq2uog3UYoGgnb0KiE3oG=hGY5UWYauOtwMBw@mail.gmail.com>
User-Agent: Mutt/1.5.24 (2015-08-30)
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-26_04:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=925 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807260190
X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-26_04:, , signatures=0
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=914 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1806210000 definitions=main-1807260190
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/AJc8kO4GBKZqcpgPURo6Y3LZvyE>
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: Thu, 26 Jul 2018 18:38:43 -0000

On Thu, Jul 26, 2018 at 10:58:05AM -0700, Eric Rescorla wrote:
> Ben,
> 
> Thanks for focusing on this issue.

Just trying to make sure loose ends get wrapped up before TLS 1.3 goes final...

> Chris and I have been discussing an alternative design which we think
> is more consistent with the existing structure, which we call PSK
> Importers. As with your design, we have an input universal PSK, but

(I think you mean David Benjamin's design?)

> instead of using explicitly as part of the connection, we just use it
> as the base key to import a set of new PSKs into TLS.
> 
> As with Universal PSKs (UPSKs), each input key is a triplet of
> (BaseIdentity, BaseKey, KDF), where a BaseIdentity is a PSK identity
> as used today. To use a UPSK, an implementation takes the set of KDF
> hashes it knows about H_i and derives a set of PSKs:
> 
>   Hash_i: H_i
>   Identity_i: BaseIdentity || H_i
>   Key_i: Derived from BaseKey and Identity_i
> 
> This gives you a set of keys which you can offer simultaneously on the
> TLS connection in independent psk_identity blocks. (Note that the hash
> algorithm is what differentiates each derived key.) This is a bit
> ugly, but with the current TLS 1.3 ciphers, this basically just means
> SHA-256, but even in the worst case it’s probably only 2-3.
> 
> The nice thing about this design is that if you know the set of hash
> functions, you can just compute all the imported PSKs in advance, and
> there’s no need to touch the internals of the TLS stack. This also
> means that if you have decided you don’t like old hash X, you don’t
> need to use it to compute PSK binders, you just use it do the KDF,
> which seems like it has weakersecurity requirements.
> 
> Here’s a specific construction, but we’re flexible about the details:
> 
>    struct {
>        opaque base_identity<1...2^16-1>;
>        HashAlgorithm hash;
>    } imported_psk_identity;
> 
>    UPSKx = HKDF-Extract(0, UPSK)  // UPSK is the input universal PSK
>    PSK = HKDF-Expand-Label(UPSKx, "derived psk", BaseKDF(psk_identity),
> TargetHash.length) // Might need to shorten label
> 
> These functions would be executed with the KDF associated with the UPSK,
> but produce
> a key the size of the desired hash.
> 
> This brings us to the question of TLS 1.2. I found Ilari’s analyis
> pretty persuasive, so I would suggest we add the following text to the
> TLS 1.3 spec:
> 
>     TLS 1.3 takes a conservative approach to PSKs by binding them to a
>     specific KDF. TLS 1.2 allows PSKs to be used with any hash function

(I know it's awkward to write about, but we don't really get away with
pretending that 1.2 1.3 are the only versions in the rest of the document.)

>     and the TLS 1.2 PRF. The constructions in TLS 1.2 and TLS 1.3,
>     although both based on HMAC, are very different and there is no known
>     way in which reuse of the same PSK in TLS 1.3 and TLS 1.2 would
>     produce related output, although only limited formal analysis has been
>     done. Implementations MAY wish to avoid reuse of keys between TLS 1.3
>     and TLS 1.2, or use a key derivation proposal such as [Informative ref
>     to this email or a draft].

I might add "to avoid the risk of using under-analyzed cryptographic constructions"
(or similar), but implicit might be good enough.

> 
> Other than this, we wouldn’t make any changes to the document.
> 
> What do people think?

This seems like a good sort of approach to take (that is, make the key derivation
for hash specificity something that happens outside of the TLS mechanics itself),
given the context in which we're thinking about it.

It might be worth going even farther, and including the target TLS version in the
(derived) identities and keys.  Though maybe the negotiation process means that
doesn't actually protect against an attack; I haven't thought it through enough.

Thanks for putting this together,

Ben (no hats)