Re: [Cbor] draft-ietf-cbor-cddl-control-00 should add CDDL notation for CBOR Sequences

Andrew Weiss <anweiss@github.com> Tue, 17 November 2020 15:43 UTC

Return-Path: <anweiss@github.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 8B9C53A1441 for <cbor@ietfa.amsl.com>; Tue, 17 Nov 2020 07:43:47 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=github.com
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 dvgMBkNMy7AR for <cbor@ietfa.amsl.com>; Tue, 17 Nov 2020 07:43:44 -0800 (PST)
Received: from mail-ot1-x332.google.com (mail-ot1-x332.google.com [IPv6:2607:f8b0:4864:20::332]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 244F03A12B2 for <cbor@ietf.org>; Tue, 17 Nov 2020 07:43:44 -0800 (PST)
Received: by mail-ot1-x332.google.com with SMTP id o3so9283603ota.8 for <cbor@ietf.org>; Tue, 17 Nov 2020 07:43:43 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=github.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+b0lG8ZJ+mkzOV6zrbBI2Gy7uHnnVDlnEALWz4SuNes=; b=FdBRdyWTKTmUKXxtfvirrNla0XJP6zi8hdIC0FvrRhSosXDhva9lmuEoqGcaG3p/cN 0YG7bxeV6aPZ+QOV48lCx6f5Wi3rZOGa/JBR5iRzbg8Tj3o4GGoHd4CMYgV7HTKT5U3q WMVgCRQaIJ8rkLl5qBWkLRebzfS0C8NOTEERun69kmiV9+yAHqDwbzlRu3RHeFwXOE1M Zoi94r7/+YRd1xeJazbPxBUNo7IL8iVvhk0uLJ1zYTq97PvpTSkHQHYpGnTLCeHRNT5v 8KBUaLL7JT7TIwMhTROlUsbhqLat5D1q5onYOc1jWMCH+O6AlYb6PaQIhAsDeQKKc4Su ObpA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+b0lG8ZJ+mkzOV6zrbBI2Gy7uHnnVDlnEALWz4SuNes=; b=hNQnk/RlKfqIbpYOOK1A6hkMmQJrSLyGCZ1CFRsb9lIEpnSDXaar8BdHBRJ8cMV/y+ B9uhsxI7LrVTKlAIf0iLJqfOcOESb0Vil2Eyw2pn96HOnPWRYU96neAzwLkLLf5IIzO7 OFclK4WmAP3IzgX9Jm6r3Xk/GmH5hLgS4c8EtAq6GV/vISHUAKKiHg0XpHft+ZX/mY17 hyUFJ4UOpx2u5O7RIzoQTHaOg1j9b7w9W1WqsBR5Y7HYLFEhLlYq8iHr4TiQVU9N+ENo m/wCWWkAJq2tljhT+rrSNKjK4hb6HyrUai9RF2GLftZrp/qzTT7OKjEtrtwR4jGvMEqE Ik2A==
X-Gm-Message-State: AOAM531f2KKgzoTaBV7Ncb835QZge0V8dYf5q1NLzkGuSY4AnE2/QFHX /J4iZo/0sgzrmJELjPzoIHUUGCIDlOWbBQvDiGb3/O1HazA=
X-Google-Smtp-Source: ABdhPJyvi9bBDKqQj3FubeI91lKX6yUSl+DgFTch4Q0m5wrGADuqGR/15b/StdickqquqLdjoWh8KmpMsjyBB2tfsNw=
X-Received: by 2002:a05:6830:2415:: with SMTP id j21mr3262166ots.221.1605627823320; Tue, 17 Nov 2020 07:43:43 -0800 (PST)
MIME-Version: 1.0
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> <a89f603a-8cc9-21c0-4d75-a78c49efc0e7@sit.fraunhofer.de> <5CB44449-A1EB-465A-8A51-14FE14155B68@ericsson.com> <4CBAFAE0-EB02-4E02-9CAD-D7E0AB546F06@tzi.org> <CABL-CE_-2PbNS_BSKC0091D7g3Nja4a0WbQy-nSU-MTVugTHcg@mail.gmail.com>
In-Reply-To: <CABL-CE_-2PbNS_BSKC0091D7g3Nja4a0WbQy-nSU-MTVugTHcg@mail.gmail.com>
From: Andrew Weiss <anweiss@github.com>
Date: Tue, 17 Nov 2020 10:43:32 -0500
Message-ID: <CABL-CE9+sy192tKUhjgYSKPa1bSetDDMzijeQF77JDPbrSJ0JQ@mail.gmail.com>
To: Carsten Bormann <cabo@tzi.org>
Cc: John Mattsson <john.mattsson=40ericsson.com@dmarc.ietf.org>, Henk Birkholz <henk.birkholz@sit.fraunhofer.de>, "cbor@ietf.org" <cbor@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000000d233105b44f5c63"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/gTHOM10Ab194V01B7Nrsiso6L4I>
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: Tue, 17 Nov 2020 15:43:47 -0000

Hey Carsten,

As a follow up to my previous message, I recently released v0.8.4 of my
CDDL tool which supports CBOR sequences. Feel free to give it a whirl and
report back any issues ...
https://github.com/anweiss/cddl/releases/tag/0.8.4

Cheers!

*Andrew*

On Thu, Nov 5, 2020 at 12:17 PM Andrew Weiss <anweiss@github.com> wrote:

> Hey Carsten,
>
> I haven't yet implemented RFC 8742 CBOR sequences (per
> https://github.com/anweiss/cddl#validating-cbor), but it is next on my
> list.
>
> *Andrew*
>
>
> On Thu, Nov 5, 2020 at 12:02 PM Carsten Bormann <cabo@tzi.org> wrote:
>
>> On 2020-11-05, at 17:25, John Mattsson <john.mattsson=
>> 40ericsson.com@dmarc.ietf.org> wrote:
>> >
>> > Hi,
>> >
>> > Henk wrote:
>> >> 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.)
>> >
>> > Carsten wrote:
>> >> Are you talking about the “future versions” part of that?
>> >
>> > Yes, I am asking for a future update to CDDL that allows expression of
>> CBOR Sequences as a top-level item. I want that "future version" of CDDL as
>> soon as possible.
>>
>> I see.  (I don’t see why.)
>>
>> The reason that this is under “future” is that there is no urgency to
>> re-spin CDDL at this point — we can handle all current issues within the
>> extension points (at least until we do the module structure — but that will
>> take another year or two).
>>
>> > The reason I want that updated version is because I want to use CDDL.
>>
>> Yes, and RFC 8742 tells you how to do this for CBOR sequences with
>> today’s CDDL.
>>
>> > The
>> > alternative is to not use CDDL, or as suggested by RFC 8742 and use
>> CDDL together with human readable text. The human readable text cannot be
>> used for automatic verification unless you have a very smart AI.
>>
>> You already need something (“English” or in your implementation glue)
>> that links the specific CDDL spec to the incoming data.
>> That something could as well tell you that the incoming data is a CBOR
>> sequence and not a single CBOR data item, and use the CDDL accordingly.
>> Can you explain the difficulties you find with that?
>>
>> >> 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.
>> >
>> > Yes, all the specs I referred to do something similar. My understanding
>> is that the result is a CBOR sequence (not a single CBOR data item). In
>> EDHOC we have taken every possible measure to shave of bytes so that the
>> message can fit in 5-hop 6TiSCH and LoRaWAN. The resulting CBOR sequence
>> for message_2 is 46 bytes which is still one (1) byte too much. In EDHOC we
>> will need concatenate byte strings of known length to make the CBOR
>> sequence fit inside a single frame. There is absolutely no possibility to
>> take the cost of even a single extra byte.
>>
>> I’m not arguing for converting the CBOR sequence into a single CBOR data
>> item.
>> I’m just arguing that you can use the way of using CDDL for CBOR
>> sequences that is specified today in RFC 8742.
>>
>> Henk has pointed out to me in separate conversation that my CDDL tool is
>> not yet sequence-friendly; I’ll take that as an action point now.
>>
>> Andrew — where is your tool with respect to handling RFC 8742 CBOR
>> sequences?
>>
>> Grüße, Carsten
>>
>>