Re: [Anima] [COSE] [Rats] cose+cbor vs cwt in MIME types

Esko Dijk <esko.dijk@iotconsultancy.nl> Tue, 04 April 2023 07:55 UTC

Return-Path: <esko.dijk@iotconsultancy.nl>
X-Original-To: anima@ietfa.amsl.com
Delivered-To: anima@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CB8C1C14CE4B; Tue, 4 Apr 2023 00:55:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.094
X-Spam-Level:
X-Spam-Status: No, score=-2.094 tagged_above=-999 required=5 tests=[AC_DIV_BONANZA=0.001, BAYES_00=-1.9, 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_BLOCKED=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=iotconsultancy.nl
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 lLvCB1MF1nNU; Tue, 4 Apr 2023 00:55:05 -0700 (PDT)
Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2071d.outbound.protection.outlook.com [IPv6:2a01:111:f400:7d00::71d]) (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 790F7C15170B; Tue, 4 Apr 2023 00:55:03 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bk2j4KFi5OcmQALJ4suWq8E7pbCfDikVMXo+sc+wuuiBsxKdSK2Idvt01wEZUu+hn4ehjORuMWGRvKQXGVEVWgwhLXKAusg0f1y/3q6sbBXkmysraqo9ItvjG7fX8XvOgghnXwIboKe4lIE7EXi4AJcBk51k5wAIZ2rDiZjBtVNNXcbzKFBYECiADvDfibc4+s8yc5TdG7Evw/Nsu7W3GdyKI73XFI48VhFFpHS42KLnwtcakkxzB2K+oPzUIbXmkdB6+u4YFRsBQiccqrKjyZaT9u50SgGCEgF0yFB6HCUiclPJzAWT24bqIaiHYbTBN9fra4NfsRmK9MPEZ3CHZg==
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=dTkK5I0femLC4jhI6ZDZu9uqQpIFp7EJ8ZpYaqODVuc=; b=MVkWFleeWGCkRd7HMQDql/yoWnV6Bosmn9YaLXZEGS4GTw9HI5jcDJ61zCNJShh2c+B3/vWjHt6ES4fa+QeD+YAWPLXpYtVyMflTpVtL6Z7EgowGrfyNc1wZ1wwMnV0dPwe2ezDtMT9XDoa2UWJ06EFkWDaG8GzBxFQD8Ng7nFiOuh/Dp2vv+zpm6HufSSWZcfu9e/DTyHLqATidQAcIGI3uUufrKqTKTxQSjxqVmspteqJlG6uRv6425u392iNDysfrK/xzYpvHcGs/Y0xpBKcYKJvh4PiDjLzf2MnxIUSJdsAyvyWxacQkj4+3ymIaGOxwnP10hHZVbplTe86XAQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=iotconsultancy.nl; dmarc=pass action=none header.from=iotconsultancy.nl; dkim=pass header.d=iotconsultancy.nl; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iotconsultancy.nl; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dTkK5I0femLC4jhI6ZDZu9uqQpIFp7EJ8ZpYaqODVuc=; b=Hw3Kmmd4O3o5ChtWZ6k6uTp+I1+AkuFwPoP7KcmtlvO3HlgdNGg4hEpv89mJSAa96OCporwkQWh/6Gqy3TKTc2DFMMEgZd1faQtkdzk2uGZrKrdBdOB6zCXMuZ7LlaPQcRs1HqcET5gTb1Nae9d1lROlKix7wZldKV7mnMOpFyk=
Received: from DU0P190MB1978.EURP190.PROD.OUTLOOK.COM (2603:10a6:10:3b9::20) by AS8P190MB2008.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:52e::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6254.33; Tue, 4 Apr 2023 07:54:57 +0000
Received: from DU0P190MB1978.EURP190.PROD.OUTLOOK.COM ([fe80::fade:8297:345b:7083]) by DU0P190MB1978.EURP190.PROD.OUTLOOK.COM ([fe80::fade:8297:345b:7083%5]) with mapi id 15.20.6254.035; Tue, 4 Apr 2023 07:54:57 +0000
From: Esko Dijk <esko.dijk@iotconsultancy.nl>
To: Orie Steele <orie@transmute.industries>, "Smith, Ned" <ned.smith@intel.com>
CC: Laurence Lundblade <lgl@island-resort.com>, Michael Richardson <mcr@sandelman.ca>, Thomas Fossati <Thomas.Fossati@arm.com>, Thomas Fossati <tho.ietf@gmail.com>, cose <cose@ietf.org>, rats <rats@ietf.org>, "anima@ietf.org" <anima@ietf.org>
Thread-Topic: [COSE] [Rats] [Anima] cose+cbor vs cwt in MIME types
Thread-Index: AQHZZlReQ9Fwk+ziV0WJTmEcAjfNQq8Z4yQAgAAAhICAABjHAIAAB3qAgAAkugCAABT1gIAACRWAgAByzcA=
Date: Tue, 04 Apr 2023 07:54:57 +0000
Message-ID: <DU0P190MB19781199C1C9E18FA7DF16B5FD939@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
References: <167847004893.23876.9884501000866697896@ietfa.amsl.com> <DB9PR08MB6524E8F83E7149AD95B6CDB89CBA9@DB9PR08MB6524.eurprd08.prod.outlook.com> <2313611.1678640027@dyas> <DB9PR08MB6524D3E44EBF11BB83F8F9069CB99@DB9PR08MB6524.eurprd08.prod.outlook.com> <2380614.1678721850@dyas> <CAObGJnPjijJ61B_WvujcbunwW7aPA7c-CY4goPDX+yohR_kHOw@mail.gmail.com> <DB9PR08MB6524A6A7E5AABD96BBA34C8A9C879@DB9PR08MB6524.eurprd08.prod.outlook.com> <14833.1679597042@localhost> <8225.1679872718@localhost> <DU0P190MB19784AFEED440A3EBF922A87FD929@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM> <4BB67CAE-73E0-43B7-86C4-76DC06379CB1@intel.com> <CAN8C-_L0VnwZaOy8QxKiDBG1dXK+Ct9X-5jzeQGFSnZwLkRzaA@mail.gmail.com> <3EC8A813-C84E-4869-83D2-ECAC2487DE97@intel.com> <CAN8C-_+z0GoNCo_Jd77DWeKN3XE76hccr5gKd90q+rm1w6haAw@mail.gmail.com> <36C7760F-4180-422C-A35B-A626DDC2A6F2@island-resort.com> <EB82CDEC-44A0-42DA-BAF1-71791B28CFDD@intel.com> <CAN8C-_JsBMHGe_5jbShKTHuvT+sZXWFk+G-MOQ9zLVMr_GVxFw@mail.gmail.com> <1A299CE1-9572-48F2-84EA-2DEB21B216C1@intel.com> <CAN8C-_KEVXxS=0ca=n0b5bC=5bpV3xgwzFSE0PrUZYWUS5rHnw@mail.gmail.com>
In-Reply-To: <CAN8C-_KEVXxS=0ca=n0b5bC=5bpV3xgwzFSE0PrUZYWUS5rHnw@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=iotconsultancy.nl;
x-ms-publictraffictype: Email
x-ms-traffictypediagnostic: DU0P190MB1978:EE_|AS8P190MB2008:EE_
x-ms-office365-filtering-correlation-id: 03c11aa4-cb75-4c97-eb31-08db34e1e2af
x-ms-exchange-senderadcheck: 1
x-ms-exchange-antispam-relay: 0
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: Z8WzG2rBgm6KnF+jpytL0i8fIavfDkCVcWqGP/aJ7m49PtmjDdPSEx/+4q83wPiOMmGGV/2ZCjipSzAIUB/RN4WZ6hGOdG364rjtEZ782PgiDl44zkcHvqUHh2ZoD/8qJjIhiO76l6fK1TFC+V417xRe95HoIlPgmHiVXwf566yOLpt0AdJHHFJVWnBIKlM1nX5YusuOvAtGn/fy+bSBZfNscRvGWSSt1Uc9QNyDNQRGas7pvSZMZ/LdNSePFZ1ZOx++LUSRiwoneeoVZCnDhQMnNgkWuFO6Vb8o6xLFgvaSWem0mNEXSK5YLH2Rd5YAndwHfM8OTvloz2Q8jHaBAXWf2iQuYDdJ2Ah8VeGrxt3Q955R5RbFls4W0flma2LBRVh5yVgfivN9uOZmncfQX1zxy/IXXrtzb8lH102mDYBt0trs/nX+4B0qUsAlKOgyjbfULS1yOMQnJ6ojC+muNvmdtKprOt4JcCX9GlKCqNCLQKgOtvLK7lurRbsZrMKb4Xzbdmqx8YqaFgO4Vt+8FAMTymqWTJu/ydbKi2JCvkkiAEivEixNlkjWlfl+3Ku6KG7E1icI8KCZ5FeoA5o6wVyUDY47fWi3E5BYrjhiLMo=
x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DU0P190MB1978.EURP190.PROD.OUTLOOK.COM; PTR:; CAT:NONE; SFS:(13230028)(396003)(376002)(39830400003)(136003)(346002)(366004)(451199021)(166002)(2906002)(44832011)(21615005)(122000001)(38100700002)(30864003)(5660300002)(38070700005)(8936002)(66476007)(66556008)(66946007)(52536014)(66446008)(76116006)(64756008)(41300700001)(8676002)(4326008)(54906003)(83380400001)(316002)(26005)(66574015)(110136005)(86362001)(33656002)(53546011)(186003)(478600001)(9686003)(6506007)(966005)(71200400001)(7696005)(55016003)(559001)(579004); DIR:OUT; SFP:1102;
x-ms-exchange-antispam-messagedata-chunkcount: 1
x-ms-exchange-antispam-messagedata-0: gXL3V4Y4paaFWxVt6CoBJplNbbxDBxopN+8LJ9MKe9D34nCv+NQnxDKkZM67KTyOMWXIwD7OXVXsM5IQIVhIBaCo3QTRsV/AFCRTZeIslGpxHyFN0HfUZC8W+tTVkYVobaXnIgtifh96udLm7vUjcHZwbkdIOgOtXkzrLER2tUoXY3gQk35pz0rE2CFb9CWSPLpChEZ4HX6QuLaDCLoNwpHrVmENHP7zsD1gZlanwpYW6CebR2XPIDpnUnZ4gNVBcFr9HWUOka8DRpHZcRbMksuwKd+ujo3uea/mjIfWaKW4PFK5FzYJmgv+mXsUT1ra11yvMWNuG06lFVLxbqR9NxjWdPQ/n524PuqMMX/+aCdql3Y/cb4EXNtLwSBlF7NeJumI0eeaRpo2hThLlKwJ6i5Z4vdVKedJLh3v5byYEFmraHYHxLN5n93T6nWFx/HTrNOEyuish2HW2ppC6S4fD47pFJSGaYEYikezbS5IvoeJg/clnzL2/0+eyHuxPixQDFOxyNIupLZdpXvGoVHTSBX3ViOUT5tOIn6+tSFJFo96/CfL47dAx8rmi5Qhs/47tNlwad4XMzXs/qhe4DAftyvSFoLqeqjYkLCQgJFPw8pxJ3nwoY9N3dRwTavzClgROGoXbrX7rMvMeyoaWpRSsG38ay3Mw97WtfZNyrkhYnohdL2regDbuPuSRxaHw8GLzAbwxm4X/RycK9euS2KGpDxq5WCc5OGvKD3DSlnYM5fCAGvCoQ/XaLkZrsFDW+NZmFKnw+nCBiyTy9qI5nGMfTbD0ACU0CTjxu2H+aF0fZCekdor/4DiJ/MocsCXYk2AIs59N/zk+BJ0IxybBhXwRNLj7q9pfUjY5Dz+XURmR0w1ypVkcgGidoomF0TxdlduCRLoubPxoQOVpvTozaB41yXa7Sg9nL4BGK1S0zScO8eEIskn/mYIzZRZo02iD/XZpbrz27ZlUPBgK+ly93MXqkQDQZS36I3kdJbYm1uwKereAtJwVMVIWT1Ma/bbdIzKgF+eh91N0G96xTbG0WzZd4h9NHyxGeQLvlJcjV4Ws6hVEwZ1gBhfqjX4xr/LRTBCH1IQwtbQe94eJ4n3ZGNDmXwf6qyaGwVWe81ZokpkGrs+2ybuMSADXzVcZgfck/hP0QZOkQ8Pj5NSum9XmfPbLGLvQhmsmowLPfRn1Ywm2+u+kEr4zK36H5n83qdg6gxwgDEzrwCwIRPuFrOGBv/DdaTxUGZNt/6/46Nm4j0Qp9pxMpyPjuPpLB0NnMIAYYy8Kul7B1Q3m1n08Du5QaGqzrzaProPPcsSP/HY6guW10j6tmevq5/E9jFG7lMuOyguYkMT8qNU4wEDkOsTyxvyQPTiHOPPtWAukzdqc+bzFE1J7Z7CYVRcGXmI4efBRgIMJcyIQWOJdypvykJqaeKrAul0WMhPQ5dCL2UVzFFF5B+kqMzjEj44k9d1GN3CAb21lGcKhJEbobg1ak1irRwm3e/T9f2FTcLkECjhaPR//xz/AXBlcQG84rfhXoF8mWk/BMm+KLlFPNIlXrgzXir1X/VGWaxCjskjVeRDOSkHgiYu6Ip7OkWS11M8eBs/V879l0iNXhyn1i16EY6KmGYBeA==
Content-Type: multipart/alternative; boundary="_000_DU0P190MB19781199C1C9E18FA7DF16B5FD939DU0P190MB1978EURP_"
MIME-Version: 1.0
X-OriginatorOrg: iotconsultancy.nl
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-AuthSource: DU0P190MB1978.EURP190.PROD.OUTLOOK.COM
X-MS-Exchange-CrossTenant-Network-Message-Id: 03c11aa4-cb75-4c97-eb31-08db34e1e2af
X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2023 07:54:57.8107 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 58bbf628-15d2-46bc-820b-863b6774d44b
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: MG1erAp3c9nqaLRTydUcAShlPwbdPT2OBlnOHV+lPpizELCerZwik7LjXwIhpzjTzZWQNnkZvmWUcEEhzt/cjwC/tAVdTqMUS7NQuVwg+WQ=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8P190MB2008
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/jpUKMWrrWJMxb4Tle8nxxbuDYLY>
Subject: Re: [Anima] [COSE] [Rats] cose+cbor vs cwt in MIME types
X-BeenThere: anima@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Autonomic Networking Integrated Model and Approach <anima.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/anima>, <mailto:anima-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/anima/>
List-Post: <mailto:anima@ietf.org>
List-Help: <mailto:anima-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/anima>, <mailto:anima-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 04 Apr 2023 07:55:10 -0000

> So you can read the subtype "eat" and then consider it as +cwt, +cose, +cbor, for an example media type of "application/eat+cbor+cose+cwt"

It looks like in your example the order is reversed; given the existing examples defined in draft-ietf-mediaman-suffixes-03 Section 2.1?

Let’s assume it is the reverse, namely “application/eat+cwt+cose+cbor”. Then following the Section 2.1 examples a parser would go through these steps for example:


  *   Do I know “application/eat+cwt+cose+cbor” ? No.
  *   Do I know “+cbor” ? Yes, decode it as CBOR – ok it’s valid, proceed to next stage of the processing pipeline.
  *   Do I know “+cose” ? No. Processing stops here.
  *   End result: I’ll render it in CBOR diagnostic notation.

Another parser might do these steps:


  *   Do I know “application/eat+cwt+cose+cbor” ? No.
  *   Do I know “+cbor” ? Yes, decode it as CBOR – it’s valid, proceed to next stage of the processing pipeline.
  *   Do I know “+cose” ? Yes, that’s COSE semantics – decode it – it’s valid, and although I can’t verify the signature, go to next stage of the processing pipeline.
  *   Do I know “+cwt” ? No, stop here.
  *   End result: display it as a COSE object. Do not trust it as I can’t verify the signature.

Yet another parser:


  *   Do I know “application/eat+cwt+cose+cbor” ? No.
  *   Do I know “+cbor” ? Yes, decode it as CBOR – it’s valid, proceed to next stage of the processing pipeline.
  *   Do I know “+cose” ? Yes, that’s COSE – decode it – it’s valid, go to next stage of the processing pipeline.
  *   Do I know “+cwt” ? Yes, that’s a CWT – now checking that the COSE payload is correct CBOR with CWT structure inside – okay.
  *   End result: display it as a CWT.


Using the reverse way "application/eat+cbor+cose+cwt" seems not compatible with what’s currently written in draft-ietf-mediaman-suffixes-03 about “pipelines”.
For example, suppose a “CWT decoder” gets this media type first, and it then sends “eat+cbor+cose” to the next pipeline stage, that wouldn’t make sense since the ‘+cbor’ and ‘+cose’ parts were already decoded as part of ‘+cwt’.

For completeness here the example from the draft "image/svg+xml+gzip":

  *   Do I know "image/svg+xml+gzip" ? No.
  *   Do I know “+gzip” ? Yes, I can unzip the data – that works. Send the data to the next pipeline stage.
  *   Do I know “+xml” ? Yes, that’s just XML – can display it.
  *   Do I know “svg” ? No.
  *   End result: display the object in my XML viewer.

(Using here "image/svg+gzip+xml" would lead to incorrect results clearly.)

Esko

From: Orie Steele <orie@transmute.industries>
Sent: Tuesday, April 4, 2023 02:09
To: Smith, Ned <ned.smith@intel.com>
Cc: Laurence Lundblade <lgl@island-resort.com>; Esko Dijk <esko.dijk@iotconsultancy.nl>; Michael Richardson <mcr@sandelman.ca>; Thomas Fossati <Thomas.Fossati@arm.com>; Thomas Fossati <tho.ietf@gmail.com>; cose <cose@ietf.org>; rats <rats@ietf.org>; anima@ietf.org
Subject: Re: [COSE] [Rats] [Anima] cose+cbor vs cwt in MIME types

Per the JWT BCP, regarding typ.

https://datatracker.ietf.org/doc/html/rfc8725#name-use-explicit-typing

The +jwt suffix goes on the end.

You would need to register +eat as a structured suffix otherwise.

My understanding is that you currently intend to register application/eat as a subtype, not a structured suffix (you can do both, see json).

The 116 meeting mentions that while it is the case today that most structured suffix are also registered subtypes, this might not be a reliable assumption in the future.

The current multiple suffixes draft makes it clear that processing of suffixes is right to left (confusing / surprising perhaps).

So you can read the subtype "eat" and then consider it as +cwt, +cose, +cbor, for an example media type of "application/eat+cbor+cose+cwt"

As I mentioned before, the multiple suffixes draft might not land... So it would be better to avoid multiple plus and follow the conventions from the JWT BCP, and avoid registering new or interesting suffixes, given the current confusion regarding them.

I'm not saying any of this is correct, just noting what the suffixes draft says today, and how it is related to the several +jwt media types that have already been registered.

Another interesting case to consider... Data URI of type "eat+jwt+gzip"... Since base64 URL encoding can quickly max out QR Codes / NFC or URL limits.

Decompress, verify, parse / validate.

OS


On Mon, Apr 3, 2023, 6:36 PM Smith, Ned <ned.smith@intel.com<mailto:ned.smith@intel.com>> wrote:
> application/eat+cbor+cose+cwt

EAT is a specialization of a CWT or a JWT. What in eat is encoded before the cbor (which encodes the token)?

If the conceptual message is identified by a message wrapper draft-ftbs-rats-msg-wrap-02 - RATS Conceptual Messages Wrapper (ietf.org)<https://datatracker.ietf.org/doc/draft-ftbs-rats-msg-wrap/>, then the cbor bytes could be encoded in an cmw array. As in:
`[ “application/cbor+cose+cwt+eat”, bstr ]`

The discussion around cmw hasn’t concluded, but in theory, the array structure could be embedded in a conveyance protocol or message that would have some way to identify it as a cmw. The cmw I-D doesn’t try to define a media type name for `cmw-array`. Hopefully, that isn’t needed. But it is the outer most onion skin before talking about conveyance protocol / message framing.

-Ned

From: Orie Steele <orie@transmute.industries<mailto:orie@transmute.industries>>
Date: Monday, April 3, 2023 at 3:21 PM
To: "Smith, Ned" <ned.smith@intel.com<mailto:ned.smith@intel.com>>
Cc: Laurence Lundblade <lgl@island-resort.com<mailto:lgl@island-resort.com>>, Esko Dijk <esko.dijk@iotconsultancy.nl<mailto:esko.dijk@iotconsultancy.nl>>, Michael Richardson <mcr@sandelman.ca<mailto:mcr@sandelman.ca>>, Thomas Fossati <Thomas.Fossati@arm.com<mailto:Thomas.Fossati@arm.com>>, Thomas Fossati <tho.ietf@gmail.com<mailto:tho.ietf@gmail.com>>, "cose@ietf.org<mailto:cose@ietf.org>" <cose@ietf.org<mailto:cose@ietf.org>>, "rats@ietf.org<mailto:rats@ietf.org>" <rats@ietf.org<mailto:rats@ietf.org>>, "anima@ietf.org<mailto:anima@ietf.org>" <anima@ietf.org<mailto:anima@ietf.org>>
Subject: Re: [COSE] [Rats] [Anima] cose+cbor vs cwt in MIME types

Inline:

On Mon, Apr 3, 2023 at 3:10 PM Smith, Ned <ned.smith@intel.com<mailto:ned.smith@intel.com>> wrote:
> there’s no standard for the key material and key identification
The observation is that the COSE block contains a key-id that can be used to locate the key material (e.g., I assume key material refers to the public key needed to verify the COSE signature given asymmetric crypto). The COSE parser (layer) would normally be equipped to handle this sort of thing. If the media type was ‘cwt’ the parser would have to support everything in the COSE layer as well as what’s in the token part as well. EAT adds additional parsing requirements on top of CWT.  Hence, the expression “application/cbor+cose+cwt+eat” isn’t unreasonable.

I would expect something more like this (according the current suffixes draft):
application/eat+cbor+cose+cwt

or simply:

application/eat+cwt (since cwt implies cbor + cose)

Closest JWT analogy currently in the registry:

- https://www.iana.org/assignments/media-types/application/at+jwt
- https://www.rfc-editor.org/rfc/rfc9068.html

keep in mind the multiple suffixes is not yet an RFC... if you can avoid multiple suffixes, I think it is very wise to do so.

The reason to use multiple suffixes is to signal that there is meaningful processing that can be done... for token formats, I feel this is less true than json flavors, such as "application/vc+ld+json".

I had a discussion with friends at IETF 116 about "sd+jwt" vs "sd-jwt", related to https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-03.html#name-iana-considerations-24

For example, sd-jwt implies normal jwt processing is not meaningful, whereas sd+jwt implies jwt processing is meaningful... There were good arguments on both sides.
Given the current state of consensus on multiple suffixes, I would potentially avoid taking a dependency on it if possible, sticking to just 1 plus.

Someone could argue that “…+cose+cwt…” doesn’t add anything, as “+cwt” alone could infer both. The same is true for “…cbor+eat…”.
But I think there is value in being able to describe a fully qualified representation that is the primitive representation after the various inferred representations have been computed.

> but that’s about the library, not dispatching some content arriving to a particular application
I think the value is it doesn’t assume monolithic applications. A library or processor that is specific to the encoding between the pluses, e.g., “+cose+”, can be used in some sort of highly optimized pipeline, rather than presumed to be a monolith.

From: Laurence Lundblade <lgl@island-resort.com<mailto:lgl@island-resort.com>>
Date: Monday, April 3, 2023 at 12:44 PM
To: Orie Steele <orie@transmute.industries<mailto:orie@transmute.industries>>
Cc: "Smith, Ned" <ned.smith@intel.com<mailto:ned.smith@intel.com>>, Esko Dijk <esko.dijk@iotconsultancy.nl<mailto:esko.dijk@iotconsultancy.nl>>, Michael Richardson <mcr@sandelman.ca<mailto:mcr@sandelman.ca>>, Thomas Fossati <Thomas.Fossati@arm.com<mailto:Thomas.Fossati@arm.com>>, Thomas Fossati <tho.ietf@gmail.com<mailto:tho.ietf@gmail.com>>, "cose@ietf.org<mailto:cose@ietf.org>" <cose@ietf.org<mailto:cose@ietf.org>>, "rats@ietf.org<mailto:rats@ietf.org>" <rats@ietf.org<mailto:rats@ietf.org>>, "anima@ietf.org<mailto:anima@ietf.org>" <anima@ietf.org<mailto:anima@ietf.org>>
Subject: Re: [COSE] [Rats] [Anima] cose+cbor vs cwt in MIME types

I’m not sure identifying something as COSE, or even CWT is that useful because there’s no standard for the key material and key identification that cuts across all uses of COSE or CWT.

For example with EAT the receiver probably will need an endorsement (a very specific thing with very specific semantics) with a public key to be able to process the CWT/COSE. If COSE is used for encrypted email (a future S/MIME), the key material identification will probably be really different. It’s hard for me to see what a generic COSE/CWT handler is going to do here. It’s good and well if an EAT processor uses the same COSE library as an S/MIME processor, but that’s about the library, not dispatching some content arriving to a particular application.

No objection to the work here. Just some observations.

LL



On Apr 3, 2023, at 11:14 AM, Orie Steele <orie@transmute.industries<mailto:orie@transmute.industries>> wrote:

Yes! That seems to have been one proposal, related to cleaning up the registry and clarifying interpretation.

If you have strong opinions on this, please help contribute to the dialog on this media types list:

https://mailarchive.ietf.org/arch/msg/media-types/qO72m31whV5QZmV6kj55KDqS8n8/

Regards,

OS

On Mon, Apr 3, 2023 at 1:12 PM Smith, Ned <ned.smith@intel.com<mailto:ned.smith@intel.com>> wrote:
Interesting!
It would be nice if I-D.ietf-mediaman-suffixes could define a backward compatibility convention that shows how existing / registered media-type-names can co-exist with I-D.ietf-mediaman-suffixes.


From: Orie Steele <orie@transmute.industries<mailto:orie@transmute.industries>>
Date: Monday, April 3, 2023 at 10:47 AM
To: "Smith, Ned" <ned.smith@intel.com<mailto:ned.smith@intel.com>>
Cc: Esko Dijk <esko.dijk@iotconsultancy.nl<mailto:esko.dijk@iotconsultancy.nl>>, Michael Richardson <mcr@sandelman.ca<mailto:mcr@sandelman.ca>>, Thomas Fossati <Thomas.Fossati@arm.com<mailto:Thomas.Fossati@arm.com>>, Thomas Fossati <tho.ietf@gmail.com<mailto:tho.ietf@gmail.com>>, "cose@ietf.org<mailto:cose@ietf.org>" <cose@ietf.org<mailto:cose@ietf.org>>, "rats@ietf.org<mailto:rats@ietf.org>" <rats@ietf.org<mailto:rats@ietf.org>>, "anima@ietf.org<mailto:anima@ietf.org>" <anima@ietf.org<mailto:anima@ietf.org>>
Subject: Re: [COSE] [Rats] [Anima] cose+cbor vs cwt in MIME types

At IETF 116 this draft was discussed:

- https://datatracker.ietf.org/doc/draft-ietf-mediaman-suffixes<https://datatracker.ietf.org/doc/draft-ietf-mediaman-suffixes/>
- https://youtu.be/BrP1upACJ0c?t=1744

TLDR; there is work in progress to define multiple suffixes, and how they are interpreted.

This would be relevant to potential future +cwt media types, it is already causing us some concern with respect to special cases of +jwt.

Regards,

OS

On Mon, Apr 3, 2023 at 12:28 PM Smith, Ned <ned.smith@intel.com<mailto:ned.smith@intel.com>> wrote:
It seems the early registrations focused on encoding formats for content to the right of the "+" like '+xml', '+json', '+cbor', '+der', while later registrations seem to include schema formats like '+jwt', '+sqlite3', and '+tlv'.

It would have been nice if the registry defined the right side for encoding formats and let the left side contain content / schema formats IMHO. That way, the parsers could scan for the "+" to identify if it supports the encoding format as a first pass operation. If it can't decode the first byte, then there's no point in going further.

If it can decode, then the first byte/bytes may provide insight into what content is there. For example, a CBOR tagged structure. But additionally, the left hand side identifies schemas. Given many data structures can be integrity protected, signed, and encrypted. Supplying a value that describes a cryptographic enveloping schema / format seems like a reasonable requirement for the '-label' to the immediate left of the plus, e.g., "-cose+cbor".
The data within the cryptographic envelope may follow a well-defined schema such as the RATS ar4si. E.g., "ar4si-cose+cbor". I don't see a problem with omitting the cryptographic envelope label if no envelope is provided. E.g., "ar4si-+cbor".

JWT and CWT are both an envelope and a data model schema, so the cryptographic envelope could be inferred. But it wouldn't be incorrect to restate the obvious for the benefit of the parsers who only care about cryptographic wrapper processing. E.g., "jwt-jose+json" is still a reasonable way to encode 'jwt'.

If there are content schemas that are to the left of some other content schema, then that can be accommodate easily by prepending another 'label-'. E.g., "ar4si-jwt-jose+json".

This approach allows an initial parser / message router to get a view of all the parsers needed to fully inspect the message in advance of making an initial message routing decision which would enable efficient parser offload architectures. There could be different registries for the different types of structure "+label" for encoding formats only, "-label" to the immediate left of "+" for cryptographic enveloping, and application formats for the next left most content.

To make processing even more efficient, the content-type-name should reverse the order based on outer-most format. E.g., "json+jose-jwt-ar4si". This way buffer only needs to contain the first bytes up to the '+' and so forth.

I realize this goes beyond the initial focus of the discussion thread. But IETF is also concerned about the long-term future of the Internet and in optimizing wherever it makes sense. Content typing is just a form of deep packet inspection that goes beyond network framing.

Cheers,
Ned

On 4/3/23, 12:33 AM, "RATS on behalf of Esko Dijk" <rats-bounces@ietf.org<mailto:rats-bounces@ietf.org> <mailto:rats-bounces@ietf.org<mailto:rats-bounces@ietf.org>> on behalf ofesko.dijk@iotconsultancy.nl<mailto:esko.dijk@iotconsultancy.nl> <mailto:esko.dijk@iotconsultancy.nl<mailto:esko.dijk@iotconsultancy.nl>>> wrote:


Hi,


As for the questions mentioned on these slides:


1. "Is is '-cose+cbor' or '-cbor+cose'


The registry https://www.iana.org/assignments/media-type-structured-suffix/media-type-structured-suffix.xhtml<https://www.iana.org/assignments/media-type-structured-suffix/media-type-structured-suffix.xhtml> lists the subtypes that one have after the '+' sign.
'cbor' is there but 'cose' is not. 'cwt' is also not there.


So for the moment, registering a 'mytype+cose' or 'voucher+cose' or 'voucher-cbor+cose' is not possible now unless you would also register the '+cose' as a subtype. RFC 9052 did not choose to register the subtype '+cose', for whatever reason.


Luckily because COSE is just "plain CBOR" itself , we can use the subtype '+cbor'. So having "voucher-cose+cbor" would be fine. Also "voucher+cbor" would be equally ok albeit a little bit less informative that it contains COSE.




2. "are they sufficiently different" (this is about application/voucher-cose+cbor and application/eat+cwt formats)


The voucher is not a CWT format, e.g. it does not use the standardized CWT claims at all. It defines an own format within the constraints of YANG CBOR, while CWT does not use any YANG semantics.


(Now converting the constrained Voucher format into a CWT based format would certainly be possible; but that's probably not the discussion intended by these slides.)


Regards
Esko


PS more detailed info at
https://github.com/anima-wg/constrained-voucher/issues/264 <https://github.com/anima-wg/constrained-voucher/issues/264>
https://github.com/anima-wg/constrained-voucher/issues/263 <https://github.com/anima-wg/constrained-voucher/issues/263>


-----Original Message-----
From: Anima <anima-bounces@ietf.org<mailto:anima-bounces@ietf.org> <mailto:anima-bounces@ietf.org<mailto:anima-bounces@ietf.org>>> On Behalf Of Michael Richardson
Sent: Monday, March 27, 2023 01:19
To: Thomas Fossati <Thomas.Fossati@arm.com<mailto:Thomas.Fossati@arm.com> <mailto:Thomas.Fossati@arm.com<mailto:Thomas.Fossati@arm.com>>>; Thomas Fossati <tho.ietf@gmail.com<mailto:tho.ietf@gmail.com><mailto:tho.ietf@gmail.com<mailto:tho.ietf@gmail.com>>>; cose@ietf.org<mailto:cose@ietf.org> <mailto:cose@ietf.org<mailto:cose@ietf.org>>; rats@ietf.org<mailto:rats@ietf.org> <mailto:rats@ietf.org<mailto:rats@ietf.org>>; anima@ietf.org<mailto:anima@ietf.org><mailto:anima@ietf.org<mailto:anima@ietf.org>>
Subject: Re: [Anima] [Rats] cose+cbor vs cwt in MIME types


Michael Richardson <mcr+ietf@sandelman.ca<mailto:mcr%2Bietf@sandelman.ca> <mailto:mcr+ietf@sandelman.ca<mailto:mcr%2Bietf@sandelman.ca>>> wrote:
> COSE CHAIRS: can we have 5 minutes for this discussion?
> I guess I can make two slides tomorrow and get Thomas to co-author them.


I guess we didn't get any time at COSE.


https://github.com/anima-wg/voucher/blob/main/presentations/ietf116-cose-mime-cwt.pdf <https://github.com/anima-wg/voucher/blob/main/presentations/ietf116-cose-mime-cwt.pdf>


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


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



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


--
ORIE STEELE
Chief Technical Officer
www.transmute.industries<http://www.transmute.industries>

Error! Filename not specified.<https://www.transmute.industries/>


--
ORIE STEELE
Chief Technical Officer
www.transmute.industries<http://www.transmute.industries/>

Error! Filename not specified.<https://www.transmute.industries/>
_______________________________________________
COSE mailing list
COSE@ietf.org<mailto:COSE@ietf.org>
https://www.ietf.org/mailman/listinfo/cose



--
ORIE STEELE
Chief Technical Officer
www.transmute.industries<http://www.transmute.industries>

<https://www.transmute.industries/>