Re: [Cbor] draft-ietf-cbor-cddl-control-00 should add CDDL notation for CBOR Sequences
Henk Birkholz <henk.birkholz@sit.fraunhofer.de> Thu, 05 November 2020 15:55 UTC
Return-Path: <henk.birkholz@sit.fraunhofer.de>
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 2F3833A1395 for <cbor@ietfa.amsl.com>; Thu, 5 Nov 2020 07:55:59 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.144
X-Spam-Level:
X-Spam-Status: No, score=-2.144 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, NICE_REPLY_A=-0.247, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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 FDz46uOY4eLK for <cbor@ietfa.amsl.com>; Thu, 5 Nov 2020 07:55:56 -0800 (PST)
Received: from mail-edgeKA24.fraunhofer.de (mail-edgeka24.fraunhofer.de [153.96.1.24]) (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 2555B3A138B for <cbor@ietf.org>; Thu, 5 Nov 2020 07:55:54 -0800 (PST)
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A2GcCQA1H6Rf/xwBYJliHQEBAQEJARIBBQUBQIFPgxqBNgqEM5ByLoEEmxwJCwEBAQEBAQEBAQcBARgLCgIEAQEChEgCghABJTgTAhABAQYBAQEBAQYEAgKGIQYnDINUgQcBAQEBAQEBAQEBAQEBAQEBAQEBFgJDVRIBAR0BAQEBAgEBASEPAQU2EAcECQIRAwECAQICJgICJyAICAYBDAYCAQEXgwsBglwfBQuUSJsPdoEyhVeDLoE8BoEOKoZjhlcPgU0/gREnD4InNT6CXQEBAgGEc4JfBJNgpBYrB4FjgQ2BEAQLh2uGX4sUBQofgxiKEoUdBo8gk02KeJVMAgQCCQIVgWuBe00kT4JpUBcCDYZOh1oaFIhOhUVzAgE1AgYBCQEBAwl8jDsBgRABAQ
X-IPAS-Result: A2GcCQA1H6Rf/xwBYJliHQEBAQEJARIBBQUBQIFPgxqBNgqEM5ByLoEEmxwJCwEBAQEBAQEBAQcBARgLCgIEAQEChEgCghABJTgTAhABAQYBAQEBAQYEAgKGIQYnDINUgQcBAQEBAQEBAQEBAQEBAQEBAQEBFgJDVRIBAR0BAQEBAgEBASEPAQU2EAcECQIRAwECAQICJgICJyAICAYBDAYCAQEXgwsBglwfBQuUSJsPdoEyhVeDLoE8BoEOKoZjhlcPgU0/gREnD4InNT6CXQEBAgGEc4JfBJNgpBYrB4FjgQ2BEAQLh2uGX4sUBQofgxiKEoUdBo8gk02KeJVMAgQCCQIVgWuBe00kT4JpUBcCDYZOh1oaFIhOhUVzAgE1AgYBCQEBAwl8jDsBgRABAQ
X-IronPort-AV: E=Sophos;i="5.77,453,1596492000"; d="scan'208";a="25379088"
Received: from mail-mtaka28.fraunhofer.de ([153.96.1.28]) by mail-edgeKA24.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 16:55:52 +0100
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0CMBwA1H6Rf/1lIDI1iHQEBAQEJARIBBQUBQIFPgipwWDAuCoQzkHIugQSbJQsBAwEBAQEBBwEBGAsKAgQBAYRKAoIOAiU4EwIQAQEFAQEBAgEGBHGFNAYnDIVyAQEBAwEBASEPAQU2EAcECQIRAwECAQICJgICJyAICAYBDAYCAQEXgwsBglwkC5RImw92gTKFV4MugTwGgQ4qhmOGVw+BTT+BEScPgic1PoJdAQECAYRzgl8Ek2CkFisHgWOBDYEQBAuHa4ZfixQFCh+DGIoShR0GjyCTTYp4lUwCBAIJAhWBayOBV00kT4JpUBcCDYZOh1oaFIhOhUVCMQIBNQIGAQkBAQMJfIw7AYEQAQE
X-IronPort-AV: E=Sophos;i="5.77,453,1596492000"; d="scan'208";a="39122874"
Received: from mailext.sit.fraunhofer.de ([141.12.72.89]) by mail-mtaKA28.fraunhofer.de with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Nov 2020 16:55:50 +0100
Received: from mail.sit.fraunhofer.de (mail.sit.fraunhofer.de [141.12.84.171]) by mailext.sit.fraunhofer.de (8.15.2/8.15.2/Debian-10) with ESMTPS id 0A5Ftogf026951 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=NOT); Thu, 5 Nov 2020 16:55:50 +0100
Received: from [192.168.16.50] (79.234.121.161) by mail.sit.fraunhofer.de (141.12.84.171) with Microsoft SMTP Server (TLS) id 14.3.487.0; Thu, 5 Nov 2020 16:55:45 +0100
To: John Mattsson <john.mattsson@ericsson.com>, "cbor@ietf.org" <cbor@ietf.org>
References: <317AB3AB-B1E9-4AD9-911E-559D166E2788@ericsson.com> <d45672c4-b42c-fb0f-3ab5-0fcd7712f29b@sit.fraunhofer.de> <FCE40691-EC98-4A0C-9C3E-59F9018A15C8@ericsson.com> <3f63613d-9571-f739-d517-042b4ca9398d@sit.fraunhofer.de> <B63CB2BF-1F68-4ECB-851B-CD794D1203D9@ericsson.com>
From: Henk Birkholz <henk.birkholz@sit.fraunhofer.de>
Message-ID: <a89f603a-8cc9-21c0-4d75-a78c49efc0e7@sit.fraunhofer.de>
Date: Thu, 05 Nov 2020 16:55:44 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <B63CB2BF-1F68-4ECB-851B-CD794D1203D9@ericsson.com>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Language: en-US
Content-Transfer-Encoding: 8bit
X-Originating-IP: [79.234.121.161]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/I93QwdFGHTRpqkbazTcpj9vrCj8>
Subject: Re: [Cbor] draft-ietf-cbor-cddl-control-00 should add CDDL notation for CBOR Sequences
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: Thu, 05 Nov 2020 15:55:59 -0000
Hi John, picking the first of the documents you cited, I-D.ietf-6tisch-minimal-security states: > For encoding compactness, the Link_Layer_Key object is not enclosed > in a top-level CBOR object. Rather, it is transported as a sequence > of CBOR elements [I-D.ietf-cbor-sequence], some being optional. So the solution here is to concatenate four separate CBOR data items (key_id, key_usage, key_value, key_addinfo) in order to safe the bytes that would wrap them in an array and would result in a single CBOR data item. While I cannot assess, if the bytes saved here warrant the use of a cborseq, this seems like a solid spec to me and I wonder why this is not a solution therefore needs to be fixed. Circling back to my initial reply, I am still under the impression that you are asking for a CDDL notation that can express CBOR Sequences as a top-level item in a CDDL spec, right? (RFC8764 is hinting at that.) Viele Grüße, Henk On 05.11.20 16:10, John Mattsson wrote: > Hi Henk, > > The CDDL > > my-embedded-cbor-seq = bytes .cborseq my-array > > mathches a CBOR sequence wrapped in a byte string. I.e. "bytes .cborseq [ 1, 2 ]" would match the CBOR encoding 0x420102 > > All the document I cited use unadorned CBOR Sequences (i.e. not wrapped in a byte string). As far as I know there is no way to write CDDL that matches the unadorned CBOR Sequence 0x0102 ( 1, 2 ). I think this needs to be fixed. > > John > > -----Original Message----- > From: Henk Birkholz <henk.birkholz@sit.fraunhofer.de> > Date: Thursday, 5 November 2020 at 16:02 > To: John Mattsson <john.mattsson@ericsson.com>, "cbor@ietf.org" <cbor@ietf.org> > Subject: Re: [Cbor] draft-ietf-cbor-cddl-control-00 should add CDDL notation for CBOR Sequences > > Hi John, > > I might be totally missing something obvious here - it's just that I am > having a hard time visualizing your problem at the moment. > > Maybe asking the obvious can help (me getting a grasp of the issue). Why > does the following recommendation from RFC8764 not help you? > >> my-embedded-cbor-seq = bytes .cborseq my-array >> my-array = [* my-element] >> my-element = my-foo / my-bar > > Viele Grüße, > > Henk > > > On 05.11.20 15:54, John Mattsson wrote: >> Hi Henk, >> >> To quote RFC 8764 >> >> 1) "CBOR Sequences are already supported as contents of byte strings using the ".cborseq" control operator" >> 2) "CDDL does not provide for unadorned CBOR Sequences as a top-level subject of a specification" >> >> All the document I cited do 2) not 1) .cborseq as currently specified is not a solution. >> >> Cheers, >> John >> >> -----Original Message----- >> From: Henk Birkholz <henk.birkholz@sit.fraunhofer.de> >> Date: Thursday, 5 November 2020 at 15:29 >> To: John Mattsson <john.mattsson@ericsson.com>, "cbor@ietf.org" <cbor@ietf.org> >> Subject: Re: [Cbor] draft-ietf-cbor-cddl-control-00 should add CDDL notation for CBOR Sequences >> >> Hi John, >> >> as the control for cborseq is introduced in: >> >>> https://tools.ietf.org/html/rfc8610#section-3.8.4 >> >> and RFC8742 states that: >> >>> Currently, CDDL does not provide for unadorned CBOR Sequences as a >>> top-level subject of a specification. For now, the suggestion is to >>> use an array for the top-level rule, as is used for the ".cborseq" >>> control operator, and add English text that explains that the >>> specification is really about a CBOR Sequence with the elements of >>> the array >> >> it seems to me that you are asking for a specific CDDL notation that can >> represent a cborseq as a top-level subject. Why is using an array here >> not good enough in your case? >> >> Viele Grüße, >> >> Henk >> >> On 05.11.20 13:49, John Mattsson wrote: >>> Hi, >>> >>> I the most important missing piece in RFC 8610 is the lack of CDDL for CBOR Sequences (RFC 8742) and I think draft-ietf-cbor-cddl-control would be a good place to add CDDL for that. >>> >>> CBOR sequences has already been standardized in RFC 8742. CBOR sequences are used quite heavily in IETF documents such as RFC 8769, draft-ietf-6tisch-minimal-security, draft-ietf-lake-edhoc, draft-palombini-core-oscore-edhoc, draft-mattsson-cose-cbor-cert-compress, etc. >>> >>> I don't understand all the complexities of CDDL formalism, but this seems like a quite easy thing to solve. I do not care exactly which notation is used, but could we please just agree on something and put in a draft. >>> >>> The notation could be something like: >>> >>> - reuse the CDDL notation for group ( ... ) >>> - reuse the Diagnostic Notation for CBOR sequences << ... >> >>> - Some modification of the CDDL array notation ] ... [ >>> - Something looking like symbol swearing #$%@#$% ... #$%@#$% >>> ... >>> >>> Cheers, >>> John >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> CBOR mailing list >>> CBOR@ietf.org >>> https://www.ietf.org/mailman/listinfo/cbor >>> >> >
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Henk Birkholz
- [Cbor] draft-ietf-cbor-cddl-control-00 should add… John Mattsson
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Henk Birkholz
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… John Mattsson
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… John Mattsson
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Carsten Bormann
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Henk Birkholz
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Henk Birkholz
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… John Mattsson
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Carsten Bormann
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Andrew Weiss
- Re: [Cbor] draft-ietf-cbor-cddl-control-00 should… Andrew Weiss