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

Carsten Bormann <cabo@tzi.org> Sat, 23 January 2021 13:08 UTC

Return-Path: <cabo@tzi.org>
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 09B783A1188 for <cbor@ietfa.amsl.com>; Sat, 23 Jan 2021 05:08:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.919
X-Spam-Level:
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 mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BGRwWYIpaK4l for <cbor@ietfa.amsl.com>; Sat, 23 Jan 2021 05:08:01 -0800 (PST)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 8BE423A1187 for <cbor@ietf.org>; Sat, 23 Jan 2021 05:08:01 -0800 (PST)
Received: from [192.168.217.118] (p548dc939.dip0.t-ipconnect.de [84.141.201.57]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (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.120.23.2.4\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <87wnw49wez.fsf@hobgoblin.ariadne.com>
Date: Sat, 23 Jan 2021 14:07:59 +0100
Cc: Michael Richardson <mcr@sandelman.ca>, cbor@ietf.org, doug@ewellic.org
X-Mao-Original-Outgoing-Id: 633100079.503913-3180cd2eaca703009622e47e4bd64e06
Content-Transfer-Encoding: quoted-printable
Message-Id: <3DD6CB17-103F-48BF-A4EF-B2AEF1573C93@tzi.org>
References: <87wnw49wez.fsf@hobgoblin.ariadne.com>
To: "Dale R. Worley" <worley@ariadne.com>
X-Mailer: Apple Mail (2.3608.120.23.2.4)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/Rthg_eogQNVXYjg4549Tu8gKKPU>
Subject: Re: [Cbor] [COSE] CBOR magic number, file format and tags
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: Sat, 23 Jan 2021 13:08:04 -0000


> On 2021-01-23, at 04:14, Dale R. Worley <worley@ariadne.com> 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