Re: [Cbor] CDDL for COSE + EAT/CWT + SUIT + CoSIWD

Laurence Lundblade <lgl@island-resort.com> Wed, 08 December 2021 14:31 UTC

Return-Path: <lgl@island-resort.com>
X-Original-To: cbor@ietfa.amsl.com
Delivered-To: cbor@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 765AC3A09FF for <cbor@ietfa.amsl.com>; Wed, 8 Dec 2021 06:31:00 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 21Qt6D8JMe7n for <cbor@ietfa.amsl.com>; Wed, 8 Dec 2021 06:30:56 -0800 (PST)
Received: from p3plsmtpa07-10.prod.phx3.secureserver.net (p3plsmtpa07-10.prod.phx3.secureserver.net [173.201.192.239]) (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 BBC693A09B7 for <cbor@ietf.org>; Wed, 8 Dec 2021 06:30:55 -0800 (PST)
Received: from [192.168.1.3] ([75.80.148.243]) by :SMTPAUTH: with ESMTPSA id uxyAm5zfM0JyzuxyAmPwcF; Wed, 08 Dec 2021 07:30:55 -0700
X-CMAE-Analysis: v=2.4 cv=XbtMcK15 c=1 sm=1 tr=0 ts=61b0c19f a=VPU1mRQhDhA4uSX60JRRww==:117 a=VPU1mRQhDhA4uSX60JRRww==:17 a=48vgC7mUAAAA:8 a=7CQSdrXTAAAA:8 a=gKmFwSsBAAAA:8 a=K6EGIJCdAAAA:8 a=L82XNSfBcFglpR8BiegA:9 a=QEXdDO2ut3YA:10 a=yBqH_-WlQU1ZunpDcGsA:9 a=wffzYXZO9mBj5Gis:21 a=_W_S_7VecoQA:10 a=w1C3t2QeGrPiZgrLijVG:22 a=a-qgeE7W1pNrGK8U0ZQC:22 a=nnPW6aIcBuj1ljLj_o6Q:22 a=L6pVIi0Kn1GYQfi8-iRI:22
X-SECURESERVER-ACCT: lgl@island-resort.com
From: Laurence Lundblade <lgl@island-resort.com>
Message-Id: <27539CB9-42E7-4313-8786-58B0A504E7E2@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_8367B9BA-5C32-4196-B3CF-41EBDE6DEF5C"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Date: Wed, 08 Dec 2021 06:30:54 -0800
In-Reply-To: <DBBPR08MB5915DCAD539AD2CA4770515BFA6F9@DBBPR08MB5915.eurprd08.prod.outlook.com>
Cc: Carsten Bormann <cabo@tzi.org>, cose <cose@ietf.org>, "cbor@ietf.org" <cbor@ietf.org>, Henk Birkholz <henk.birkholz@sit.fraunhofer.de>
To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>
References: <85278E84-AD34-4F68-94DC-437BABCCD621@island-resort.com> <DBBPR08MB591541267172A49382892483FA6F9@DBBPR08MB5915.eurprd08.prod.outlook.com> <75C33F50-0C92-47B9-80DB-050499F51630@tzi.org> <DBBPR08MB5915DCAD539AD2CA4770515BFA6F9@DBBPR08MB5915.eurprd08.prod.outlook.com>
X-Mailer: Apple Mail (2.3608.120.23.2.1)
X-CMAE-Envelope: MS4xfKpxrRABl70OXh9WhJiEdHLYuOBwWCM3BgtyBwsJdWhfogWKtHNlZoD7C5EiNgMoA1vhZz2218c9iggXWBQyu2NrbCHMxUtnwvJuaSqy8xkNph65pjbE hgG6nqx3aELVRfhAppKIqZ4IEgDPfifioLzFYaVAmQO9Gn668Ix8kuRAf0AWMhOtpgmwVfvcfHAZtYS0V04G9SS6MlS9jCgZ/+foUHPG1di+UubokRR05pT4 6Hhkde3zdH9eweaBZU8KO+Gx9Ng/0vSQeYeJKO8w1wSykLoWa3NH3oBJY4BPqI8Qz/BKpgW3CykwLnW3wiOLhA==
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/VipYagqjYmxjnBMNwq3sareCJSM>
Subject: Re: [Cbor] CDDL for COSE + EAT/CWT + SUIT + CoSIWD
X-BeenThere: cbor@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <cbor.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cbor>, <mailto:cbor-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cbor/>
List-Post: <mailto:cbor@ietf.org>
List-Help: <mailto:cbor-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cbor>, <mailto:cbor-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 08 Dec 2021 14:31:07 -0000

Hi Hannes,

This is only about a tiny little part of the EAT spec and is not important for EAT publication.

This is only about how to use CDDL with COSE. It’s not about interoperability or what claims there are in the EAT spec.

Hannes, you can probably ignore this thread if you want.


To go further…

I am observing how two different protocols that use COSE specify what the COSE payload should be. I am interested because EAT must specify this too. I noticed that they do it different:
— CoSWID goes to a lot of trouble to use CDDL via a .cbor control
— SUIT just uses simple prose, not CDDL

Note that I am only talking about the CDDL link between COSE and the COSE payload. Clearly SUIT, EAT and CoSWID all of which are COSE payloads are described in CDDL. See details below for what I mean by the link.

I was quite happy with simple prose, but then I saw what CoSWID did. It seemed worth checking in because CoSWID went to a lot of trouble to do what it did.

Right now, I think simple prose is fine and even prefer it. 

If I were the CoSWID author I would probably stick with simple prose so the CDDL for COSE doesn’t have to be replicated and to allow for COSE encryption.

If I were the draft-ietf-cose-rfc8152bis-struct author, I’d make an attempt at a CDDL template for COSE so that future standards could do what CoSWID did without replicating COSE CDDL.

If that turned out well, then for future protocols after publication of draft-ietf-cose-rfc8152bis-struct, I’d consider using the CDDL template for COSE messages.

LL


Here’s the link between for COSE payload for CoSWID. It is in blue in this CDDL that is replicated from COSE. It occurs in  section 7 of CoSWID. <https://datatracker.ietf.org/doc/html/draft-ietf-sacm-coswid-19#section-7>

   COSE-Sign1-coswid<payload> = [
       protected: bstr .cbor protected-signed-coswid-header,
       unprotected: unprotected-signed-coswid-header,
       payload: bstr .cbor payload,
       signature: bstr,
   ]


Here it is in prose in SUIT in section 5.2 <https://datatracker.ietf.org/doc/html/draft-ietf-suit-manifest-16#section-5.2>:

 These blocks
   are one of:


   *  COSE_Sign_Tagged

   *  COSE_Sign1_Tagged

   *  COSE_Mac_Tagged

   *  COSE_Mac0_Tagged

   Each of these objects is used in detached payload mode.  The payload
   is the bstr-wrapped SUIT_Digest.


Here it is in CWT, section 7.1 in prose <https://datatracker.ietf.org/doc/html/rfc8392#section-7.1>

   1.  Create a CWT Claims Set containing the desired claims.

   2.  Let the Message be the binary representation of the CWT Claims
       Set.

   3.  Create a COSE Header containing the desired set of Header
       Parameters.  The COSE Header MUST be valid per the [RFC8152 <https://datatracker.ietf.org/doc/html/rfc8152>]
       specification.

   4.  Depending upon whether the CWT is signed, MACed, or encrypted,
       there are three cases:

       *  If the CWT is signed, create a COSE_Sign/COSE_Sign1 object
          using the Message as the COSE_Sign/COSE_Sign1 Payload; all
          steps specified in [RFC8152 <https://datatracker.ietf.org/doc/html/rfc8152>] for creating a COSE_Sign/
          COSE_Sign1 object MUST be followed.


EAT inherits this from CWT so it doesn’t need to say it explicitly. 

However EAT uses CDDL so it is a possibility that EAT can do what CoSWID did.



> On Dec 8, 2021, at 4:46 AM, Hannes Tschofenig <Hannes.Tschofenig@arm.com> wrote:
> 
> Hi Carsten,
> 
> I suspect Laurence is sending this email because of his work on EAT. I am arguing that an attempt to improve the CDDL for the mentioned specs will not lead to any improvement at all because the problem is elsewhere. I am saying that because I have just spent many hours reading the EAT spec.
> 
> Ciao
> Hannes
> 
> -----Original Message-----
> From: Carsten Bormann <cabo@tzi.org>
> Sent: Wednesday, December 8, 2021 1:37 PM
> To: Hannes Tschofenig <Hannes.Tschofenig@arm.com>
> Cc: Laurence Lundblade <lgl@island-resort.com>; cose <cose@ietf.org>; cbor@ietf.org; Henk Birkholz <henk.birkholz@sit.fraunhofer.de>
> Subject: Re: [Cbor] CDDL for COSE + EAT/CWT + SUIT + CoSIWD
> 
> On 2021-12-08, at 13:30, Hannes Tschofenig <Hannes.Tschofenig@arm.com> wrote:
>> 
>> EAT by itself is not really an interoperable spec. COSE on its own is not interoperable either.
> 
> If I guess about the definition of "interoperable spec” you are using here, ASCII is not an interoperable spec either - you still have to agree on what the text means…  Still, ASCII was kind of useful as the basis for a lot of interoperability, I think.
> 
> I think the point here was to shape some CDDL that makes it easier to talk about the way a more specific (interoperable?) spec uses COSE (which does have CDDL, just not in a way that usually can be integrated as-is to express the additional constraints a COSE-using specification typically makes).
> 
> Grüße, Carsten
> 
> IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.