Re: [Cbor] I-D Action: draft-ietf-cbor-file-magic-06.txt

Michael Richardson <> Wed, 10 November 2021 22:44 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 330753A1443 for <>; Wed, 10 Nov 2021 14:44:34 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id L5D8bHUBXnPi for <>; Wed, 10 Nov 2021 14:44:29 -0800 (PST)
Received: from ( [IPv6:2a01:7e00:e000:2bb::1]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 34C743A11F7 for <>; Wed, 10 Nov 2021 14:44:28 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTPS id 470471F47B for <>; Wed, 10 Nov 2021 22:44:25 +0000 (UTC)
Received: by (Postfix, from userid 179) id 264F41A0548; Wed, 10 Nov 2021 17:44:23 -0500 (EST)
From: Michael Richardson <>
In-reply-to: <>
References: <> <>
Comments: In-reply-to Christian =?us-ascii?Q?=3D=3Fiso-8859-1=3FQ=3FAms=3D?= =?us-ascii?Q?FCss=3F=3D?= <> message dated "Wed, 03 Nov 2021 15:09:39 +0100."
X-Mailer: MH-E 8.6+git; nmh 1.7.1; GNU Emacs 26.3
X-Attribution: mcr
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature"
Date: Wed, 10 Nov 2021 17:44:23 -0500
Message-ID: <403793.1636584263@dooku>
Archived-At: <>
Subject: Re: [Cbor] I-D Action: draft-ietf-cbor-file-magic-06.txt
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Wed, 10 Nov 2021 22:44:34 -0000

I really didn't have the focus last week to understand your observation.

Christian Amsüss <> wrote:
    >> A diff from the previous version is available at:

    > The example has now become inconsistent, mixing the CBOR Tag Wrapped
    > and CBOR Tags for Content Formats parts:

    >> to translate the Content-Format number registered for
    >> application/senml+cbor, the number 112, into the tag 1668546560+112 =
    >> 1668546672.
    >> 55799(1668546672([{0: "current", 6: 3, 2: 1.5}]))

    > puts CBOR data into the content-format generated item, whereas Appendix
    > A says:

    >> The tag content tagged with tag number [...] is a byte string that is
    >> to be interpreted as a representation of the content format
    >> NNNNNNNN-1668546560.

    > which would look like 55799(1668546672(h'a30067...')).

    > My understanding so far was that with the current appendix, all data
    > would be bstr-valued, and if a) the content format is CBOR based, and
    > b) the transport coding is "identity", and c) the representation is
    > actually well-formed in the advertised content format, only then will
    > the byte string (happen to) be valid CBOR, but still encoded in a byte
    > string.

I finally understand the problem you are describing (ENOCOFFEE!)
Some CoAP Content Formats are CBOR, but not all of them are.
For an abitrary Content Format, we can't run the proceedure.
But, the example in section 2.2.1 does exactly this.

However, all of the CoAP payloads are valid bstr, so the example says to do
that for the two things that it has shown.

When Carsten suggested the Content-Format -> Tag, I didn't htink that some
content format isn't CBOR.
(Sacrilege! How dare CoAP be profaned with non-CBOR content!)^K

It seems that we need to choose:

a) them all to be bstr'ed
b) for only those that happen to be CBOR to be acceptable
c) some combination of the above, as appropriate.

I think that having them all bstr'ed for storage on disk is not particularly
useful to existing programs.  We can carry PKIX certificates in CoAP
(draft-ietf-anima-constrained-voucher and draft-ietf-ace-est-coaps), but
I wouldn't want to store that on disk bstr'ed.

So I would go for (b), and we should fix the Appendix.
Carsten messaged me that he had some slides in the works for Thursday.

Michael Richardson <>ca>, Sandelman Software Works
 -= IPv6 IoT consulting =-