Re: [Cbor] Chair review of cbor-file-magic 08

Carsten Bormann <cabo@tzi.org> Sat, 05 March 2022 01:14 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 8447E3A13E7; Fri, 4 Mar 2022 17:14:13 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.909
X-Spam-Level:
X-Spam-Status: No, score=-1.909 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, 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 OY1KINYHaBPV; Fri, 4 Mar 2022 17:14:07 -0800 (PST)
Received: from gabriel-smtp.zfn.uni-bremen.de (gabriel-smtp.zfn.uni-bremen.de [134.102.50.15]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 6A7973A13E3; Fri, 4 Mar 2022 17:14:06 -0800 (PST)
Received: from [192.168.217.118] (p5089ad4f.dip0.t-ipconnect.de [80.137.173.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-smtp.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4K9RZM668RzDCmZ; Sat, 5 Mar 2022 02:14:03 +0100 (CET)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <YhTi7sT7O7xzjLQz@hephaistos.amsuess.com>
Date: Sat, 5 Mar 2022 02:14:03 +0100
Cc: cbor@ietf.org, draft-ietf-cbor-file-magic@ietf.org
X-Mao-Original-Outgoing-Id: 668135643.3857369-9ce0ccd283e535b1c345c538d9fcf117
Content-Transfer-Encoding: quoted-printable
Message-Id: <0425DF6E-EB50-4711-89A6-DFD14FE3FD8A@tzi.org>
References: <164442074235.12313.4216473952031101282@ietfa.amsl.com> <YgPhxUmjDUqLTEtK@hephaistos.amsuess.com> <YhTi7sT7O7xzjLQz@hephaistos.amsuess.com>
To: =?utf-8?Q?Christian_Ams=C3=BCss?= <christian@amsuess.com>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/pGtk7vSIfbEVNRmUqlMaBEhsULY>
Subject: Re: [Cbor] Chair review of cbor-file-magic 08
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, 05 Mar 2022 01:14:15 -0000

Hi Christian,

I didn’t originally follow this thread, so I’m going to go through this sequentially.

> On 2022-02-22, at 14:19, Christian Amsüss <christian@amsuess.com> wrote:
> 
> Hello file-magic authors,
> 
> as part of my shepherd write-up I'm reviewing the altest file-magic
> document as it is passing working group last call. All these comments
> are (presumably) editorial in nature and do not alter that outcome.
> 
> * "for each major type of object that they might store on disk": It is
>  not used as a proper name, but "major type" might ring the bell of
>  "first 3 bits" of CBOR, which AIU is not intended here.
> 
>  (Suggestion: "for each kind of object that they might store on disk").

(Already in MCR’s PR.)

> * 5.3: At latest here,

IANA Considerations text is not really meant to have technical content, so I wouldn’t want to add text here.

> I'd have expected to read something about the
>  information that is lost when using this tag with 2.2. Maybe there
>  should be a line (not for IANA but for users, so maybe in a different
>  section) that outlines when this works with (non)CBOR content formats
>  and with which encodings.
> 
>  I think I understand now that the 5.3 tags can be used with either
>  2.2, 2.3 or C (55899, 55800 and 55801),

The 5.3 tags can be used for a lot of other purposes.  For instance, we forgot to define CBOR tags for SenML.  This is now remedied by virtue of having defined Content-Format numbers.

> but
> 
>  * with 55899 the ct tags can only be used if the content format is a
>    CBOR content format and coding is identity (and then tags a value)

Right.
Actually, the CBOR data item in the content format is used as the tag content of the ct tag.  (5.3 does not mention this case, sigh.)

>  * with 55900 the ct tags can only be used if the content format is a
>    CBOR-sequence content format and coding is identity (and then tags
>    a byte string)

The tag content is ‘BOR’.

>  * with 55901 the ct tags can always be used, and tag a byte string
>    (which is also encoded according to the coding that is part of the
>    ct)

Again, the tag is on byte string ‘BOR’.

>  If all these should be allowed, I think this should be spelled out
>  somewhere -- otherwise the examples appear to be conflicting.

Yes.
I made a significant editorial round to get this captured.

Please see: https://github.com/cbor-wg/cbor-magic-number/pull/17

> * (Maybe security) considerations: 3.2 talks of trivially concatenated
>  data items. If CBOR Tag Sequence is used and the data gets literally
>  "concatenated", (say, `cat *.cborseq > outfile`), one might wind up
>  with self-described tags in the middle of the sequence. (As we do
>  with BOMs).

Yes.

So it is better to take off the cbor-magic label before concatenating.
More text in the above PR.

>  Have BOMs caused issues in the past?

(Does it hurt when you hit your head with a hammer?)

> If so, would you care for grave
>  words we can haul against those who repeat inner-BOMs with CBOR?

This is not a BOM, please don’t say that word in polite company.
I think that the wording in the PR is describing the need and when it occurs.

> * A.1: This appears to be in direct conflict with the 2.2.1 example
>  (where the same tag is used with a non-bstr content). By the above the
>  limitation to bstr may still make sense, but only in the context of a
>  55800 or 55801 tag (but there, the tagged value is always not only
>  bstr but even precisely 'BOR'). Maybe the example would be clearer if
>  it would reference one of 2.2, 2.3 and appendix C.

I put some more explanation in the draft, but maybe looking at the examples again is next.
> 
> Best regards
> Christian
> 
> -- 
> To use raw power is to make yourself infinitely vulnerable to greater powers.
>  -- Bene Gesserit axiom