Re: [Cbor] [COSE] CBOR magic number, file format and tags

Carsten Bormann <> Sat, 23 January 2021 13:08 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 09B783A1188 for <>; Sat, 23 Jan 2021 05:08:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Status: No, score=-1.919 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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 BGRwWYIpaK4l for <>; Sat, 23 Jan 2021 05:08:01 -0800 (PST)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8BE423A1187 for <>; Sat, 23 Jan 2021 05:08:01 -0800 (PST)
Received: from [] ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPSA id 4DNGdX07RTzyTZ; Sat, 23 Jan 2021 14:07:59 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.\))
From: Carsten Bormann <>
In-Reply-To: <>
Date: Sat, 23 Jan 2021 14:07:59 +0100
Cc: Michael Richardson <>,,
X-Mao-Original-Outgoing-Id: 633100079.503913-3180cd2eaca703009622e47e4bd64e06
Content-Transfer-Encoding: quoted-printable
Message-Id: <>
References: <>
To: "Dale R. Worley" <>
X-Mailer: Apple Mail (2.3608.
Archived-At: <>
Subject: Re: [Cbor] [COSE] CBOR magic number, file format and tags
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: Sat, 23 Jan 2021 13:08:04 -0000

> On 2021-01-23, at 04:14, Dale R. Worley <> wrote:
> Here's an alternative.  It is aligned with the magic number tag of CBOR
> itself (55799) and the CBOR way of doing things.  Specifically, reserve
> a large range of tags (such as 55800 to 65000, or 100000 to 109999) for
> use as magic numbers; the CBOR object has the appropriate magic number
> tag applied to that, and optionally, the CBOR magic number tag 55799
> applied to that.  That can leave the generic CBOR magic number visible
> at the start of the file, immediately followed by the bytes of the
> specific magic number for the object type.

Right.  Something like this would probably make sense as an alternative to the primary approach proposed, which is based on CBOR sequences.  If you want to keep the magic-numbered file a single data item, this is the way to go.

Two issues:

— This should probably be a 1+4-byte tag.  The range you mention leads to a zero byte in the magic number.  Not sure if that is a bug or a feature.  (It is also way too small.)

— As I mentioned before, we don’t have a good way to assign a purpose to a range and then let IANA do the allocation within the range.

Grüße, Carsten