Re: [COSE] Draft IETF 117 COSE agenda

Michael Jones <michael_b_jones@hotmail.com> Thu, 20 July 2023 00:55 UTC

Return-Path: <michael_b_jones@hotmail.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 8D5A0C15155F for <cose@ietfa.amsl.com>; Wed, 19 Jul 2023 17:55:04 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.723
X-Spam-Level:
X-Spam-Status: No, score=-0.723 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FORGED_HOTMAIL_RCVD2=0.874, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLACK=0.5, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=hotmail.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 xNy0XUtGTx83 for <cose@ietfa.amsl.com>; Wed, 19 Jul 2023 17:55:00 -0700 (PDT)
Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11olkn2101.outbound.protection.outlook.com [40.92.18.101]) (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 AF55EC14CE3F for <cose@ietf.org>; Wed, 19 Jul 2023 17:55:00 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jfRu377m+Im3eLyvrltiOR6o2Z/mZZopoHowAVSoz7U5eD6a3dI1QpaPL2+RdT7Fa731zVFStsF4E213PslTpeHxlKGcRRjwElcpbuHx72xMVnPI/tBQyvK5Wm78dKz08FZgezigmfTGImn81cWvRblpHPyqOGn2z9KoBP7WPcFG86LRgaprrOvyVzt5lnRlna+ctd5Z7+3PP+abD7HxUPxBiJpbesqJH98nU6TVdqMLozECHM4GU1opAFq78QODCFF0Mpla5AGmLV992BOjWFOKivgngwbPuVm0+Ib1pBedZTlviLkDQ+erSV0Bjj9IjK9CJdqtd7i5iYaMvj9FRA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=yrEvbzQE6cmzZs2uDfguxlS5iNP0l8MfWzPshqEyJkU=; b=JIqzhQycwCdHW1yN5Wf5Y0aipHhFLUPJewkuve3jTdCNL5sFH6V3bN/W1kklocp4nbFsT16yXaJM4GwgMw7aY6ChNrXrxm9/n/24bf7M6cfCflJMSJWoUsiSRS3yGl17cl56EZRTuXlNRak4vp9lbEpRL/Cn3RMGtDTsiuItIqpCzTpBfrvr/YX74PA9aomhnGlLWpitDgAmdbV5MkwFXwL6lOw72rdilytapd/VIYRcUWgDny/dBQYLUnoKro0AbtsC3NQKxsoarBmPj8J+tU7e1TUk4FJ2/j2yFFh7v9khh9pYy6Vjce/aoz/w/x7I4wq/qHjD4TfD1qjoeIb1kg==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yrEvbzQE6cmzZs2uDfguxlS5iNP0l8MfWzPshqEyJkU=; b=r/iF9OW6cV2+00Ih3ODz24UuoY7N7Skf+VAW9frAste1o6TcvLzLWPwapZU+ohd0akoq31OApJt31wZiLZCYUz5MfWcSTH+gUbKy3jpQ9N4KkKJkbauj3xjncuHSdFx7l3ap05o7SOK6xju5iWIA139ArtRx1Fn6/McwX69dhpRtSSHWiyYW2Hn/421mfhLLP7jEqtn9zo/Ktk4sWok7XJZJryP83/GNSgp0XIWdvl+EqoJ408wQ4rx/ZDbO3llljZIFw4ftGFgaRt8UxV+zcRp9SSxGsI20XnwyxTOvtjYK9juadzVscbF/CxGKcgefoDqLbRAvjBAB5+5Am8hjrA==
Received: from MW4PR02MB7428.namprd02.prod.outlook.com (2603:10b6:303:71::5) by IA0PR02MB9171.namprd02.prod.outlook.com (2603:10b6:208:43b::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6609.23; Thu, 20 Jul 2023 00:54:58 +0000
Received: from MW4PR02MB7428.namprd02.prod.outlook.com ([fe80::e345:fe8d:8cee:41aa]) by MW4PR02MB7428.namprd02.prod.outlook.com ([fe80::e345:fe8d:8cee:41aa%4]) with mapi id 15.20.6609.022; Thu, 20 Jul 2023 00:54:58 +0000
From: Michael Jones <michael_b_jones@hotmail.com>
To: AJITOMI Daisuke <ajitomi@gmail.com>, Ilari Liusvaara <ilariliusvaara@welho.com>
CC: cose <cose@ietf.org>
Thread-Topic: [COSE] Draft IETF 117 COSE agenda
Thread-Index: Adm5nPWN7H2vcrPeSseRlHnamti7dAAZhSIgABd9EgAAAa7GAAAKvbaAAAOHJlA=
Date: Thu, 20 Jul 2023 00:54:58 +0000
Message-ID: <MW4PR02MB742891C6F229AE71BF1ECC02B73EA@MW4PR02MB7428.namprd02.prod.outlook.com>
References: <SJ0PR02MB74394E66F880D4948217ED57B738A@SJ0PR02MB7439.namprd02.prod.outlook.com> <AS8PR10MB7427A0FF328462A6212E2590EE39A@AS8PR10MB7427.EURPRD10.PROD.OUTLOOK.COM> <MW4PR02MB74281BC30C2B395F77E3F1FCB739A@MW4PR02MB7428.namprd02.prod.outlook.com> <798F3FD9-115B-40C6-8F20-CB1DB1FB3648@island-resort.com> <CAFWvErU3mSR5PRk6FaW11-5r6tC1Kx9sMMBtVAqEhhjT5p1P4g@mail.gmail.com>
In-Reply-To: <CAFWvErU3mSR5PRk6FaW11-5r6tC1Kx9sMMBtVAqEhhjT5p1P4g@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-tmn: [Rgw00RfmkDzCKM5t95UV0RNNWdEPf7Yjp6ITDpJJVxq2pq8+z2p0bBWKBCFcFqvm]
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: MW4PR02MB7428:EE_|IA0PR02MB9171:EE_
x-ms-office365-filtering-correlation-id: a996d6bb-5fec-4fb9-fc32-08db88bbf106
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: CFvRs+qEUnxNPd32IMcXIbWfucOB/83vL/c1U4wxr8bqK2EbAqoNsaahrBh9M+dQYWD7TdgxI2V9m9978eVR6b4ei+vhZYjgISpsYmcYE9adoTKPdqWKv1u+5qEdXiXgQsoxbQTGHNtLzLQYpbjSByeQMFQm1vc9fzrikH+NwPykdmtMuA8cJE57P4XFCIQxP3n0SSuQDmslM+HqazYtY5E/U91NVEcpRdWxX3SMuFKRdoIO1TCd0ukB2XsvTSRjQuGSHGNc9N2clbtM1L5SMen49MRp0s9rJdQJ7Ph6aao+vtAZt5qEloJz9s6NW20oN7DypFmPCNQFXxpq9y+I47SH5djUF8cB1fKyftmR7QJ5BS2iQvOLRwln2AOCPiZaZOe3KSiGoH5yNFT7EfghXYs+HvCMXX0ISO54ye7PQULEAxB5sjpZ+6bThSHB0BIkVi5294SA3rc4RZ5wbnrgkjlET9ZeSFdG5ueGDzfSmVBEPA43xKGrfalJWvgTQ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Qsoudd+5K5ezP84VKz/bwtecwovC4V3Pm222Y7aO4Fd2VXiL1uX4AwSLlXTsiJs9auQwn46QQOCdYSLw5t/0OmgLrhqrI8z/O6ueC0Z28mF6QCVnV4ExeVXl1IkXWgOXXcBNyOvOOt0mv/8Obk44T7TiGoS1+WtlEQOhPSFB9SvTIFctdeCZa9W99F8YVVuxEfJ/tiGAAqFaZjLH+ZWVpdDMJEkY2TeuCejhkvFbIeW+onskTx0bij3EJMm6wt+RcfhWfLpuuYypRvW9oepvec/4kEG7vYaft8wJwtr8vQO4Cx1yRTl4pr5tWsNVCIRfNLyuEa/II6kjhTBlElNZCi1eJm2Nn2RBiJcx1bNyK/w2GONPIemRGdGE0Fa7YQ3aWAt/KHZhpz2tLF+5mPKyKZWWCLt2qtjKlTBlfqApnqSgV/cMw8T8tjcpU=
Content-Type: multipart/alternative; boundary="_000_MW4PR02MB742891C6F229AE71BF1ECC02B73EAMW4PR02MB7428namp_"
MIME-Version: 1.0
X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-99c3d.templateTenant
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: MW4PR02MB7428.namprd02.prod.outlook.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-CrossTenant-Network-Message-Id: a996d6bb-5fec-4fb9-fc32-08db88bbf106
X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jul 2023 00:54:58.6525 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000
X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA0PR02MB9171
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/4dme0QdpXv5GDFWNzfI0qTDdF0s>
Subject: Re: [COSE] Draft IETF 117 COSE agenda
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 20 Jul 2023 00:55:04 -0000

[chair hat off]

The interoperability problem caused by polymorphic algorithm identifiers is that the “alg” and “enc” values are no longer useful for algorithm negotiation.


In protocols such as OpenID Connect, OAuth 2.0, and WebAuthn/FIDO2, lists of supported “alg” and “enc” values are published in metadata.  For instance, here’s an example from RFC 8414:

    "token_endpoint_auth_signing_alg_values_supported":
        ["RS256", "ES256"],

The problem with polymorphic algorithm identifiers such as “EdDSA” is that they don’t actually specify which algorithm is used.  It could mean either “Ed25519” or “Ed448”.  You can’t advertise which you support and/or which you want.

This is a problem in practice for WebAuthn, since some COSE alg identifiers are polymorphic and WebAuthn and FIDO2 use COSE algorithm identifiers for negotiation.  See that WebAuthn specified that EdDSA always uses Ed25519 - making it non-polymorphic but precluding its use with Ed448.  Here’s the line doing so at https://www.w3.org/TR/webauthn-2/#sctn-public-key-easy:

  *   -8 (EdDSA), where crv<https://tools.ietf.org/html/rfc8152#section-13.1.1> is 6 (Ed25519).

Daisuke asserts “On the other hand, there are no examples like the proposal from Hannes/Laurence, where the "alg" value includes information about "crv" values and unrelated key operation information (e.g., KDF, AEAD)”.  There are actually many such examples.

All the registered JOSE algorithms (for example “ES256”) fully specified all parameters until “EdDSA”  was registered.  The COSE algorithms from RFC 8812 fully specify all parameters, such as when secp256k1 is used and when RSASSA is used.

Likewise, if we had a single HPKE algorithm identifier, it couldn’t be used to distinguish which HPKE algorithms are supported (and not all will be by all implementations).  This would cause the same problem for future systems that, for instance, WebAuthn/FIDO2, OAuth 2.0, and OpenID Connect already encounter when polymorphic algorithm identifiers are used.

                                                       -- Mike

From: AJITOMI Daisuke <ajitomi@gmail.com>
Sent: Wednesday, July 19, 2023 3:45 PM
To: Michael Jones <michael_b_jones@hotmail.com>; Ilari Liusvaara <ilariliusvaara@welho.com>
Cc: cose <cose@ietf.org>
Subject: Re: [COSE] Draft IETF 117 COSE agenda

> Speaking as an individual contributor, I fully support the first
> (fully specified) choice.  Whereas the second possibility will cause
> endless interoperability problems.

I disagree.

+1

(Below, I comment from the standpoint that the design of alg values should be consistent with COSE and JOSE.)
I am convinced that the "fully specified" design, on the contrary, includes more interoperability issues.

Originally, in JOSE and COSE, the identification of the specific cryptographic algorithm was done by combining the "alg" value ("ECDH-ES," "EdDSA," etc.) with the information held by the key itself ({"kty": "EC", "crv": "P-256", ...}, {"kty": "OKP", "crv": "Ed25519", ...}, etc.). The current draft follows this approach. On the other hand, there are no examples like the proposal from Hannes/Laurence, where the "alg" value includes information about "crv" values and unrelated key operation information (e.g., KDF, AEAD) to the original key's purpose. In JWK, the "alg" value is merely an optional parameter, so packing excessive information into the "alg" value will, in fact, lead to interoperability issues.

I have repeatedly written about the reasons why the current specification is better than the "fully specified" design (*1, *2). However, I would like to add one more point from a new perspective.

I am very concerned that JWK, which is a "JSON representation of keys" that could be used for a wide range of applications not limited to JOSE and COSE, will no longer be available as a means of transmission and negotiation of HPKE parameters. I think this is a very big loss.
The following works with no problem with existing JWK implementations, and it is also guaranteed to work in the JWK RFC:

  {
        kty: "EC",
        crv: "P-256",
        // alg: "HPKE-v1-Base(-KEM)",   // alg can be omitted as many JWKs do
        hkc: { kem: 0x0010, kdfs: [0x0001], aeads: [0x0001]}, // Unknown parameters for the JWK implementation MUST be ignored on the JWK layer.
        x: "-eZXC6nV-xgthy8zZMCN8pcYSeE2XfWWqckA2fsxHPc",
        y: "BGU5soLgsu_y7GN2I3EPUXS9EZ7Sw0qif-V70JtInFI",
  }

On the other hand, the following does not work with many existing JWK implementations. This is because existing JWK implementations often throw errors for "alg" values not supported by the bundled JWS/JWE:

  {
        kty: "EC",
        crv: "P-256",
        alg: " HPKEv1-Base-DHKEM(P256,HKDFSHA256)-HKDFSHA256-AES128GCM",   // Must be specified to specify HPKE parameters if not assuming an offline(implicit) agreement.
        x: "-eZXC6nV-xgthy8zZMCN8pcYSeE2XfWWqckA2fsxHPc",
        y: "BGU5soLgsu_y7GN2I3EPUXS9EZ7Sw0qif-V70JtInFI",
  }

I think this example clearly illustrates the harm of putting subsequent algorithm information (KDF&AEAD), which is not originally relevant to the key itsef, into a key that is originally only used in the KEM step.

In any case, I am tired of the situation where even after all these repeated discussions, even the obvious design point, which is obvious if you read the HPKE standard, that "encapsulated_key should be expressed as a sequence of bytes," is being rehashed...

I hope the chairs will make a wise decision.

Best regards,
Daisuke

P.S.
... the design of COSE-HPKE was more difficult than I had thought, as it required not only knowledge of both COSE and HPKE, but also knowledge of JOSE (primarily JWK) in terms of alg value design, and related considerations of consistency with the W3C Web Cryptography API and existing implementations. So I do not intend to ask you (the mailing list participants) to agree with my suggestion easily, but I'm very glad if you could read (*1)(*2) without bias.

(*1) https://mailarchive.ietf.org/arch/msg/cose/KTpXbZ3UxUH8BuLT4OmhfaToYTk/
(*2) https://mailarchive.ietf.org/arch/msg/cose/cPqYqCagPbWPKwvQODjqn98U3F4/

2023年7月20日(木) 2:37 lgl island-resort.com<http://island-resort.com/> <lgl@island-resort.com<mailto:lgl@island-resort.com>>:



On Jul 19, 2023, at 9:52 AM, Michael Jones <michael_b_jones@hotmail.com<mailto:michael_b_jones@hotmail.com>> wrote:

As a chair, I’d like clarity on what you mean by “the single algorithm design”.  Do you mean that each algorithm identifier fully specifies all the cryptographic parameters being used?  Or do you mean that a single algorithm identifier is used for all the HPKE possibilities?

The proposal that Hannes, Jeremy and a few others favor is roughly this. (I picked these three just as an example, the decision we want is not whether these three are the ones to register, it is that we will use one algorithm ID to indicate the HPKE KEM, KDF and AEAD.

Alg ID HPKE-P-256 (equivalent to COSE -29 with NIST key)
KEM: 0x0010 DHKEM(P-256, HKDF-SHA-256)
KDF: 0x0001 HKDF-SHA256
AEAD: 0x0001  AES-128-GCM

Alg ID HPKE-P-384 (equivalent to COSE -30 with NIST key)
KEM: 0x0011 DHKEM(P-384, HKDF-SHA-384)
KDF: 0x0002 HKDF-SHA384
AEAD: 0x0002  AES-256-GCM

Alg ID HPKE-P-521 (equivalent to COSE -31 with NIST key)
KEM: 0x0012 DHKEM(P-521, HKDF-SHA-512)
KDF: 0x0003 HKDF-SHA512
AEAD: 0x0002  AES-256-GCM

The one that Ilari and Ajitomi-san favor is what we have now in COSE-HPKE:

   When the alg value is set to 'HPKE-v1-BASE', the HPKE_sender_info
   structure MUST be present in the unprotected header parameter.

   The CDDL grammar describing the HPKE_sender_info structure is:

      HPKE_sender_info = [
          kem_id : uint,         ; kem identifier
          kdf_id : uint,         ; kdf identifier
          aead_id : uint,        ; aead identifier
          enc : bstr,            ; encapsulated key
      ]




Speaking as an individual contributor, I fully support the first (fully specified) choice.  Whereas the second possibility will cause endless interoperability problems.

We need your efforts primarily has a chair at this point. I think we’ve had the discussion.

LL





_______________________________________________
COSE mailing list
COSE@ietf.org<mailto:COSE@ietf.org>
https://www.ietf.org/mailman/listinfo/cose