[TLS] Comments on draft-ietf-tls-external-psk-importer-04

"Hollenbeck, Scott" <shollenbeck@verisign.com> Tue, 21 April 2020 13:58 UTC

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 eXx0xhrVw1o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OP5Vo4f/qVsJqRu+ARejBOX0xTBWmnD23rU22Pk8Hw7a2wwgA84OvHrJp9jyL6cSUee1zK3MzTrdafNZwiny55TLch06v/GDQ6hwccvKyUkuGAPFiE+cppDiPzOQz+kAtXWQ4el4Ve+3lmIrtxt9riWty8oikIXFm4IYx17e+Sh2xIs5PcC0RFJhbdK5EpZcqzuWO5Z5T84hWW1kpSU3x7sbspChZicK0o4oxxvHZvyCdIiH/wzsWf6KITd9mHJlYLW/hwuu8US4yu3zSM200FFSoydYjtfCrm0B2BzL5MaIS/Rx4lmt1SyR1w/P7eFEO1g0mbDBJJE82LIwiIATsV/FHiPshEr2i6qWel0l+uiu9evnfq3rqoKAO4Nulw3zMKojltaiDek4PAUCRWeW9OCk2L3m50L5QbFKjvMskqnetZDXPd8bpq6+Aw9R1oYs9RC/ACy439sEnnkKN0xFdwydj4joIFHOIf/4DfGlj1uwlzdrwujKPqf9DZXVMnjDjLDhcK5j5UBa1QQ+1tFf6IxICrEPOv7zXVXxtNOLRiM+ZkaI593PCdhh2MUZQ23FSvulFJj6sFKU6KQoOebaN6EPvzOoYdgi4/rji3U0klxZNZKi2ocLIjjsBfRhJ0GUZ3DhidQpD2oQvxE/Q+qsg1qHB20AL02uVr4xs2loQLmtCp3OE9ig
X-IPAS-Result: A2GBBABF+55e/zGZrQpcAQmCQYRRliaaUAoBAQEBAQEBAQEHARMcBAEBhwI3Bg4CAwEBCwEBAQUBAQEBAQUDAQEBAoZAC4I7IoQqGjcBPkImAQQRCrkHhU+FMoE4iW2CZoFCPoERgluFFAEUhgkEjgMqiTKZLXwDB4JEBJdmJZxdj3OcbwIEAgQFAhWBaIF6cIM6TxgNoCFIjmOBEAEB
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-external-psk-importer-04.

1. Overview of draft goals and techniques.   We've summarized our understanding of the draft here.  Our subsequent comments are based on this understanding.

a. Goal:  The draft's goal is to define a mechanism by which a TLS client and server can derive multiple, cryptographically separate imported PSKs  (IPSKs) from a single, shared external PSK (EPSK), such that each IPSK is associated with a different combination of protocol parameters (e.g., the target 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 server to establish different EPSKs for these different combinations.  The draft doesn't specify how to establish the EPSK initially (this is left out of scope, as it is in TLS itself). 

b. Mechanism:  The IPSK is derived from the EPSK and other parameters via a key derivation function associated with the EPSK.  The other parameters include a general-purpose context string, the identifier of the target protocol, and the identifier of the target KDF.  The IPSK is thereby bound to these parameters.  The binding to the target KDF helps ensure that the input key material for different KDFs are cryptographically separate. 

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

2. Technical comments. 

a. Distinct identities?  Sec. 3 states "Non-imported and imported PSKs are distinct since their identities are different on the wire."  We have two concerns about this statement.  First, the statement appears to suggest that if two EPSKs have different identities, then they must have different secret values.  But couldn't two EPSKs have the same secret value yet employ different 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 others.  Second, and more fundamentally, the statement assumes that a non-imported EPSK, by definition, cannot be misinterpreted as an imported PSK.  But isn't the identifier of a non-imported EPSK just an opaque string?  A non-imported EPSK identity could therefore have the same "bits on the wire" as an IPSK identity, if the client and server employ an identifier system that whose encoding happens to coincide with the ImportedIdentity structure defined in the draft.  (Moreover, the identifier of a resumption PSK is just an opaque string -- so couldn't this also collide with ImportedIdentity values?  Perhaps we are missing something even more fundamental in our reading.)  ([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-imported 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 optimistic approach and assume that an identifier that meets the ImportedIdentity syntax 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 value is incorrect -- then the server may need to run the code path for non-imported identities as a fallback, checking next to see if the opaque string is recognized as an ordinary EPSK identity.  But this practice just puts more burden on a server against an attacker who replays (or makes up) the PSKIdentity.identity value:  two code paths are exercised for the price of one attempted handshake. 

c.  Mitigations.  One way to reduce the burden is to impose a new requirement 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 mechanism. An ordinary EPSK could have any other value, just not this kind.  But this may not be compatible with the installed base, especially with implementations that allow clients and servers to specify arbitrary EPSK identities. (Consider the case where an application adopts the imported identity syntax for the use intended in this draft, and then decides to reuse the syntax for other purposes, including ordinary EPSK identities.)  

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 would 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 identifiers 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 binder" vs. "imp binder").  But this happens after the implementation has already decided whether to interpret the identifier as external or imported. 

e.  Incremental deployment.  Section 6 states that " the derived PSK will not be the same [as the underlying EPSK] since the importer differentiates the 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 Section 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 IPSK (which ensures that collisions don't occur accidentally).   But there also seems to be an implication in Section 6 that the use of the KDF in the TLS 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 keys MUST NOT use either the external keys or the derived keys for any other purpose," should "Clients" be "Clients and servers" or simply "Endpoints"?

Scott