Re: [TLS] Refactoring the negotiation syntax

Kyle Rose <krose@krose.org> Mon, 18 July 2016 13:51 UTC

Return-Path: <krose@krose.org>
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 1784412DE91 for <tls@ietfa.amsl.com>; Mon, 18 Jul 2016 06:51:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.7
X-Spam-Level:
X-Spam-Status: No, score=-2.7 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=krose.org
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 JwfjywCqHHcX for <tls@ietfa.amsl.com>; Mon, 18 Jul 2016 06:51:28 -0700 (PDT)
Received: from mail-qt0-x22a.google.com (mail-qt0-x22a.google.com [IPv6:2607:f8b0:400d:c0d::22a]) (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 13A1512DD25 for <tls@ietf.org>; Mon, 18 Jul 2016 06:27:30 -0700 (PDT)
Received: by mail-qt0-x22a.google.com with SMTP id 52so91494927qtq.3 for <tls@ietf.org>; Mon, 18 Jul 2016 06:27:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=krose.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=9SeUQg6qVZ47RiE67bwTMpc3YnC8rtC5UZORJaTWGvo=; b=LjkgUW1/HDGEYInizqdz3uWJ5lpTt5aF1fZGHKPS4wO51ccnzSt97XzKehh/z7/Nj8 LMjZdDBwbW5vVQ/k30jd1Fjfbi/xWo/eOzDxtU3wlAu03Gqh9ZM+SFbtgUsDo9lKqOjG J2k5lFyBHps32ehzg10lIdIzJdgWP6h0h8jXs=
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:from:date :message-id:subject:to:cc; bh=9SeUQg6qVZ47RiE67bwTMpc3YnC8rtC5UZORJaTWGvo=; b=Ksz91/hF+bu42ff1hQoZnd3o21mpaaiA+XJOYvTh/6ZRWQrXxq5HSq3tPCN/ppkrbl 4znAxvoo7vu0thFEKzRT0FKa1ogj5rZn3PYdE+pLORCcMWDMQYQ8E7RkpGjPioqB6Ufp gK/3enwJtzTAeVxEl47iYpGeP23yoKxjjEOjDK8R+XmH8HQEP1SXM6ROIY+GVCde9qn1 PGlUU54gRl+/X/CauLLSRK76YIxa7WvimJzzkwmEJswFHzwRyWqs4QM76l9UVU4pCLtx edIQulrrAzUGozSGxfcvh2sUJf1UOQn/O3ZcRuwA08Qcig2b+H+0Z38wMUZAFGfc6k// HiCQ==
X-Gm-Message-State: ALyK8tI83AXY+k1RwfqSI39x7hFd6auDX9rUHZJdEd9rUVkWDfHT2+n7k1ZELzHsmwvk9Nl7MVyieztf7iyCSw==
X-Received: by 10.237.36.38 with SMTP id r35mr52728481qtc.3.1468848449063; Mon, 18 Jul 2016 06:27:29 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.55.118.135 with HTTP; Mon, 18 Jul 2016 06:27:28 -0700 (PDT)
X-Originating-IP: [31.133.178.3]
In-Reply-To: <CABcZeBPh+BGtnBb725G+YzZZzdSUh5KtViqh3Z339apSKRpygg@mail.gmail.com>
References: <CABcZeBPh+BGtnBb725G+YzZZzdSUh5KtViqh3Z339apSKRpygg@mail.gmail.com>
From: Kyle Rose <krose@krose.org>
Date: Mon, 18 Jul 2016 15:27:28 +0200
Message-ID: <CAJU8_nXwuyLgNGpyvAsmyAq4e_nR9U0g3vtrj3tNR2tHmSqPkQ@mail.gmail.com>
To: Eric Rescorla <ekr@rtfm.com>
Content-Type: multipart/alternative; boundary="001a113d3aac092b690537e8ee27"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/Xs3hEazCsNyAjEwRe1Zl1OIlgis>
Cc: "tls@ietf.org" <tls@ietf.org>
Subject: Re: [TLS] Refactoring the negotiation syntax
X-BeenThere: tls@ietf.org
X-Mailman-Version: 2.1.17
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: Mon, 18 Jul 2016 13:51:34 -0000

On Wed, Jul 13, 2016 at 7:12 PM, Eric Rescorla <ekr@rtfm.com> wrote:

> There have been a lot of discussions about whether we should try to
> refactor cipher-suite negotiation to be less monolithic in the cipher
> suite. I've generally been on the "no" side of that on cost/benefit
> grounds as well as not quite seeing how it would fit into the rest
> of the infrastructure. However, now that we're starting to get full
> implementations, and it's becoming clearer how the new elements
> (principally PSK-resumption and key_shares) interact with cipher
> suites, I've started to think that in fact we may be able to clean
> things up. One proposal for this is below [0]. I know this is
> pretty late in the process, but if we do want this change it's
> better to do it now.
>
> I'm sure we'll need to discuss this in Berlin, but in the meantime,
> fire away.
>
>
> The basic idea here is to factor out the TLS 1.3 negotiation into three
> mostly orthogonal axes.
>
> - Symmetric cipher/PRF  -- indicated by the cipher suite list as in TLS 1.2
> - Key exchange -- indicated by the key_shares and pre_shared_key extensions
> - Authentication -- indicated the signature_algorithms and pre_shared_key
>   extensions
>

Tl;dr: I think this is a good approach because it eliminates much of the
existing negotiation redundancy/complexity and combinatorial explosion in
the 1.3+ ciphersuite menu.

The longer version: the argument I made in Prague (though IIRC not very
clearly) was that while it would be nice to limit the ciphersuite options
to agreed-upon "good" combinations based on some sane notion of
forward-looking security margin (notwithstanding the practical inability to
see the future), the reality on the ground is that authentication is based
on something pre-existing---the server has one or two long-term keys of a
fixed length (e.g., one RSA-2048 and one P-256) that it can't augment on
demand---so it really only makes sense for the client to indicate what it
supports and to deal with whatever the server chooses to send it on that
basis. So I'd argue that this one is orthogonal based on that constraint,
and so it should be negotiated separately.

AEAD and PRF OTOH don't come with built-in keys, so they can always be
chosen as a pair as a function of the desired security margin.

Key agreement is not clearly in either category: when it's PSK, it's based
on what you have, so it's similar to authentication; but when it's (EC)DHE,
it's not, and so ideally you'd like the chosen group to be tied to the
AEAD/PRF security margin. But, since the client has to offer specific
groups rather than specifying general support for ECDHE or EdDHE, both
because ideally we want the client key share sent in the first flight and
because unlike RSA or FFDHE a client can't generalize to key sizes it
hasn't seen before, it actually still shares a lot in common with the auth
case of being sort-of something you have rather than something you can
choose on the fly. So I'm also in agreement that this is mostly orthogonal
and should be negotiated separately.

So now you have several grab bags and need to choose one from each. Is it
necessary to tie the various bits together by security margin? Not clear.
It's probably fine to assume a client isn't going to announce support for
anything it doesn't think is secure enough, so the only practical downside
to using e.g. AES256-GCM-SHA384 with P-256 ECDSA is the unnecessary
additional CPU consumption of AES-256/SHA-384. The client was willing to
accept P-256 server authentication, so presumably it's happy with that
security margin; and anyway, the server could prefer ciphersuites and ECDHE
groups that better match the available auth credentials.

Additionally, aside from the situation in which a paucity of ciphersuites
is offered by a client, the one situation with no good resolution is
security margin of PSK vs. authentication in PSK+signature: both are based
on pre-existing credentials, one offered by the client and one offered by
the server, so if they disagree there's nothing to be done about it. So
maybe the server then just prefers ciphersuites (and group in PSK+DHE) that
match the minimum of the security margin of the PSK and available auth
credentials.

Or maybe prospective security margin is too complex and/or too ill-defined
to bother with, and a server should just choose the least CPU-intensive
combination of everything.

In other words, we just eliminate the redundancy with the cipher suite
> indications. This leaves is with the question of how to handle the
> existing TLS 1.2 cipher suites. We can either assign new cipher suites
> or say that any cipher suite with *_aead_alg_hash means that we
> support aead_alg_hash. Matter of taste.
>

Meaning that if a 1.3 client offers TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
and the server has only TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 in its
list, that they would internally map to the same ciphersuite and so the
server would agree on and offer up the client's code point? It might be
cleaner just to have new suites for 1.3, if for no other reason but to
reduce confusion when someone looks at this ten years from now.

Kyle