Re: [jose] [COSE] [EXT] Re: Multiple Suffixes with JOSE and COSE media types

Brendan Moran <brendan.moran.ietf@gmail.com> Mon, 24 July 2023 21:53 UTC

Return-Path: <brendan.moran.ietf@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id CF354C14F747; Mon, 24 Jul 2023 14:53:01 -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=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=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 (2048-bit key) header.d=gmail.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 qeSSoxi09m2Y; Mon, 24 Jul 2023 14:52:58 -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 BC9F9C151070; Mon, 24 Jul 2023 14:52:54 -0700 (PDT)
Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-51e2a6a3768so7200713a12.0; Mon, 24 Jul 2023 14:52:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690235573; x=1690840373; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=7iLSCDG+OdzC6DQNg5TQxXmpUTLzvFLu4P2rVrln0+A=; b=PBJa1CP9TY0U1Vo/yTzHCKK7M+w+6vU2qWnl2TsWjAHt2MAr/oJ24Akj+HkzI8le9Z s18inZZEdYr8MKVCfRF8272Qi32rX4BRCCEt+4SOLpp+V9X2F6E+UmBYA21Vdzb7dDVk M4n78bCWQeJdmMEjTEFw0Yl6A3xaChb2mNlkgQ1SrerT5a0XELRN1QSCGsHD4smjoxa3 fXPJa3xsjXZqaS2qP2Am9zdRjuvBCqXnDdanKbnLPiN3KWrBmao10zRx/F9oS9h/Sbku +Aaj56HS5bbnbLH6XeBoxpQuiAGyfhVIc2dveigZ+M7CNwATqKdBJo2YrLtTYBoKtSwy C5sw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690235573; x=1690840373; h=content-transfer-encoding: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=7iLSCDG+OdzC6DQNg5TQxXmpUTLzvFLu4P2rVrln0+A=; b=FeMx4m69UFi/hHjtEGJizA69i0m3vYnx4O2tzOjdikilsEfHA+XxDThRl4XoHifc86 50yZsCEm83wJZN+R4XCadpLencEhRbUiB1/V6StI+Pg9fSCxMbYtUOBdsvwzo7UYLaEC Tg7yt0deVP1qbi0ari6PznldtGqEGkvMJJzus9Sf3ef3Mz62o2fo5jSduYE/EW5DUvbN 4nocuEMQSSmEijmQ4NC1xamT38Uv8PTlY9kEpW4Jm2SKIYKsbWZQ/yElGEXKqXQBjiBr FMZHnQziPujAYBlzQ9KcUo6hXxhNOS6IDOAU8n27RC22yobsXn6YjBRlAvzWzM4wc0NS fKLw==
X-Gm-Message-State: ABy/qLYzEzmHy3bWqEUacReJuukqCIr1W3B9pDg44YdJCNs6ONhxywhK c7sBmVHHTdX/6I0CUgXRJcccEfV0ZuRd+V/za8w=
X-Google-Smtp-Source: APBJJlE9CbasmzRUvKotScKz7J1ttxit5ELzdWyZnPueXoCuNS9bG/9L+tuH5souBdypVY4jpTNql+yQBnRqKFKw7a8=
X-Received: by 2002:aa7:cd02:0:b0:51b:f669:9df3 with SMTP id b2-20020aa7cd02000000b0051bf6699df3mr9222586edw.4.1690235572998; Mon, 24 Jul 2023 14:52:52 -0700 (PDT)
MIME-Version: 1.0
References: <CAN8C-_JWY35sVKWH2Ly85c30_zHJuBLP9kO21MJfSFaMOv4PYQ@mail.gmail.com> <29331.1689803277@localhost> <CAN8C-_+_t-oLwFZf-X9jupwbmG_jMgiN54ToJ4PrG2bvZrUT=w@mail.gmail.com> <2381.1689809580@localhost> <CAN8C-_+baqRFa6vhQQ6mJbdwpQri6kNVOVOVJSyAHbRxpxNhUw@mail.gmail.com> <2228.1689815567@localhost> <CAN8C-_+_5KQPMRa11FTimVM7YD8TH7Mz6NjB1Lg9+iVOvjrDhA@mail.gmail.com> <30436.1689820710@localhost> <CAN8C-_LmdSF9T_UDPbTr1OLvBzd6AbSc_7PqhSVgJSUgJb4H6A@mail.gmail.com> <MN2PR13MB26083B8991A0AD480FCA37A8EE3EA@MN2PR13MB2608.namprd13.prod.outlook.com> <CAMBN2CT9Sps=K1zVQa7B=a_4oxktsmxjv0tWPuycmcs07HvhAA@mail.gmail.com> <CAN8C-_J_8Tinx5sqjN__Wnzz8WaCMvjViaLTjSuKL=wwySuagg@mail.gmail.com> <13376.1689893480@localhost> <CAN8C-_+KWkzk+fTbVi=1TfGhyuSWu9Go_JOT326ES2++bE+4FA@mail.gmail.com>
In-Reply-To: <CAN8C-_+KWkzk+fTbVi=1TfGhyuSWu9Go_JOT326ES2++bE+4FA@mail.gmail.com>
From: Brendan Moran <brendan.moran.ietf@gmail.com>
Date: Mon, 24 Jul 2023 22:52:42 +0100
Message-ID: <CAPmVn1PJmxj53WOUjkzXXvVT+w1kSZGHkGb-RQuFWVXjzXNrUQ@mail.gmail.com>
To: Orie Steele <orie@transmute.industries>
Cc: Michael Richardson <mcr+ietf@sandelman.ca>, media-types@ietf.org, JOSE WG <jose@ietf.org>, cose <cose@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/ZfJLdpwhxY9W-XIQRf5GTlepqtk>
Subject: Re: [jose] [COSE] [EXT] Re: Multiple Suffixes with JOSE and COSE media types
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/jose/>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 24 Jul 2023 21:53:01 -0000

As mentioned in the meeting:

If an object with a "typ" element gains a countersignature,
semantically speaking, the aggregate type is now changed. Is the typ
element now wrong?

This is complex, because it means that a countersignature effectively
makes the type incorrect.

To resolve this, you are required to either: verify countersignatures
first or disregard everything in the unprotected headers when
interpreting the typ header parameter.

Both of these introduce the same semantic paradox: If the
counter-signature(s) are excluded from the type, then the typ element
doesn't actually tell me what the aggregate type is. In a naive
interpretation, I don't know how to interpret the countersignatures
because the typ doesn't include them.

Obviously, I don't think we'll be looking at naive interpretations,
but I find it disconcerting that the element being introduced to
represent aggregate types will be incapable of representing aggregate
types that include countersignatures. Clearly, this is not solvable in
the way that it is presented. There are a few ways we could approach
it. Counter-signatures could add their own extensions to the header,
for example. This still has the disadvantage that the "real" type is
nested down in a header of a header.

 Arguably, the "typ" can never be trusted to represent the full
content of a COSE object because the unprotected header can change
without representation, leaving the designated type always
semantically incomplete.

I think, at the least, this needs some explanatory text in the draft.

Best Regards,
Brendan


On Fri, Jul 21, 2023 at 12:42 AM Orie Steele <orie@transmute.industries> wrote:
>
> Inline:
>
> On Thu, Jul 20, 2023, 5:51 PM Michael Richardson <mcr+ietf@sandelman.ca> wrote:
>>
>>
>> Orie Steele <orie@transmute.industries> wrote:
>>     > `+jwt` secures `application/json` (already a registered structured
>>     > suffix)
>>
>> Yesish... but:
>>
>>     > `+cwt` secures `application/cbor` ( registration requests exist...
>>     > https://www.ietf.org/archive/id/draft-ietf-rats-eat-media-type-02.html#section-6.1
>>     > )
>>
>>     > `+cose` secures an envelope that is `application/cbor` and a payload of
>>     > type `content_type` (
>>     > https://github.com/anima-wg/constrained-voucher/issues/264 )
>>
>> Here I had a bit of pause.
>> Eventually I understood/remembered that +cwt isn't secure application/cbor.
>> Rather, it's securing application/cbor with a payload consisting of claims
>> from the CWT registry.  So while the underlying serialization is CBOR, it's
>> not securing arbitrary CBOR.
>>
>> (And that's why constrained-voucher does not use +cwt, because our claims
>> come from YANG, not from COSE)
>>
>>
>> A similar statement applies to +jwt, I think.
>
>
> There was discussion related to this recently on the COSE list, related to the cwt claims in header draft, and the typ COSE header parameters draft.
>
> Summarizing, payload is JSON for jwt, payload is CBOR for cwt.
>
> Afaik, all members are optional, but when present certain members have specific meaning.
>
> Using +jwt, and +cwt signals you want that meaning.
>
> This is relevant to W3C Verifiable Credentials, which... Which uses those meanings.
>
>>
>>     > `+jose` secures an envelope that is `application/json` and a payload of
>>     > type `cty` (AFAIK, nobody is planning to register this as of right
>>     > now).
>>
>> https://datatracker.ietf.org/doc/draft-ietf-anima-jws-voucher/  maybe.
>
>
> Thanks for pointing this out.
>
>>
>>     > You might consider these last 2 special cases of multipart content
>>     > types...  when their headers include `content_type` or `cty`.
>>
>> I kinda get why you are saying multipart, but I don't really like it that way.
>>
>>
>> I want to suggest that there are very few cases of real processing chains in
>> my opinion.  Except for debuggers.
>> +gz -type suffixes are the small exception to this.
>
>
> I agree with this.
>
> With the exception of polyglot formats in general... Which invite leveraging processing chains... This was the original reason for the multiple suffixes draft... +ld+json was rejected because there was no defined behavior for processing multiple suffixes...
>
> It's probably too late now, but this could easily have been solved by just doing +json-ld instead.
>
> A lot of people who have worked with +ld+json would probably agree that while it is json, you spend most of your time looking at the RDF it produces, and cursing about how hard it is to make both the json and the rdf look nice as the same time.
>
>
>>
>> --
>> ]               Never tell me the odds!                 | ipv6 mesh networks [
>> ]   Michael Richardson, Sandelman Software Works        |    IoT architect   [
>> ]     mcr@sandelman.ca  http://www.sandelman.ca/        |   ruby on rails    [
>>
>>
>>
>> --
>> Michael Richardson <mcr+IETF@sandelman.ca>   . o O ( IPv6 IøT consulting )
>>            Sandelman Software Works Inc, Ottawa and Worldwide
>>
>>
>>
>>
>> _______________________________________________
>> jose mailing list
>> jose@ietf.org
>> https://www.ietf.org/mailman/listinfo/jose
>
> _______________________________________________
> COSE mailing list
> COSE@ietf.org
> https://www.ietf.org/mailman/listinfo/cose