Return-Path: <shollenbeck@verisign.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 011913A0CE7
 for <tls@ietfa.amsl.com>; Tue, 21 Apr 2020 06:58:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level: 
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5
 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
 DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key)
 header.d=verisign.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 PwqidsfQ2Tdo for <tls@ietfa.amsl.com>;
 Tue, 21 Apr 2020 06:58:08 -0700 (PDT)
Received: from mail2.verisign.com (mail2.verisign.com [72.13.63.31])
 (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 EF31E3A0CE6
 for <TLS@ietf.org>; Tue, 21 Apr 2020 06:58:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=verisign.com; l=7277; q=dns/txt; s=VRSN; t=1587477482;
 h=from:to:subject:date:message-id:
 content-transfer-encoding:mime-version;
 bh=EYEN/fSzd3Hlqpp/yEj2GtilPwfjyaLtWl4zvtod4LY=;
 b=Fyt7qAz33NhtoV4smQNFwocpxETdG04gN0EG85lZ+KeKilHlnkpTLt50
 eXx0xhrVw1oABm9XvMRoZxbiUnCi03aODYu2g2KEN9FjjLyGb5PVn8jk3
 0NWwLYFmmbGC6/PcXMQEvNs6A6OCXwfVMklYzle5D9+3Xy5YrQd4ySXLU
 ETGeq1f4H9CyT+Gak7JP/aatx4GhWzvg2PGGhTcFugA9iojP8UQlKxiOj
 U9bhVYY+6Nbnyj89ojvGvjyeVDB5Hszzu9CFvlVSDw2SwuMn5E3vKGgdr
 pXWBfND4g6sYCwd3oReTfRSsbDPOQ3SLtBaAOae0DSZfSoeRqzGrXO82x Q==;
IronPort-SDR: svimTqIqvwDgDK7C7iJ3w2jby28l58lX01Y5lVfSThfqXy5jj1smXaJd9LWH8CIioELlrcb+9p
 66JPODwbN9lvqQ+SQvAoxYHwrHlBJPTZFrFe56lVEhGlQxVvsvdoDWnUtF5Dg4dLSLIdmq9GBZ
 S9MP2EuHXcMoFwFYmKIkC8sBu62v3RrM90MzcFo7XQfXRdNUSs6DrPwDQJpwoY/0EOb1+ze0Ar
 Zlg6JIkKupZSRrbZI4siJVw/xzcbG+S3MOg0tFMKgIaYjVJh6sTb0YE3nNubMShTIOGq1CRT+0
 tFQ=
X-IronPort-AV: E=Sophos;i="5.72,410,1580774400"; 
   d="scan'208";a="698145"
IronPort-PHdr: =?us-ascii?q?9a23=3AHj+1sRzKkRpRo0zXCy+O+j09IxM/srCxBDY+r6?=
 =?us-ascii?q?Qd1OMfIJqq85mqBkHD//Il1AaPAdyGra4ZwLSG+4nbGkU4qa6bt34DdJEeHz?=
 =?us-ascii?q?Qksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPER?=
 =?us-ascii?q?vjKwV1Ov71GonPhMiryuy+4ZLebxhIiTanbr5/LBq6oATSu8ILnYZsN6E9xw?=
 =?us-ascii?q?fTrHBVYepW32RoJVySnxb4+Mi9+YNo/jpTtfw86cNOSL32cKskQ7NWCjQmKH?=
 =?us-ascii?q?0169bwtRbfVwuP52ATXXsQnxFVHgXK9hD6XpP2sivnqupw3TSRMMPqQbwoXz?=
 =?us-ascii?q?mp8qFmQwLqhig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QqGjcBP?=
 =?us-ascii?q?kImAQQRCrkHhU+FMoE4iW2CZoFCPoERgluFFAEUhgkEjgMqiTKZLXwDB4JEB?=
 =?us-ascii?q?JdmJZxdj3OcbwIEAgQFAhWBaIF6cIM6TxgNoCFIjmOBEAEB?=
Received: from BRN1WNEX02.vcorp.ad.vrsn.com (10.173.153.49) by
 BRN1WNEX02.vcorp.ad.vrsn.com (10.173.153.49) with Microsoft SMTP Server
 (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id
 15.1.1913.5; Tue, 21 Apr 2020 09:57:57 -0400
Received: from BRN1WNEX02.vcorp.ad.vrsn.com ([fe80::7c0a:1cc:5def:9dde]) by
 BRN1WNEX02.vcorp.ad.vrsn.com ([fe80::7c0a:1cc:5def:9dde%4]) with mapi id
 15.01.1913.005; Tue, 21 Apr 2020 09:57:57 -0400
From: "Hollenbeck, Scott" <shollenbeck@verisign.com>
To: "TLS@ietf.org" <TLS@ietf.org>
Thread-Topic: Comments on draft-ietf-tls-external-psk-importer-04
Thread-Index: AdYX4WFdhLPIgsQ4RUymyBbaAf5mxQ==
Date: Tue, 21 Apr 2020 13:57:57 +0000
Message-ID: <fb7c3f894dfa49efb5917d2e39c4ea78@verisign.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.170.148.18]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/d7ktdMu645J9pMhHB_Rgnx4R1X0>
Subject: [TLS] Comments on draft-ietf-tls-external-psk-importer-04
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.29
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: Tue, 21 Apr 2020 13:58:10 -0000

Here are a few comments gathered from Verisign Labs on draft-ietf-tls-exter=
nal-psk-importer-04.

1. Overview of draft goals and techniques.   We've summarized our understan=
ding of the draft here.  Our subsequent comments are based on this understa=
nding.

a. Goal:  The draft's goal is to define a mechanism by which a TLS client a=
nd server can derive multiple, cryptographically separate imported PSKs  (I=
PSKs) from a single, shared external PSK (EPSK), such that each IPSK is ass=
ociated with a different combination of protocol parameters (e.g., the targ=
et KDF for the TLS key schedule).  The IPSK then takes the place of the PSK=
 input.  This goal is beneficial as it avoids the need for a client and ser=
ver to establish different EPSKs for these different combinations.  The dra=
ft doesn't specify how to establish the EPSK initially (this is left out of=
 scope, as it is in TLS itself).=20

b. Mechanism:  The IPSK is derived from the EPSK and other parameters via a=
 key derivation function associated with the EPSK.  The other parameters in=
clude a general-purpose context string, the identifier of the target protoc=
ol, and the identifier of the target KDF.  The IPSK is thereby bound to the=
se parameters.  The binding to the target KDF helps ensure that the input k=
ey material for different KDFs are cryptographically separate.=20

c. Syntax:  In support of this mechanism, the draft also specifies a new sy=
ntax for the opaque PskIdentity.identity field in the TLS PSK extension.  T=
he new syntax includes the identity of the underlying EPSK (which remains a=
n opaque string, as usual) and the associated protocol parameters.  When a =
server recognizes that the PSKIdentity.identity field has this syntax, if t=
he server accepts the underlying EPSK and the associated parameters, the se=
rver then derives the PSK input to the TLS key schedule from the underlying=
 EPSK and the other parameters.  A client may offer multiple IPSK identitie=
s, each with a different combination of underlying EPSK identities and asso=
ciated parameters.=20

2. Technical comments.=20

a. Distinct identities?  Sec. 3 states "Non-imported and imported PSKs are =
distinct since their identities are different on the wire."  We have two co=
ncerns about this statement.  First, the statement appears to suggest that =
if two EPSKs have different identities, then they must have different secre=
t values.  But couldn't two EPSKs have the same secret value yet employ dif=
ferent identities for convenience?  For example, an endpoint might identify=
 the same EPSK with a domain name in some cases and with an IP address in o=
thers.  Second, and more fundamentally, the statement assumes that a non-im=
ported EPSK, by definition, cannot be misinterpreted as an imported PSK.  B=
ut isn't the identifier of a non-imported EPSK just an opaque string?  A no=
n-imported EPSK identity could therefore have the same "bits on the wire" a=
s an IPSK identity, if the client and server employ an identifier system th=
at whose encoding happens to coincide with the ImportedIdentity structure d=
efined in the draft.  (Moreover, the identifier of a resumption PSK is just=
 an opaque string -- so couldn't this also collide with ImportedIdentity va=
lues?  Perhaps we are missing something even more fundamental in our readin=
g.)  ([draft-dt-tls-external-psk-guidance-01] covers similar issues in its =
Sec. 6.1.2, "PSK Identity Collisions.")

b. Attack impact.  If it's possible for an opaque identifier for a non-impo=
rted EPSK identity to have the same encoding as an ImportedIdentity value, =
then how does the server recognize unambiguously that the opaque identifier=
 is intended to be an imported identity?  The server could take an optimist=
ic approach and assume that an identifier that meets the ImportedIdentity s=
yntax is probably an imported identity, and run the code path for imported =
identities first.  If that path fails, however -- either because the server=
 doesn't accept the EPSK or associated parameters, or because the binder va=
lue is incorrect -- then the server may need to run the code path for non-i=
mported identities as a fallback, checking next to see if the opaque string=
 is recognized as an ordinary EPSK identity.  But this practice just puts m=
ore burden on a server against an attacker who replays (or makes up) the PS=
KIdentity.identity value:  two code paths are exercised for the price of on=
e attempted handshake.=20

c.  Mitigations.  One way to reduce the burden is to impose a new requireme=
nt that the opaque string can only have the ImportedIdentity syntax if the =
client (or server in the case of hints) indeed intends to use the import me=
chanism. An ordinary EPSK could have any other value, just not this kind.  =
But this may not be compatible with the installed base, especially with imp=
lementations that allow clients and servers to specify arbitrary EPSK ident=
ities. (Consider the case where an application adopts the imported identity=
 syntax for the use intended in this draft, and then decides to reuse the s=
yntax for other purposes, including ordinary EPSK identities.) =20

Another way to ensure distinctness is to add a flag that indicates that the=
 PSK identity is an imported identity. But it's not clear where this flag w=
ould go, given that the PskIdentity syntax isn't extensible.  Perhaps there=
 could be an overall flag indicating that _all PSK identities are imported =
identities? Or a new extension for imported PSKs?

d.  Key separation.  Note that the foregoing discussion about EPSK identifi=
ers potentially colliding is separate from the question about what happens =
if an IPSK happens to collide with a non-imported EPSK.  The draft handles =
this effectively with different inputs to the binder derivation ("ext binde=
r" vs. "imp binder").  But this happens after the implementation has alread=
y decided whether to interpret the identifier as external or imported.=20

e.  Incremental deployment.  Section 6 states that " the derived PSK will n=
ot be the same [as the underlying EPSK] since the importer differentiates t=
he PSK via the identity, target protocol and target key KDF."  However, the=
 next statement does not follow directly:  "Thus, PSKs imported for TLS 1.3=
 are distinct from those used in TLS 1.2, and thereby avoid cross-protocol =
collisions."  Rather, the statement also depends on the requirement in Sect=
ion 3 that clients (and servers) don't deliberately use EPSKs or IPSKs for =
other purposes, and the security properties of the KDF that produces the IP=
SK (which ensures that collisions don't occur accidentally).   But there al=
so seems to be an implication in Section 6 that the use of the KDF in the T=
LS 1.3 importer doesn't conflict with the cryptographic functions used for =
obtaining the TLS 1.2 pre-master secret.  If so, this distinction should be=
 spelled out.

Related to this, where Section 3 states, "Clients which import external key=
s MUST NOT use either the external keys or the derived keys for any other p=
urpose," should "Clients" be "Clients and servers" or simply "Endpoints"?

Scott

