Re: [TLS] Comments on draft-wood-tls-external-psk-importer-01

John Mattsson <john.mattsson@ericsson.com> Thu, 04 April 2019 06:22 UTC

Return-Path: <john.mattsson@ericsson.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 4DC65120320 for <tls@ietfa.amsl.com>; Wed, 3 Apr 2019 23:22:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.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 XmxfQFNoB97e for <tls@ietfa.amsl.com>; Wed, 3 Apr 2019 23:22:32 -0700 (PDT)
Received: from EUR02-AM5-obe.outbound.protection.outlook.com (mail-eopbgr00080.outbound.protection.outlook.com [40.107.0.80]) (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 A9AFA120338 for <TLS@ietf.org>; Wed, 3 Apr 2019 23:22:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BkOxE/RLmJm4qAgCO8/AcF3MKTXObMiRnCVCyUtdCFM=; b=cokM2IFaSB52KbSYlvzf+ecOFsIvu++vRrL1l2k4uV6IVgu8OljAh/iQOph6hxocvkai+WZSGp2fQ+y+ILf8s9wM734239D/xBblmdqYUwG3ZT7syerSI81cgBtQQu3V56/K7emG1haFM3nVaY0Or8FdV9Xiya10hL0EKjlaWLA=
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com (20.176.166.22) by HE1PR07MB4380.eurprd07.prod.outlook.com (20.176.167.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1771.6; Thu, 4 Apr 2019 06:22:29 +0000
Received: from HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::91bd:a367:2414:b4bc]) by HE1PR07MB4169.eurprd07.prod.outlook.com ([fe80::91bd:a367:2414:b4bc%5]) with mapi id 15.20.1771.007; Thu, 4 Apr 2019 06:22:28 +0000
From: John Mattsson <john.mattsson@ericsson.com>
To: Christopher Wood <caw@heapingbits.net>
CC: "TLS@ietf.org" <TLS@ietf.org>
Thread-Topic: [TLS] Comments on draft-wood-tls-external-psk-importer-01
Thread-Index: AQHU6L09RDZKHT8Ksk2niB+rgTbbFKYqgKOAgAEs9wA=
Date: Thu, 04 Apr 2019 06:22:28 +0000
Message-ID: <E98C5FE0-324D-4A92-AC3B-2219A0E26BC3@ericsson.com>
References: <89127FF7-CE3F-4DF1-98A5-B1006C5FF56B@ericsson.com> <CC00A43F-4E77-4E13-8DB2-9BF221784673@heapingbits.net>
In-Reply-To: <CC00A43F-4E77-4E13-8DB2-9BF221784673@heapingbits.net>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
user-agent: Microsoft-MacOutlook/10.17.1.190326
authentication-results: spf=none (sender IP is ) smtp.mailfrom=john.mattsson@ericsson.com;
x-originating-ip: [82.214.46.143]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 7bdbf200-9716-4bfb-c729-08d6b8c5e9c2
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(2017052603328)(7193020); SRVR:HE1PR07MB4380;
x-ms-traffictypediagnostic: HE1PR07MB4380:
x-ms-exchange-purlcount: 2
x-microsoft-antispam-prvs: <HE1PR07MB438066C35AEA34BC0293CA4289500@HE1PR07MB4380.eurprd07.prod.outlook.com>
x-forefront-prvs: 0997523C40
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(39860400002)(366004)(346002)(376002)(396003)(199004)(189003)(51914003)(13464003)(25786009)(229853002)(86362001)(71190400001)(8936002)(83716004)(71200400001)(8676002)(33656002)(3846002)(6116002)(36756003)(6486002)(256004)(106356001)(105586002)(14454004)(2906002)(5660300002)(6436002)(44832011)(81166006)(81156014)(966005)(6916009)(6512007)(6306002)(53546011)(478600001)(6506007)(53936002)(66066001)(2616005)(186003)(97736004)(26005)(102836004)(82746002)(6246003)(7736002)(486006)(11346002)(476003)(446003)(305945005)(4326008)(99286004)(58126008)(316002)(68736007)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:HE1PR07MB4380; H:HE1PR07MB4169.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: 4gfEMnAWVuJaVvIqoYEalpjMnSk+TyR6cbBtC8HQ65jGC4gwdAaCAbXbmrPtZuoc3bjiwSyylEyzZ9TK11Dgsv6OeikfU/SxhLwzdczdsbdKxWhyabWXnfsr020XjnO1fBcQQFQU3gXWRxTVIEwgM7pSQoDakvrEB/FLkbjjJFdJauCLTPnLFcRsroTK6tJ1ViZA62rRGXFqtOAHUMwXNn/PvzcWecL7cBq1nHILlhxsISWbH0mhAU8kl0Ih6hYo+0+Lu9e3ac15MfjgNG8/7SJemfanpoOX5kRAXkrkdaTJRhFLSfgvQ2VlAB5KCMj54d2jiLhQkjHlZW6x2RBdLi9hF5v20AlKC54xx5dQxcOZWENI3RnSkRDzjxiPIcZOFRYBqpsZcTvYZTaPaS0sjF5z+bVLPa295alWIKXwNoI=
Content-Type: text/plain; charset="utf-8"
Content-ID: <9C384550DFD44542AC03920CC3A71235@eurprd07.prod.outlook.com>
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-OriginatorOrg: ericsson.com
X-MS-Exchange-CrossTenant-Network-Message-Id: 7bdbf200-9716-4bfb-c729-08d6b8c5e9c2
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2019 06:22:28.7697 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR07MB4380
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/dvxXjUyYQJFQVAVdd2zn3TIAfSI>
Subject: Re: [TLS] Comments on draft-wood-tls-external-psk-importer-01
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: Thu, 04 Apr 2019 06:22:35 -0000

Hi Christopher,

Thanks for the clarifications.

>You’re correct that this requires both endpoints to adopt the change 
>simultaneously. However, that does not contradict the quoted text, which 
>states that the protocol is not changed.

I think "this requires both endpoints to adopt the change simultaneously" is a problem as it makes it impossible to introduce this mechanism in many existing deployments. I would expect a solution that can be introduced gradually (some nodes at a time) in existing deployments supporting RFC 8446 and/or RFC 5246.

But, if you want to change the behaviour of the using the same external PSK in both TLS 1.2 and TLS 1.3 as allowed by RFC 8446, a solution not requiring "simultaneous change" is probably not possible.

The requirement that "this requires both endpoints to adopt the change simultaneously" should probably be highlighted in the document.

The current mechanism does not seem to be deployable for e.g. 3GPP until TLS 1.4 is introduced, and then only for TLS 1.4 and later...  on the other hand, being limited to SHA-256 for PSK may be ok for 3GPP. (and 3GPP could just derive a Separate SHA-384 PSK if needed).

Some more comment:

- Which label should be used by various versions of DTLS?

- "If a client or server wish to deprecate a hash function and no longer
use it for TLS 1.3, they may remove this hash function from the set
of hashes used during while importing keys.  This does not affect the
KDF operation used to derive concrete PSKs."

If someone deprecates the use of a hash function inside TLS 1.3 (used by Transcript-Hash and HKDF), does it then makes sense to keep deriving keys outside of TLS with that same deprecated hash function?

- "To mitigate these problems, external PSKs can be bound to a specific hash function when used in TLS 1.3"

I would change to "are bound to a specific". If the application does not specify anything, the keys are bound to SHA-256.

Cheers,
John

-----Original Message-----
From: Christopher Wood <caw@heapingbits.net>
Date: Wednesday, 3 April 2019 at 16:25
To: John Mattsson <john.mattsson@ericsson.com>
Cc: "TLS@ietf.org" <TLS@ietf.org>
Subject: Re: [TLS] Comments on draft-wood-tls-external-psk-importer-01

    Thanks for the feedback, John. I filed issues on the GitHub draft 
    located at [1]. Please see inline below for comments.
    
    On 1 Apr 2019, at 12:00, John Mattsson wrote:
    
    >  Hi,
    >
    > Thanks for trying to solve this problem! Not having a way to use the 
    > same external PSK for different cipher suites is definitely a thing 
    > missing from TLS 1.3.
    >
    > As I stated during the wg session, 3GPP have a few use cases that use 
    > PSK-ECDHE between phone and core network. Contrary to what IETF people 
    > sometimes believe, most 3GPP use of TLS (between phone and core 
    > network, between core nodes, and between different operators) use 
    > mutual authentication with certificates.
    >
    > According to the current 3GPP specification, the phone and the core 
    > network would share an external PSK and an external identity. The hash 
    > function is undefined, i.e. SHA-256 is used for TLS 1.3. The phone and 
    > the network would then negotiate TLS 1.2 with any cipher suite or TLS 
    > 1.3 with SHA-256.
    >
    > Some comments
    >
    > - The draft should make clear if the External PSK and external 
    > identity can be used together with the imported identities. I assume 
    > the idea is that they can’t but I can’t see any text specifying 
    > this.
    
    Indeed, that was the intent.
    
    >
    > - ”Imported keys do not require negotiation for use, as a client and
    > server will not agree upon identities if not imported correctly.
    > Thus, importers induce no protocol changes with the exception of
    > expanding the set of PSK identities sent on the wire.”
    >
    > While I see how the defined mechanism can be deployed in a new 
    > deployment, I do not see how to introduce it in an existing 
    > deployment. Assuming that the external PSK cannot be used together 
    > with the imported identities, the TLS client and server must introduce 
    > the mechanism at the same time, that is often not possible to control.
    
    You’re correct that this requires both endpoints to adopt the change 
    simultaneously. However, that does not contradict the quoted text, which 
    states that the protocol is not changed.
    
    >
    > - “struct {
    >        opaque external_identity<1...2^16-1>;
    >        opaque label<0..2^8-1>;
    >        HashAlgorithm hash;
    >    } ImportedIdentity;
    >   ”
    >
    > This scales poorly, A client has to send n*m identities where n is the 
    > number of supported versions and m is the number of supported hash 
    > algorithms...
    
    Yes, this is a tradeoff we made by opting to not modify the key 
    schedule.
    
    >
    > - Would it not be possible to just use the version number as label? 
    > I.e. 0x0304 instead of “tls13”. In that way you do at least not 
    > have to define a new labels.
    
    We probably could, though since the labels are subject to change (see 
    the TODO about possibly including the HashAlgorithm in the label), we 
    kept it as is.
    
    >
    > - “TLS 1.3 [RFC8446] supports pre-shared key (PSK) resumption, 
    > wherein
    > PSKs can be established via session tickets from prior connections or
    > externally via some out-of-band mechanism.”
    >
    > This seems to indicate that all use of PSK is resumption which is not 
    > correct. I suggest changing to “TLS 1.3 [RFC8446] supports 
    > pre-shared key (PSK) authentication”
    
    Good suggestion! We’ll fix it.
    
    >
    > - “importing external PSK (Pre-Shared Key) into TLS.”
    >
    > Not sure if “into” is the right word, I think “for” as in th e 
    > title is better. The mechanism seems very much external to TLS itself. 
    > I see it as a mechanism to derive several external PSKs from a single 
    > external PSK.
    
    Ditto.
    
    >
    > - “Similarly, TLS 1.2 and all prior TLS versions should use "tls12" 
    > “
    >
    > The versions prior to TLS 1.2 will soon be deprecated. And why spend 
    > time updating the TLS 1.2 code base instead of moving to TLS 1.3?
    
    We’re just covering our bases here. I tend to agree that the focus 
    should be on updating to TLS 1.3 instead of “patching” TLS 1.2 
    stacks.
    
    >
    >
    > Suggestion:
    >
    > Instead of deriving a large set of new external PSKs, wouldn’t it be 
    > possible to just use different hash functions in different parts of 
    > the key hierarchy? I.e. if SHA-256 is associated with the external PSK 
    > and SHA-384 is the hash algorithms in the chosen cipher suite:
    >
    > PSK ->  HKDF-Extract(SHA-256) = Early Secret
    >           |
    >           +-----> Derive-Secret(., "ext binder" | "res binder", "")
    >           |                     = binder_key
    >           |
    >           +-----> Derive-Secret(., "c e traffic", ClientHello)
    >           |                     = client_early_traffic_secret
    >           |
    >           +-----> Derive-Secret(., "e exp master", ClientHello)
    >           |                     = early_exporter_master_secret
    >           v
    >     Derive-Secret(., "derived", "")
    >           |
    >           v
    > (EC)DHE -> HKDF-Extract(SHA-384) = Handshake Secret
    >
    > Support of this could be signalled with the tls_flags extension. If 
    > the server does not support the extension it must according to RFC 
    > 8446 chose a cipher suite with SHA-256.
    
    Modifying the key schedule was discussed in the context of [2]. At the 
    time, it seemed the desire to not touch the key schedule outweighed the 
    desire to not inflate the ClientHello.
    
    Best,
    Chris
    
    [1] https://github.com/chris-wood/draft-wood-tls-external-psk-importer
    [2] https://tools.ietf.org/html/draft-davidben-tls-universal-psk-00