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

Orie Steele <orie@transmute.industries> Tue, 04 April 2023 15:27 UTC

Return-Path: <orie@transmute.industries>
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 CCC22C15C2A8 for <anima@ietfa.amsl.com>; Tue, 4 Apr 2023 08:27:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.095
X-Spam-Level:
X-Spam-Status: No, score=-2.095 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_NONE=-0.0001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 (2048-bit key) header.d=transmute.industries
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 Lsc13yanejH1 for <anima@ietfa.amsl.com>; Tue, 4 Apr 2023 08:27:21 -0700 (PDT)
Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) (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 2A808C1522DD for <anima@ietf.org>; Tue, 4 Apr 2023 08:27:20 -0700 (PDT)
Received: by mail-ed1-x532.google.com with SMTP id ew6so132107489edb.7 for <anima@ietf.org>; Tue, 04 Apr 2023 08:27:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=transmute.industries; s=google; t=1680622039; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=/N8kFkYKT+Can2eqAcj6YbkI1FhOmqx/yc6oL2I5c0k=; b=Woog35BVr2I8HEo2rczhOAOcALQYSZli4+Ey5yT306PaPB4sF+y/SwPccNXLocv95+ LGtoIi0TcS3a1/lHebyQQBzAeJ3yo2gjJfAvlVmZr6lz/gHr6KRj578VdJLz5i7614av /S8gBYR5KHBHeczI8mPCtfZyBjp/YlGrrtNU0gZh61/KO25aEygaIF2ONDo9g5w+jdXJ Ae76uxPX7DfHMPPUjPjOUY9Q7n50vj25LiQ2orf3sODRPLta4gZ+Tvrhay9SaiDFoFYD Y0kQ38r2K4yPzOt7/XFLp09M9cwIAxRD3ktnNf4tUxuroE5wvDmt/kO26Y8FRyUL32vZ xF5Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680622039; 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=/N8kFkYKT+Can2eqAcj6YbkI1FhOmqx/yc6oL2I5c0k=; b=0CEiT4ME1fTmRja3xMLtrD0/NMtUI8a62chg6lOCV4EiJRVxN5nnv3rJi5Pa/aG2sp ZYIZ5f8Zr37WtvfQfoYoh7aTsxY96QT2LcaJXFlUIoe2f5MHr4Isvv2t/koF569kCnWQ lbpEasFuZoJLIDquT021cZK2/t1a8G5+1yYA63ovG+T9x7q22GazyqreCA3GLaxgYr7B AJ5iwye4/TMBx1qzz/LSfUPQMjlqNggbNlU7HnA+CJqJVbaHedRo+NtB9feR+DVsgTz1 cD7IRXEJp2siObQerBAMEduHooz82wpSTK3UrWn5BbUnsQADlscXEntYlrwf+Ndwqf6B NcGA==
X-Gm-Message-State: AAQBX9ecLCFqU/i0xEcxZi324ckcPZ2hP+Fq8VxhTHhFXZj9w513Z/sY PyR++4su32i4cnNl2wDBqKghvawtGgaqy1cLNd4C3Q==
X-Google-Smtp-Source: AKy350ZKORZHUE3fPzEDUoz11+jiOKLRwQQeB8MJooXm7de9oMjfXPwQOFxTG4RhzpSFoRvo+UA2MA+v95bEegAD63c=
X-Received: by 2002:a17:906:c1d1:b0:931:ce20:db96 with SMTP id bw17-20020a170906c1d100b00931ce20db96mr1461885ejb.5.1680622039303; Tue, 04 Apr 2023 08:27:19 -0700 (PDT)
MIME-Version: 1.0
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> <DU0P190MB19781199C1C9E18FA7DF16B5FD939@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
In-Reply-To: <DU0P190MB19781199C1C9E18FA7DF16B5FD939@DU0P190MB1978.EURP190.PROD.OUTLOOK.COM>
From: Orie Steele <orie@transmute.industries>
Date: Tue, 04 Apr 2023 10:27:08 -0500
Message-ID: <CAN8C-_KZ5uUruf0tVfwniVWDUua9AVh7bvRAWtzZOtWzVYpEaA@mail.gmail.com>
To: Esko Dijk <esko.dijk@iotconsultancy.nl>
Cc: "Smith, Ned" <ned.smith@intel.com>, 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>
Content-Type: multipart/alternative; boundary="000000000000a797a505f8844f66"
Archived-At: <https://mailarchive.ietf.org/arch/msg/anima/bferah0nqKzbStIhnRR9x5YRGho>
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 15:27:25 -0000

Inline

On Tue, Apr 4, 2023 at 2:55 AM Esko Dijk <esko.dijk@iotconsultancy.nl>
wrote:

> > 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.
>
>
Is it safe to end here?


>
>    -
>    - End result: I’ll render it in CBOR diagnostic notation.
>
>
Is this safe for a token format?


>
>    -
>
>
>
> 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.
>
>
Again is this safe place to end?


>
>    -
>    - End result: display it as a COSE object. Do not trust it as I can’t
>    verify the signature.
>
>
Exactly... This could be desirable, but it makes me a bit nervous... see
"alg=none".


>
>    -
>
>
>
> 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.
>
>
>

For security oriented APIs this feels like where you want to end... Perhaps
what we are seeing here is an interaction between "safe api design" and
"trying to process stuff that might not be verified, or has been tampered
with"...


>
>
> 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’.
>
>
>

I agree, but the JWT BCP uses at+jwt... so you either handle JWT or you
fail... that seems desirable in most security cases.


> 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.
>
>
It is not "just XML".. it is "+xml" vs "application/xml"... this is
discussed in the IETF 116 meeting (and there is no consensus on how the
current draft should be interpreted).

- https://www.iana.org/assignments/media-types/application/xml

vs

-
https://www.iana.org/assignments/media-type-structured-suffix/media-type-structured-suffix.xhtml
- https://www.rfc-editor.org/rfc/rfc7303.html#page-12


>
>    -
>    - 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.)
>

Yes, this makes me wonder what happens to protected and unprotected
headers, when processing anything with +cwt or +cose in the middle of
multiple suffixes... to me this suggests that they cannot go "in the
middle', unless everything to the left expects them.

I suppose this concern also applies to +jwt, except in those cases the
intention is very clearly to produce a specific subtype that is also a JWT.

Arguing against myself:

“application/eat+cwt+cose+cbor”  seems ok if the goal is to end at COSE
without verifying (a tamper friendly media type).

“application/eat+cwt” seems ok if the goal is to end at an eat token or
fail (tamper unfriendly)

I am nervous about specifying "verifiable media types" that in practice
processing of verifying can be skipped, and it seems like multiple suffixes
is a gateway to seeing more of these in the future.

I think it would be nice if the suffixes draft commented on cases where
digital signatures might interact with suffixes, including commenting
on +jwt and +cose.


>
> 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> 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>
> *Date: *Monday, April 3, 2023 at 3:21 PM
> *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@ietf.org" <cose@ietf.org>, "rats@ietf.org" <
> rats@ietf.org>, "anima@ietf.org" <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> 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>
> *Date: *Monday, April 3, 2023 at 12:44 PM
> *To: *Orie Steele <orie@transmute.industries>
> *Cc: *"Smith, Ned" <ned.smith@intel.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@ietf.org" <cose@ietf.org>, "rats@ietf.org" <
> rats@ietf.org>, "anima@ietf.org" <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>
> 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> 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>
> *Date: *Monday, April 3, 2023 at 10:47 AM
> *To: *"Smith, Ned" <ned.smith@intel.com>
> *Cc: *Esko Dijk <esko.dijk@iotconsultancy.nl>, Michael Richardson <
> mcr@sandelman.ca>, Thomas Fossati <Thomas.Fossati@arm.com>, Thomas
> Fossati <tho.ietf@gmail.com>, "cose@ietf.org" <cose@ietf.org>, "
> rats@ietf.org" <rats@ietf.org>, "anima@ietf.org" <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://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> 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> on behalf ofesko.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>> On
> Behalf Of Michael Richardson
> Sent: Monday, March 27, 2023 01:19
> To: 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>; rats@ietf.org <mailto:rats@ietf.org
> >; 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+ietf@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>
> https://www.ietf.org/mailman/listinfo/anima <
> https://www.ietf.org/mailman/listinfo/anima>
>
>
> _______________________________________________
> RATS mailing list
> 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
> https://www.ietf.org/mailman/listinfo/cose
>
>
>
>
> --
>
> *ORIE STEELE*
>
> Chief Technical Officer
>
> www.transmute.industries
>
>
>
> *Error! Filename not specified.* <https://www.transmute.industries/>
>
>
>
>
> --
>
> *ORIE STEELE*
>
> Chief Technical Officer
>
> www.transmute.industries
>
>
>
> *Error! Filename not specified.* <https://www.transmute.industries/>
>
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose
>
>
>
>
>
>
> --
>
> *ORIE STEELE*
>
> Chief Technical Officer
>
> www.transmute.industries
>
>
>
> <https://www.transmute.industries/>
>
>

-- 
*ORIE STEELE*
Chief Technical Officer
www.transmute.industries

<https://www.transmute.industries>