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

David Benjamin <davidben@chromium.org> Fri, 20 July 2018 12:43 UTC

Return-Path: <davidben@google.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 64EF4130E1A for <tls@ietfa.amsl.com>; Fri, 20 Jul 2018 05:43:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.25
X-Spam-Level:
X-Spam-Status: No, score=-9.25 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 jq1rQNrcL1JY for <tls@ietfa.amsl.com>; Fri, 20 Jul 2018 05:43:01 -0700 (PDT)
Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (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 4A3E612426A for <tls@ietf.org>; Fri, 20 Jul 2018 05:43:01 -0700 (PDT)
Received: by mail-qt0-x229.google.com with SMTP id z8-v6so10078994qto.9 for <tls@ietf.org>; Fri, 20 Jul 2018 05:43:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=TwZvfwWahZA1IVa9b4cbkguskprCXey1a3nKE9OFrRY=; b=DXWySGOCUHtXrFh+SihWZBcWo7wqfYHpCHabG8gbhRmHt/YREZ7Nz9Z3tMEW2kzQrf GT7x0C2qQorNOB4YvWKIREW2bYeJ0fbwKJn25BpElSnjO58n9TOkMKKRIWp1ODH34Uk1 rSXc0dPJK1ihpkdbVVLQseu0nGWs603alwj/I=
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=TwZvfwWahZA1IVa9b4cbkguskprCXey1a3nKE9OFrRY=; b=RNWaEXE4hfPGnYbrWePVUnxBue0+6qj5QOPp2BJzcQgVRPrwt++EfXXYrUXYZ84dHp pjPNa8GiEloABBUbTY4RAMLdNkZajDO0BvxSsppV92fqseP1um+dLhk2qHgpuCuI7v1U sXmQZEtq0u3hiBSJszgSDVfUm7KkKqPtGkxtarznxVI3gsDMouYvczasYP6ofKkEhZXt 2gL/iLAArJ1Ls4BRwdy+N6DbOYYVXMfZN7KHA2kuSB1jZ8D4zDr+xwLCIDotHitM7fg0 QRuwWEDc4Vewt7dXXPdgOD/m3eSTzanV3eUuY75j9HXsrhLe/TpSlc5QiXPJhn7Ygd6R CgAg==
X-Gm-Message-State: AOUpUlHluRXdcfx0IhRzqcmLGesqxKT0pQ6DQ/xa1PlwT0YM7ErLFszi mQ+ygURF7y+JTMb45H6vHNqjfJUXsYf5rvXQp305
X-Google-Smtp-Source: AAOMgpfK+b57b24MayIdfsqPqeqdA2GpSECdxBeEtV9GL0dINy7wKsZ1STTmd7tPJthFQMKIJJ6Gk3oseDjLKlIyjKU=
X-Received: by 2002:ac8:2d3a:: with SMTP id n55-v6mr1702473qta.220.1532090580258; Fri, 20 Jul 2018 05:43:00 -0700 (PDT)
MIME-Version: 1.0
References: <20180719230009.GD14551@akamai.com> <ce4cb23be8939e57574062e17c4f204f7145d020.camel@redhat.com> <CABcZeBN4tdHZ_fzqqEJNR46BP5bxiy6gWa17xxhfj9YXVAR0rw@mail.gmail.com> <86b69d7d0534d7c711d13182c18774cf484e6431.camel@redhat.com>
In-Reply-To: <86b69d7d0534d7c711d13182c18774cf484e6431.camel@redhat.com>
From: David Benjamin <davidben@chromium.org>
Date: Fri, 20 Jul 2018 08:42:47 -0400
Message-ID: <CAF8qwaBDXw1vur5eaLhGyMcZefgwX66QBzfXMB+E6mBKsUnwdA@mail.gmail.com>
To: Nikos Mavrogiannopoulos <nmav@redhat.com>
Cc: Eric Rescorla <ekr@rtfm.com>, "<tls@ietf.org>" <tls@ietf.org>, Benjamin Kaduk <bkaduk=40akamai.com@dmarc.ietf.org>
Content-Type: multipart/alternative; boundary="000000000000cd5e9705716da2cb"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/_MfUSA7ItFa0rsGHGTmSnJKZ_vo>
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: Fri, 20 Jul 2018 12:43:04 -0000

On Fri, Jul 20, 2018 at 7:39 AM Nikos Mavrogiannopoulos <nmav@redhat.com>
wrote:

> On Fri, 2018-07-20 at 02:38 -0700, Eric Rescorla wrote:
> > >
> > > > This is somewhat timely, as if we do want to introduce a
> > > restriction,
> > > > it
> > > > would ideally be in the form of some text in the TLS 1.3
> > > > specification,
> > > > which is very nearly done.
> > > >
> > > > It would be good to hear more opinions on this question,
> > > particularly
> > > > from those who have worked on the formal verification directly.
> > > >
> > > > If I can attempt to summarize some discussion that occurred in
> > > the
> > > > mic
> > > > line today, Hannes was surprised that we would care, likening
> > > this
> > > > case
> > > > to the regular version negotiation, where we are happy to use the
> > > > same
> > > > certificate to sign messages for both TLS 1.2 and 1.3.  David
> > > > Benjamin
> > > > points out that we explicitly go to the trouble of putting 64
> > > bytes
> > > > of
> > > > 0x20 padding at the front of the content that gets signed for
> > > > CertificateVerify, to enforce separation between the TLS
> > > versions.
> > > >
> > > > My own personal opinion is that we should enforce a domain
> > > separation
> > > > between TLS 1.2 PSKs and TLS 1.3 PSKs; David Benjamin's
> > > "Universal
> > > > PSKs"
> > > > proposal seems like a potential mechanism by which to do so
> > > without
> > > > doubling the provisioning needs.
> > >
> > > I think the same rules should apply for PSK and RSA/ECDSA/EdDSA
> > > keys.
> > > There is no inherent difference between the two keys types. I could
> > > have deployed TLS with PKI or TLS with PSK. I should be able to
> > > upgrade
> > > protocols the same way.
> > >
> > > If RSA keys can be re-used between TLS1.2 and TLS1.3, then so
> > > should
> > > PSK keys. The current document specifically allows that re-use, and
> > > if
> > > you fear that the current document did not take cross-protocol
> > > attacks
> > > in mind during design, then let's fix that instead.
> >
> > The issue is not cross-protocol attacks; it's the reuse of PSKs with
> > different KDFs, which we don't have any analysis for
>
> I understand, but as I have already mentioned that argument also
> applies for RSA keys which can be used e.g., for RSA encryption under
> TLS1.2 and for RSA-PSS signatures under TLS1.3. ECDSA keys can be used
> with multiple hashes under TLS1.2 while only one under TLS1.3.
> TLS 1.3 did not enforce protocol separation for that ugly scenario, so
> I wouldn't expect the treatment of PSKs differently.
>

PSKs are much easier to fix this with than signing algorithms, given that
we don't want to reprovision either to deploy TLS 1.3.

ECDSA in TLS didn't get worse with TLS 1.3. We didn't add a new hash to
mixup, just restricted the set from TLS 1.2. If we left it alone, we'd
still have the same effect. For RSA, you're right that we introduced an
extra pair of algorithms to worry about. The options there are:

(1) Add PSS, forbid PKCS1, and forbid PSS with id-rsaEncryption. Cost: TLS
1.3 requires reprovisioning RSA keys.
(2) Add PSS, forbid PKCS1, but allow PSS with id-rsaEncryption. Cost: We
have two algorithms with one key.
(3) Don't forbid PKCS1. Cost: We don't get rid of PKCS#1.

(1)'s cost is clearly fatal, given 1.3's goals. I'm personally fine with
either (2) or (3), but the WG chose (2).

With PSKs, I think we can get both. If we consider 1.2 PSKs to be paired
with the 1.2 PRF, we can allocate a new label, and derive a separate thing
to stick in 1.3, and not require reprovisioning. It's basically free, so I
think it makes sense to do it.

(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?)

Of course, I don't actually know what I'm talking about. Opinions from the
formal analysis folks would be great. :-)


> Said that, I want to clarify that I wouldn't necessarily object to an
> improvement the situation for externally established PSKs. The issue I
> see is that TLS1.3 already gives a "good enough" solution with re-using
> the key, and I'm afraid we're going to have interoperation issues if
> some implementations move to universal psks and some do not, defeating
> the purpose of a standard.
>

I think that's the point of deciding this immediate question now, so we can
get some text in the specification. If we decide to fix this, we'd instruct
implementations to (temporary!) turn off TLS 1.3 if 1.2 PSKs are configured
and then, once the fixup document is published, implement it and remove the
version logic. This is interoperable at all combinations as version
negotiation runs first.

Personally, I actually don't care much about 1.2 PSKs as I don't work with
anything that uses them. I do care about allowing new protocols to use 1.3
external PSKs cleanly---new protocols can just mandate 1.3 and avoid 1.2,
but the hash rule makes the whole thing unusable and it is unclear whether
1.3 PSKs will be usable in a future 1.4. I figured it'd be easy to patch
the 1.2 issue while I was at it, thus the construction in my draft.

But the exact derivation can be worked out separately, my draft or not. The
immediate question is whether we think 1.2 PSKs should be reusable in 1.3
as-is or whether we should stick a derivation step to separate them.
(Thanks, Ben, for making this thread. I failed to call out the immediate
question in mine and then didn't had time to catch up on it.)

David