Re: [TLS] Extensions "supported_groups" and "key_share" in TLS 1.3

Xuelei Fan <xuelei.fan@vimino.com> Thu, 26 November 2015 15:37 UTC

Return-Path: <xuelei.fan@vimino.com>
X-Original-To: tls@ietfa.amsl.com
Delivered-To: tls@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4C0391B3B55 for <tls@ietfa.amsl.com>; Thu, 26 Nov 2015 07:37:15 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.278
X-Spam-Level:
X-Spam-Status: No, score=-1.278 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=no
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 qm5k851wPZri for <tls@ietfa.amsl.com>; Thu, 26 Nov 2015 07:37:13 -0800 (PST)
Received: from mail-ob0-x230.google.com (mail-ob0-x230.google.com [IPv6:2607:f8b0:4003:c01::230]) (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 59EE61B3B4F for <tls@ietf.org>; Thu, 26 Nov 2015 07:37:13 -0800 (PST)
Received: by obdgf3 with SMTP id gf3so65711496obd.3 for <tls@ietf.org>; Thu, 26 Nov 2015 07:37:12 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vimino-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=LqLFaGikE2sPdv2DevgwmAUdPb1Kmsu3/Y2aCvTPDdM=; b=B/enZQgz4ZNpJe3Xz8XmaJgRNa3f65OYNUsopQ9ROP9+/OBX704tq7QDiTX6DyAPg1 zlHvX9BOLpX3wa7w3daKt2hyyZUbDFl5LV8iVG/Ls6UD8kVw4IhPKBVw0MeadhH3Sd6d aTVp6QWAbwSclhmMDFdanLnaGRI2C8Ys8oQEgWpQySe997VW+jKMXmkZphUeb+XVybs9 TwArUtxD4H5q4EjgMNrfY3e4B/1RTwzhLJlqxt3i1wsnAvNkylrN5uwdEcFYWPH2K48M iKBcsaJ6csEBVZoeMtqdkjGivZ+fNZCvf5LzdEr4vXIMylxMpK3oPnx37iBJS1e8y0rH 3Ngw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=LqLFaGikE2sPdv2DevgwmAUdPb1Kmsu3/Y2aCvTPDdM=; b=gme/mbWlkiuhrx8fS5+7Q7gHa30/kjRsps0vHqcTdh9RuUMZWJComzMzG/ifCMamlZ zWzJnAtGHENmKPRgSmrT51Y+AFnScXJ8wYf+/cV2VOr9Sb0KSSeRFU754Ehvuqu7iouM OEYy9fxkv5ZmDYwySImNfVELoAO/0cxjSA+cS0W6slb1cmeK9TE+bqPJOC+WFZ8IBscw ZlRzXzbZrw6qBo9ejPDj7i9TBBUdJf1/hdVelBJRjRw87ItWt9WKTtIC5HgE5A1lP6X5 baOAdP6oYIyEcgF2bWSKdvXS5Lv6ts3IyQQEo+BBIBxHvT4m/jZ4eWRouE3JX5ueFWzs USzg==
X-Gm-Message-State: ALoCoQkfI+Tyss6dp85teOY+rqHTo6nfzTsj8ICKlPWXOS/Z0Byq+tXuwBd1WYmbtICZzIeR6Eg6
MIME-Version: 1.0
X-Received: by 10.182.81.162 with SMTP id b2mr28589003oby.7.1448552232770; Thu, 26 Nov 2015 07:37:12 -0800 (PST)
Received: by 10.76.171.103 with HTTP; Thu, 26 Nov 2015 07:37:12 -0800 (PST)
X-Originating-IP: [148.87.19.222]
In-Reply-To: <20151126142632.GA3582@LK-Perkele-V2.elisa-laajakaista.fi>
References: <CAAgBOhuOPB=jxO=WWHmy_y7ARY5qfdK2x4xC9t-Z-vn0UU5Paw@mail.gmail.com> <20151126142632.GA3582@LK-Perkele-V2.elisa-laajakaista.fi>
Date: Thu, 26 Nov 2015 23:37:12 +0800
Message-ID: <CAAgBOhtG7vKx6Bro9+Qp2Gbcz8sitatYKEL=R5tW8ix7rSeMqw@mail.gmail.com>
From: Xuelei Fan <xuelei.fan@vimino.com>
To: Ilari Liusvaara <ilariliusvaara@welho.com>
Content-Type: multipart/alternative; boundary="047d7b2e49f046083605257359bc"
Archived-At: <http://mailarchive.ietf.org/arch/msg/tls/acbGHli3skVqupAc1rs2vS4cbPM>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Extensions "supported_groups" and "key_share" in TLS 1.3
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.15
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, 26 Nov 2015 15:37:15 -0000

Thanks for the quick feedback.  You answered some questions puzzled me for
a while.

On Thu, Nov 26, 2015 at 10:26 PM, Ilari Liusvaara <ilariliusvaara@welho.com>
wrote:

> On Thu, Nov 26, 2015 at 09:52:37PM +0800, Xuelei Fan wrote:
> > Hi,
> >
> > Per the latest draft of TLS 1.3, both "supported_groups" and "key_share"
> > extensions are REQUIRED for DHE or ECDHE cipher suites (Section 8.2).
> Both
> > extension need to provide the supported named groups in preference order.
> > Looks like the functions are overlapped.  I was wondering, it may be nice
> > to obsolete the "supported_groups" extension, and use "key_share"
> extension
> > for both the supported named groups and the key exchange information for
> > each group.
>
> This wouldn't work if one had to downnegotiate TLS 1.2. That is going to
> happen A LOT.
>
> I think, "supported_groups" extension still can be sent for TLS 1.2, but
can be ignored for TLS 1.3.  And "key_share" extension can be extended to
support TLS 1.2 and previous versions.


> Also, one can support curve, but not prefer to send share on it (the
> server can call for it, at cost of extra RTT).
>
> The scenarios may be not effective because of the extra RTT.  As if the
client want to negotiate the curve, it may be more effective to provide the
key information in the beginning.  Or, maybe the generation of the key
exchange information is more expensive?


> Plus, some of the curves are of special purpose and won't ever have
> shares.
>
> I missed this point.  Is it possible to update the shares to tolerate the
special purpose?  For example, allowing empty shares.


> Also, IIRC, if client has no shares, it omits key_share. If server wants
> FS cipher suite, it then has to signal retry.
>
> That's may be the point I missed, too.  Where and when the shares come
from?  Looks like there are two cases:
1. client generate the shares and wrap them in the initial ClientHello
message.
2. client omits the key_share, but still request for (EC)DHE cipher suites.
If server want to negotiate (EC)DHE cipher suite, need an extra RTT.
Client generate the shares on server request.

I think the cases answer my confusing of the two extensions.  Suppose, if
the shares can be optional, maybe it is easier to use key_share only.  If
client has no shares, using key_share with no shares (function as
supported_groups); if client has shares, using key_share with shares.


> > The "supported_groups" extension defines the groups, while the
> "key_share"
> > extension defines both the groups and the key exchange information.  Both
> > extension has its own preferences for the supported named groups.  It's
> > easy to get conflicted if the two preferences are not consistent.  The
> > "key_share" extension contains the information of the supported named
> > groups.  So, the information can be used to indicate the client supported
> > named groups.  Maybe, for TLS 1.3, it is not necessary to use the
> > "supported_groups" extension any more.
>
> The only way to be conflicted would be to send key share for group not in
> supported_groups. Sending supported_group for group not in key_shares is
> not a conflict[1].
>
> The preferences may be not consistent, too.  For example, the
supported_groups prefer ffdhe2048, but the key_share prefer ffdhe4096.
Using two preferences would make the implementation inconsistent between
vendors if no clearly specification about the preference of the two.


> [1] In fact, I expect many clients to send shares for P-256 and X25519,
> plus offer P-384 and X448 (without shares unless requested).
>
>
> I like this scenarios more.  It might be more clear if TLS 1.3 support
this scenarios, but not the scenarios that sending shares before
requested.  For the TLS vendors, client implementation may only consider
one option. While a server implementation need to consider both, the effort
doubles.

Thanks,
Xuelei


> -Ilari
>