Re: [TLS] A suggestion for handling large key shares

"Kampanakis, Panos" <kpanos@amazon.com> Tue, 19 March 2024 20:08 UTC

Return-Path: <prvs=8010b3cdd=kpanos@amazon.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 F2ECCC14F689 for <tls@ietfa.amsl.com>; Tue, 19 Mar 2024 13:08:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.101
X-Spam-Level:
X-Spam-Status: No, score=-7.101 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, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001, T_SCC_BODY_TEXT_LINE=-0.01, UNPARSEABLE_RELAY=0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazon.com
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1Bb4bGZZ5WBU for <tls@ietfa.amsl.com>; Tue, 19 Mar 2024 13:08:07 -0700 (PDT)
Received: from smtp-fw-80008.amazon.com (smtp-fw-80008.amazon.com [99.78.197.219]) (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 0D4A9C14F6E1 for <tls@ietf.org>; Tue, 19 Mar 2024 13:08:06 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1710878887; x=1742414887; h=from:to:cc:date:message-id:references:in-reply-to: mime-version:subject; bh=1uzydmMcDPLrg5QidVp2PhvTajF5/rC+kYcOFdebRGI=; b=vuOzK836/Dd8CYTDu7FIfjjy+aSfEmIi/fEh2Ph6++SnVdiJcTk+YprJ C4VX1UST8lJFMAHgR8qCUhS04Z/LpwouGVAwVFkSC2iHE0DXCZMpWE4dj cS80yVcbe2Vmz+lYW0xFzOaVehx4mzVFq/sLI7MfraasuDzZ4Pb5qkfKy w=;
X-IronPort-AV: E=Sophos;i="6.07,137,1708387200"; d="scan'208,217";a="74433143"
Thread-Topic: [TLS] A suggestion for handling large key shares
Received: from pdx4-co-svc-p1-lb2-vlan3.amazon.com (HELO smtpout.prod.us-west-2.prod.farcaster.email.amazon.dev) ([10.25.36.214]) by smtp-border-fw-80008.pdx80.corp.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Mar 2024 20:08:05 +0000
Received: from EX19MTAUWC001.ant.amazon.com [10.0.38.20:6967] by smtpin.naws.us-west-2.prod.farcaster.email.amazon.dev [10.0.35.178:2525] with esmtp (Farcaster) id d06926e6-257c-4acc-ab78-ea234594f836; Tue, 19 Mar 2024 20:08:04 +0000 (UTC)
X-Farcaster-Flow-ID: d06926e6-257c-4acc-ab78-ea234594f836
Received: from EX19D001ANA004.ant.amazon.com (10.37.240.187) by EX19MTAUWC001.ant.amazon.com (10.250.64.174) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.28; Tue, 19 Mar 2024 20:08:04 +0000
Received: from EX19D001ANA001.ant.amazon.com (10.37.240.156) by EX19D001ANA004.ant.amazon.com (10.37.240.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1258.28; Tue, 19 Mar 2024 20:08:02 +0000
Received: from EX19D001ANA001.ant.amazon.com ([fe80::4f78:75cd:3117:8055]) by EX19D001ANA001.ant.amazon.com ([fe80::4f78:75cd:3117:8055%5]) with mapi id 15.02.1258.028; Tue, 19 Mar 2024 20:08:02 +0000
From: "Kampanakis, Panos" <kpanos@amazon.com>
To: David Benjamin <davidben@chromium.org>, "Scott Fluhrer (sfluhrer)" <sfluhrer=40cisco.com@dmarc.ietf.org>
CC: "TLS@ietf.org" <tls@ietf.org>
Thread-Index: Adp5tZo8ZNeXKme6SCu2R7NgBj+X7gACGNKAAB51lJA=
Date: Tue, 19 Mar 2024 20:08:02 +0000
Message-ID: <6c94e7dd71d94b769c72b29318e1208f@amazon.com>
References: <CH0PR11MB544488B051C041EB32541AB6C12C2@CH0PR11MB5444.namprd11.prod.outlook.com> <CAF8qwaDmYMprxW4aYCiEEWKAw04xoSEZU=6fXCHqOcqjnhG6_w@mail.gmail.com>
In-Reply-To: <CAF8qwaDmYMprxW4aYCiEEWKAw04xoSEZU=6fXCHqOcqjnhG6_w@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.37.240.172]
Content-Type: multipart/alternative; boundary="_000_6c94e7dd71d94b769c72b29318e1208famazoncom_"
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/mL7jcF3O-Oz6fBavzsUc_cKuCvk>
Subject: Re: [TLS] A suggestion for handling large key shares
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.39
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, 19 Mar 2024 20:08:11 -0000

Hi Scott, David,

I think it would make more sense for the normative language about Client and Server behavior (section 3.2, 3.4) in draft-davidben-tls-key-share-prediction-00 (https://www.ietf.org/archive/id/draft-davidben-tls-key-share-prediction-00.html ) to go in draft-ietf-tls-hybrid-design. These are now discussed in the Sec Considerations of draft-davidben-tls-key-share-prediction-01, but the “SHOULD” and “SHOULD NOT” language from -00 section 3.2 and 3.4 ought to be in draft-ietf-tls-hybrid-design.

I definitely want to see draft-davidben-tls-key-share-prediction move forward too.

Rgs,
Panos

From: TLS <tls-bounces@ietf.org> On Behalf Of David Benjamin
Sent: Tuesday, March 19, 2024 1:26 AM
To: Scott Fluhrer (sfluhrer) <sfluhrer=40cisco.com@dmarc.ietf.org>
Cc: TLS@ietf.org
Subject: RE: [EXTERNAL] [TLS] A suggestion for handling large key shares


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you can confirm the sender and know the content is safe.


> If the server supports P256+ML-KEM, what Matt suggested is that, instead of accepting P256, it instead a ClientHelloRetry with P256+ML_KEM.  We then continue as expected and end up negotiating things in 2 round trips.

I assume ClientHelloRetry was meant to be HelloRetryRequest? If so, yeah, a server which aims to prefer P256+ML-KEM over P256 should, well, prefer P256+ML-KEM over P256. :-) See the discussions around draft-davidben-tls-key-share-prediction. In particular, RFC 8446 is clear on the semantics of such a ClientHello:

   This vector MAY be empty if the client is requesting a
   HelloRetryRequest.  Each KeyShareEntry value MUST correspond to a
   group offered in the "supported_groups" extension and MUST appear in
   the same order.  However, the values MAY be a non-contiguous subset
   of the "supported_groups" extension and MAY omit the most preferred
   groups.  Such a situation could arise if the most preferred groups
   are new and unlikely to be supported in enough places to make
   pregenerating key shares for them efficient.

rfc8446bis contains further clarifications: https://github.com/tlswg/tls13-spec/pull/1331

Now, some servers (namely OpenSSL) will instead unconditionally select from key_share first. This isn't wrong, per se. It is how you implement a server which believes all of its supported groups are of comparable security level and therefore prioritizes round trips. Such a policy is plausible when you only support, say, ECDH curves. It's not so reasonable if you support both ECDH and a PQ KEM. But all the spec text for that is in place, so all that is left is that folks keep this in mind when adding PQ KEMs to a TLS implementation. A TLS stack that always looks at key_share first is not PQ-ready and will need some changes before adopting PQ KEMs.

Regarding the other half of this:

> Suppose we have a client that supports both P-256 and P256+ML-KEM.  What the client does is send a key share for P-256, and also indicate support for P256+ML-KEM.  Because we’re including only the P256 key share, the client hello is short

I don't think this is a good tradeoff and would oppose such a SHOULD here. PQ KEMs are expensive as they are. Adding a round-trip to it will only make it worse. Given the aim is to migrate the TLS ecosystem to PQ, penalizing the desired state doesn't make sense. Accordingly, Chrome's Kyber deployment includes X25519Kyber768 in the initial ClientHello. While this does mean paying an unfortunate upfront cost, this alternative would instead disincentivize servers from deploying post-quantum protections.

If you're interested in avoiding the upfront cost, see draft-davidben-tls-key-share-prediction-01. That provides a mechanism for clients to predict more accurately, though it's yet to even be adopted, so it's a bit early to rely on that one. Note also the Security Considerations section, which further depends on the server expectations above.

David

On Tue, Mar 19, 2024 at 2:47 PM Scott Fluhrer (sfluhrer) <sfluhrer=40cisco.com@dmarc.ietf.org<mailto:40cisco.com@dmarc.ietf.org>> wrote:
Recently, Matt Campagna emailed the hybrid KEM group (Douglas, Shay and me) about a suggestion about one way to potentially improve the performance (in the ‘the server hasn’t upgraded yet’ case), and asked if we should add that suggestion to our draft.  It occurs to me that this suggestion is equally applicable to the pure ML-KEM draft (and future PQ drafts as well); hence putting it in our draft might not be the right spot.

Here’s the core idea (Matt’s original scenario was more complicated):


  *   Suppose we have a client that supports both P-256 and P256+ML-KEM.  What the client does is send a key share for P-256, and also indicate support for P256+ML-KEM.  Because we’re including only the P256 key share, the client hello is short
  *   If the server supports only P256, it accepts it, and life goes on as normal.
  *   If the server supports P256+ML-KEM, what Matt suggested is that, instead of accepting P256, it instead a ClientHelloRetry with P256+ML_KEM.  We then continue as expected and end up negotiating things in 2 round trips.

Hence, the non-upgraded scenario has no performance hit; the upgraded scenario does (because of the second round trip), but we’re transmitting more data anyways (and the client could, if it communicates with the server again, lead off with the proposal that was accepted last time).

Matt’s suggestion was that this should be a SHOULD in our draft.

My questions to you: a) do you agree with this suggestion, and b) if so, where should this SHOULD live?  Should it be in our draft?  The ML-KEM draft as well (assuming there is one, and it’s not just a codepoint assignment)?  Another RFC about how to handle large key shares in general (sounds like overkill to me, unless we have other things to put in that RFC)?

Thank you.
_______________________________________________
TLS mailing list
TLS@ietf.org<mailto:TLS@ietf.org>
https://www.ietf.org/mailman/listinfo/tls