Re: [Cbor] my (WGLC re-)views on error processing in RFC7049bis and future-proofing

Carsten Bormann <cabo@tzi.org> Sat, 16 May 2020 06:49 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 C38C23A0813 for <cbor@ietfa.amsl.com>; Fri, 15 May 2020 23:49:36 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.001
X-Spam-Level:
X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 tests=[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 c-UbbxeR3bME for <cbor@ietfa.amsl.com>; Fri, 15 May 2020 23:49:29 -0700 (PDT)
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 3D0E53A080E for <cbor@ietf.org>; Fri, 15 May 2020 23:49:28 -0700 (PDT)
Received: from [192.168.217.119] (p548DC699.dip0.t-ipconnect.de [84.141.198.153]) (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 49PG9248NQzySP; Sat, 16 May 2020 08:49:26 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <26665.1589593222@localhost>
Date: Sat, 16 May 2020 08:49:25 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 611304565.650685-67a4815eb07b9b9d3a4f2ff6bd7613e6
Content-Transfer-Encoding: quoted-printable
Message-Id: <BE5F21D6-06D7-43B2-864A-15ECD2FF994D@tzi.org>
References: <17300.1588779159@localhost> <38BB6FFF-737F-4C11-AD7A-DA3F28A9F570@tzi.org> <CANh-dXkdjMyO=WFUxrF06OfP+RE9v11unKJXL8P3UtEe+prV1w@mail.gmail.com> <13690.1588894939@localhost> <CANh-dXmjD=RCwh7ExjSvFx+5ciew+eqHoVS88OommQ2xVnX5=Q@mail.gmail.com> <2963.1589473899@localhost> <BC0EC9BE-4202-4EED-A619-CDEB9BF312CE@tzi.org> <26665.1589593222@localhost>
To: Michael Richardson <mcr+ietf@sandelman.ca>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/MTlUo8lbfJdH8L0mxcFc1g_Uedw>
Subject: Re: [Cbor] my (WGLC re-)views on error processing in RFC7049bis and future-proofing
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, 16 May 2020 06:49:37 -0000

Good morning Michael,

a few quick answers to your quick answers to my first quick answers.

> Carsten Bormann <cabo@tzi.org> wrote:
>>>> 28, 29, 30: These values are reserved for future additions to the
>>>> CBOR format.  In the present version of CBOR, the encoded item is not
>>>> well-formed.
>>> 
>>> I think that there is a bug here.  What should a parser written today
>>> do when it encounters these values?  (forward reference to section
>>> 7.2?)
> 
>> Give up (not well-formed), as there is no way to know how big the head
>> with these ai values is.
> 
> Give up, returning the content so-far, or ??

1.2:
      CBOR decoders by definition only return contents from well-formed
      data items.

So the answer is “return an error”.

> 
>>> Getting this right is how we deal with future-proofing.
> 
>> We do have extension points that have full compatibility; this
>> potential one just doesn’t.
> 
>>> It seems seeing such a thing means a current decoder has to
>>> abort/fail.  What we write here has a profound implication, I think,
>>> on how easily we could act on the advice of section 7.2.
> 
>> It would be a CBOR 1.1 (or 2.0), it will not be easy on existing
>> decoders!
> 
> Should we plan a tag for version?

No.

First of all, we have no idea whether the room we left here in the encoding space will ever be exercised.  Yes, it is an attractive nuisance (not exercising it leaves one feel strangely unsatisfied), but people have been happy with the other ways to indicated 128-bit etc. values.

Second, the habit to put versions in interchange specifications generally is misguided.  Unless they are needed to prevent false interoperability.  But false interoperability cannot happen here, as the reserved ai values are easily recognizable as such.

(CBOR is designed to be versionless, by defining well-defined extension points.  Version indications also would take significant space in one major area of application of CBOR: Small data items.)

> 
>>> Section 10, first paragraph implies we should say something.
>>> 
>>> In general, I think that the details in this introductionary encoding
>>> section are too detailed, particularly for 31.  I think that detail
>>> belongs later on. I got no value (I retained nothing) from having that
>>> level of detail there.
>>> 
>>> I wonder if section 3.1, under major type 0 should give clarify that
>>> "0" is encoded as 0b000_00000. (That is no negative 0)
>>> 
>>> "A string containing an invalid UTF-8 sequence is well- formed but
>>> invalid."
>>> 
>>> I think that this might need clarification.
>>> 
>>> I guess that RFC8742 include sequences of 7049bis CBOR sequences.  I
>>> wonder if Updates 8742 is appropriate.
> 
>> You lost me here.
> 
> Do we need to Update 8742 too?

But nothing is updated, and certainly not in 8742?

>>> 3.2.3: (Note that zero-length chunks, while not particularly useful,
>>> are permitted.)
>>> 
>>> they might be useful in non-TCP/IP situations where it is useful to
>>> send a "keep-alive" on some channel.
> 
>> We haven’t addressed general padding im CBOR (which would again require
>> a 1.1 or 2.0 maybe), and I would hate to suggest this here as the only
>> padding that CBOR already offers.
> 
> Okay, so maybe forward to Protocol.

Yes.

>>> Could future Simple Values (such as 0..19) can, have complex structure
>>> the way that values 24->27 do?
> 
>> No, the general syntax of heads does apply to the unallocated code
>> points as well.
> 
> I think we should state this.  It's a extension point that we can reliably skip.

Well, if we say how heads are decoded, that should be enough — we don’t have to restate that everywhere they are used.  But maybe I don’t understand where you see the extension point here.

Grüße, Carsten