Re: [TLS] TLS Suite Naming Conventions

David Benjamin <davidben@chromium.org> Sat, 06 January 2024 17:54 UTC

Return-Path: <davidben@google.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 D4109C14F5F1 for <tls@ietfa.amsl.com>; Sat, 6 Jan 2024 09:54:44 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.237
X-Spam-Level:
X-Spam-Status: No, score=-14.237 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, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_KAM_HTML_FONT_INVALID=0.01, T_REMOTE_IMAGE=0.01, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 SbvWYtHDIilC for <tls@ietfa.amsl.com>; Sat, 6 Jan 2024 09:54:40 -0800 (PST)
Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 77E64C14F5F7 for <tls@ietf.org>; Sat, 6 Jan 2024 09:54:40 -0800 (PST)
Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-5f0629e67f4so4846647b3.3 for <tls@ietf.org>; Sat, 06 Jan 2024 09:54:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1704563679; x=1705168479; darn=ietf.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Ux4Tmnze7prlM2F/02Qp4UTnbvQPgLe99Bfl5NFM08I=; b=Ssckf7RskSjXxne6JVVm9v+U9LI4vlHJrI8rG3uqrYWLcJYjVQuNy1MLem6cOq+WLM LorXx23hYap64sfrxe5Q2ZtPuzIYbPnGsHqYFwZ38CLLcpECJXoqMQKW8K789twAISki 390JruRlE74NI+wGmbY3VwprvZS1ZcUbIb61w=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704563679; x=1705168479; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ux4Tmnze7prlM2F/02Qp4UTnbvQPgLe99Bfl5NFM08I=; b=lDO+1cE1xKRbP2iNGWKeizw2pqt9HHvTahoPNJaEqqekaPyeYKzERW8De4PMEAgVe7 v8rnKVt8ZqWoJEhrMByVAiZeGqY6r6NK4Aov9j49QacvbYKSztsbb36cBFwBV5+eS1Hc kL+6GFnP50Dwo1jLrlQrvsozhGod+BJT6YI6cgw/vSVHuRO9AMXdImVtLsxfgki8dni1 9oy4041HY3zj8hPybCnYyf7QL72g/BbS6zuSFozoKf89W2SuqQ3ek/nVWDANHWf6wTDK TaWBfRvULNEWtTGbY/CVADsehnMVm/8+rQ4U5E+GvebjptQO7KYnhYJbw1Wh0jE/cv3Y 1LTg==
X-Gm-Message-State: AOJu0YxYTHX6ES/iMJw4owMpdPgzZcPBr3ctcRFRsI6JHAKaTVDzfENw Nt8LkuGNTBOmzaZoCGahZ2GPmkiXp6NacLqx4yHKoY96Tmam1cvuy9SYZc6j4q8=
X-Google-Smtp-Source: AGHT+IG6FUBAVrEJWqJiBkgMJlL7cMa4+GIosYKVpUZaurUa5GNKBBrVXMb2tSpgOC7F2KifD+GISSIWSa8fcg8xNzk=
X-Received: by 2002:a81:6c13:0:b0:5e8:bba2:bc59 with SMTP id h19-20020a816c13000000b005e8bba2bc59mr632375ywc.52.1704563679249; Sat, 06 Jan 2024 09:54:39 -0800 (PST)
MIME-Version: 1.0
References: <CAN8C-_Jwm0o71LVM1W-VVKJpggkUPcAptq1zXK4=3WMN59mh=A@mail.gmail.com> <CAF8qwaB8cLWiHrb91AN6yDWCXOAM+s_F=Yewbnb3M8DJyq5MZg@mail.gmail.com>
In-Reply-To: <CAF8qwaB8cLWiHrb91AN6yDWCXOAM+s_F=Yewbnb3M8DJyq5MZg@mail.gmail.com>
From: David Benjamin <davidben@chromium.org>
Date: Sat, 06 Jan 2024 12:54:21 -0500
Message-ID: <CAF8qwaDpnJNq78yuPn964QS5FZNjE_h9dvD4JSyL0Opfmdwekg@mail.gmail.com>
To: Orie Steele <orie@transmute.industries>
Cc: tls@ietf.org
Content-Type: multipart/alternative; boundary="00000000000099af11060e4aa8bf"
Archived-At: <https://mailarchive.ietf.org/arch/msg/tls/wX-vDRr8Kbxa2zK1CyTsXsl9_hI>
Subject: Re: [TLS] TLS Suite Naming Conventions
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: Sat, 06 Jan 2024 17:54:44 -0000

On Sat, Jan 6, 2024 at 12:23 PM David Benjamin <davidben@chromium.org>
wrote:

> I think this thread stems from a misunderstanding of what TLS is doing,
> and what "Ed25519" means.
>
> > In the thread, Neil said that it is better to negotiate for key
> (representations), instead of algorithms, and that TLS has been moving away
> from fully specifying things.
>
> This is the exact opposite of what TLS 1.3 has done. I see the JOSE email
> claims we've moved away from fully specifying things by citing the cipher
> suite change, but that is misunderstanding what changed.
>
> The SignatureScheme enum negotiates a signature algorithm, which then
> implies a key type. It used to be that this information was scattered. To
> see if a ECDSA key was viable in TLS 1.2, you had to look in...
> - Cipher suites, to see if there was a TLS_ECDHE_ECDSA_*
> - Supported curves, to see if P-256 was in there
> - EC point formats, to see if your point format was in there
> - Signature algorithms, to see if (ECDSA, SHA-256) (or some other hash
> your key supported) was in there.
>
> This was a huge mess. Especially when you consider that this key is a
> long-lived credential, and thus at the boundary between the TLS
> implementation and deployment-specific requirements (sticking keys in some
> hardware thing), this selection information often needs to be exported out
> of the library. TLS 1.3 does away with all this and collapses all the
> information into a *single* enum, ecdsa_secp256r1_sha256.
>
> Now, the email mentions cipher suites. We did indeed take the
> "ECDHE_ECDSA" half out of the cipher suite and left only the AEAD and the
> PRF hash. That was *not* about fully specifying things. Rather, it was
> about keeping atomic things atomic. "ECDHE_ECDSA" was not useful. "ECDSA"
> could not be evaluated without checking the above extensions. Likewise,
> "ECDHE" would not be evaluated without checking many of those same
> extensions. Once we shifted to SignatureScheme being the long-lived
> credential and NamedGroup (formerly supported curves) being the ephemeral
> key exchange, that partial information is redundant.
>
> In TLS 1.2, "ECDHE_ECDSA" served a second purpose, which was to say we
> were doing a Diffie-Hellman + signature handshake, not an RSA-key-exchange
> style handshake. However, it did so in a very awkward way. However, we
> removed the latter in TLS 1.3. Once that was gone, this information was
> completely redundant and only made negotiation more complicated. Thus, we
> removed it.
>
> Now, we could have decided that we actually like having a single enum,
> rather than a few orthogonal enums, and replaced SignatureScheme +
> NamedGroup with, a single "cipher suite" that specified (ECDSA-P256-SHA256,
> ECDH-P256, AES-128-GCM, HKDF-SHA256). That would have been more in keeping
> with the original (SSL3-era) naming of "cipher suite", and still satisfied
> the "keep atomic things atomic" goal. And perhaps having a single enum to
> specify the TLS settings would have been nice. (No one remembers there
> have been multiple configuration points in TLS.) However, for better or
> worse, TLS *already* eroded the "cipher suite" as a fully specified enum.
> I think it started with RFC 4492, which opted for a couple side extensions
> rather than putting the ECDSA and ECDH variant into the cipher suite. It
> would have been a *bigger* departure from TLS 1.2 to do that, than what
> we actually did. Thus, we stuck with the orthogonal enums model and
> finished the evolution started by TLS 1.2.
>
> > I see that "ed25519(0x0807)," could have been "eddsa_ed25519", and I
> assume "0x0807" actually means "eddsa with ed25519", and "0x0808" actually
> means "eddsa with ed448".
>
> When you say "Ed25519", it *already* implies EdDSA. EdDSA is a family of
> signature schemes. That is, it is a way to construct a signature scheme
> given some parameters. Ed25519 is a particular instantiation of that.
> Saying "eddsa_ed25519" would have been redundant, and would not match
> existing naming conventions.
> https://datatracker.ietf.org/doc/html/rfc8032#section-5.1
>

Since I suspect this is where some of the confusion comes from, let me
point something out from RFC 8032: Ed25519 is *not* an elliptic curve in
the way that P-256 is. RFC 8032 uses edwards25519 to refer to the elliptic
curve in Ed25519. This is a name you've probably never seen used because it
is an implementation detail of Ed25519. When using the primitive, you don't
actually care how it is defined, just the name (Ed25519) and interface.

Now, sometimes people are a bit sloppy and say "Ed25519" to mean the curve.
The original Ed25519 paper didn't formally give a name to the curve itself,
and if you know you're talking about an elliptic curve instead of a
signature scheme, this is unambiguous. There's only one curve in Ed25519,
realistically, we'll probably never instantiate another signature scheme
with that curve. SHA-512 is fine. But due to the history of people trying
to separate key and use (always a mistake), it's helpful to have precise
names for individual components when this confusion comes up.

The fact that P-256-based primitives leak their parameterization is a flaw
in how we defined those primitives, not an analogy to apply to other
schemes. We should move away from that as much as possible. This is
analogous to how the X.509 work shifted from a heavily parameterized in
draft-ietf-curdle-pkix-00 to distinct top-level OIDs in RFC 8410..


> This separation between signature scheme and key type is mostly a
> historical quirk of older cryptographic algorithms being mis-specified. A
> key is a thing you get out of a signature scheme, not the other way around.
> Had we defined RSA and X9.62-style EC in a way that better matched formal
> expectations, there would have been no such thing as an "RSA" key. Rather,
> RSASSA-PKCS1-v1_5 would have been a family of signature schemes, and
> RSASSA-PKCS1-v1_5-SHA256 would have been a particular signature scheme.
> From there, you could have had a RSASSA-PKCS1-v1_5-SHA256 key, which would
> have been a distinct animal from a RSASSA-PKCS1-v1_5-SHA384 key, or an
> RSAES-OAEP-SHA256 key. Likewise, ECDSA-P256-SHA256 would have been a
> completely disjoint algorithm from ECDSA-P384-SHA256 or ECDSA-P256-SHA384
> or ECDH-P256. (And we probably wouldn't have wasted our time defining all
> hash/curve pairs.)
>
> However, RSA and X9.62-style EC weren't defined that way. Instead we have
> an "RSA" key and an "EC" key that can be used with all manner of
> algorithms, nevermind that not all pairs of algorithms have been analyzed
> to work well together. (Although, realistically, it is usually fine,
> sometimes it's not, and gaps between formal analysis and practice are one
> of the places we get security bugs.) And as a result of that, systems put
> too little effort into key management and misdirected that effort into
> picking different algorithms within a key, despite that being much less
> theoretically sound. For the RSA and EC world, we're kinda stuck with that.
>
> And so although TLS negotiates a SignatureScheme, the most specific thing,
> we handwaive a bit because sometimes one key may be used with multiple
> SignatureSchemes. However, we still do not have a "key type" enum, and it
> would be harmful to introduce one in TLS. It's important to collapse all
> the information needed for key selection into a single enum. In TLS 1.2,
> the information was scattered (see above).
>
> For anything defined after RSA and EC,like Ed25519, there is no reason to
> keep this handwaiving. If, say, it turns out we need to replace the hash
> function in Ed25519, or change EdDSA, we would not use the same keys. We
> would simply define a new signature scheme, with a different name, and say
> that this is a completely disjoint key type. So, to your original question,
> specifying EdDSA is incoherent because EdDSA is not a signature scheme, or
> a key type. It is a family of signature schemes, which may be instantiated
> by specifying a pile of parameters
> <https://datatracker.ietf.org/doc/html/rfc8032#section-3>. Once
> instantiated, it is given a name like "Ed25519", and that is the thing that
> systems like TLS or JOSE or COSE should work in. The fact that Ed25519 and
> Ed448 are both EdDSA instantiations, or that the X25519 algorithm and the
> Ed25519 algorithm have a similar structure are just useful properties when
> analyzing, specifying, or implementing a primitive. It is not relevant to
> protocols that *use* a primitive. As far as we're concerned, these are
> just names that conform to the signature scheme interface (KeyGen() -> (pk,
> sk), Sign(sk, msg) -> sig, and Verify(pk, msg, sig)).
>
> David
>
> On Sat, Jan 6, 2024 at 9:49 AM Orie Steele <orie@transmute.industries>
> wrote:
>
>> Hello,
>>
>> Apologies in advance for starting a thread about the proper way to name
>> things.
>>
>> We've been discussing the TLS naming conventions in relation to JOSE and
>> COSE naming conventions for suites.
>>
>> Here is the start of the full thread:
>> https://mailarchive.ietf.org/arch/msg/jose/66xvb1EgD-bf7V-XyAgDgRuUTJk/
>>
>> We've been comparing "trends in suite names", between TLS, JOSE and COSE.
>>
>> For example, we see the following:
>>
>>           /* ECDSA algorithms */
>>           ecdsa_secp256r1_sha256(0x0403),
>>           ecdsa_secp384r1_sha384(0x0503),
>>           ecdsa_secp521r1_sha512(0x0603),
>>
>>          /* EdDSA algorithms */
>>           ed25519(0x0807),
>>           ed448(0x0808),
>>
>>
>> In JOSE, ES256 means ~ " ecdsa_secp256r1_sha256(0x0403),"
>> In COSE, ES256 means ~ "ecdsa with some curve + sha256"
>>
>> In JOSE, EdDSA means ~ "EdDSA with some curve"
>> in COSE, EdDSA means ~ "EdDSA with some curve"
>>
>> This draft is in call for adoption, and argues for a convention:
>> https://datatracker.ietf.org/doc/draft-jones-jose-fully-specified-algorithms/
>>
>> The convention is essentially, when we "name a suite", it should fully
>> specify all the parameters.
>>
>> "ecdsa_secp256r1_sha256" is fully specified... "eddsa" or "ecdsa with
>> sha256" is not (curve parameter is not specified).
>>
>> In the thread, Neil said that it is better to negotiate for
>> key (representations), instead of algorithms, and that TLS has been moving
>> away from fully specifying things.
>>
>> I see that "ed25519(0x0807)," could have been "eddsa_ed25519", and I
>> assume "0x0807" actually means "eddsa with ed25519", and "0x0808" actually
>> means "eddsa with ed448".
>>
>> I don't expect a hash function here, because I know SHA-512 is used
>> internally.
>>
>> Key representations in JOSE and COSE have parameters, and one
>> parameter is the "alg" field, which restricts the use of the key.
>>
>> In the case of a fully specified algorithm, this "alg" parameter contains
>> redundant information to the other key parameters.
>> In the case of a partially specified algorithm, this "alg" parameter
>> contains non redundant information (such as dsa and hash, there are curves
>> that support multiple dsas, and of course everyone has a favorite hash
>> function).
>>
>> Neil also made several compelling arguments not to adopt the draft
>> because fully specified identifiers for partially specified things are
>> already partially understood.
>>
>> Assuming we dropped new registrations, and just made recommendations for
>> how to specify algorithms, how might JOSE and COSE align our registry
>> guidance with the current thinking in TLS?
>>
>> Should we recommend against fully specifying things, and argue that
>> negotiation should be for keys, not algorithms, and keys can choose to
>> restrict to achieve full specification?
>>
>> Should we recommend fully specifying things, and then decide if redundant
>> code points should also be assigned, or if the guidance should just be
>> forward facing?
>>
>> Regards,
>>
>> OS
>>
>> --
>>
>>
>> ORIE STEELE
>> Chief Technology Officer
>> www.transmute.industries
>>
>> <https://transmute.industries>
>> _______________________________________________
>> TLS mailing list
>> TLS@ietf.org
>> https://www.ietf.org/mailman/listinfo/tls
>>
>