Re: [Cbor] Do we care about array-tags issue 6, clamped-uint8 arrays?

Carsten Bormann <cabo@tzi.org> Fri, 26 July 2019 02:06 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 7DDD412025D for <cbor@ietfa.amsl.com>; Thu, 25 Jul 2019 19:06:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.198
X-Spam-Level:
X-Spam-Status: No, score=-4.198 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_NONE=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 w1Fu8mlO2OXx for <cbor@ietfa.amsl.com>; Thu, 25 Jul 2019 19:06:34 -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 205C2120256 for <cbor@ietf.org>; Thu, 25 Jul 2019 19:06:34 -0700 (PDT)
Received: from client-0001.vpn.uni-bremen.de (client-0001.vpn.uni-bremen.de [134.102.107.1]) (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 45vsrm1Fj4z10D5; Fri, 26 Jul 2019 04:06:32 +0200 (CEST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CANh-dX===wNGksTGUEjireODnQHPmUJQUJ7XJh+U-4bGGjErfg@mail.gmail.com>
Date: Thu, 25 Jul 2019 22:06:30 -0400
Cc: Sean Leonard <dev+ietf@seantek.com>, cbor@ietf.org
X-Mao-Original-Outgoing-Id: 585799588.995239-7b597da1af8679cd0c42664a2d6d95b0
Content-Transfer-Encoding: quoted-printable
Message-Id: <9F8F7DEB-54B1-4114-B211-9D8A1A685523@tzi.org>
References: <CANh-dXkkSJUOcHcBj1JRO20ULFVNNbu1GQU-j7bR7N-FCTt3HA@mail.gmail.com> <24038E27-C30B-47F4-91E8-68C02FCAE26D@tzi.org> <CANh-dXm0TLShk_9DT9fKq0CR4yJMr6=zntWL8fW2tB99o0Et3Q@mail.gmail.com> <3246C0B0-C5BF-4AC8-B99F-D9A44B780A2C@seantek.com> <DECE061A-328D-4B1B-BEB5-D73F5779B554@tzi.org> <1C432DAE-ABAA-4E02-84FB-57109563A86F@seantek.com> <CANh-dX===wNGksTGUEjireODnQHPmUJQUJ7XJh+U-4bGGjErfg@mail.gmail.com>
To: Jeffrey Yasskin <jyasskin@google.com>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/z3Ez6sw5ELx2t2JxoYS9sbHC9A0>
Subject: Re: [Cbor] Do we care about array-tags issue 6, clamped-uint8 arrays?
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: Fri, 26 Jul 2019 02:06:36 -0000

On Jul 25, 2019, at 16:36, Jeffrey Yasskin <jyasskin@google.com> wrote:
> 
> I remain
> uncomfortable with having a serialization format describe behaviors
> that the data had or should have when it was or is loaded into a
> program.

I don’t know how to avoid that.  If the input is an array, in most generic decoders I get an array to work from.  If the input is instead a map, I get a map (or a JavaScript object); that has quite different behavior.  So the supplier of the input already has a lot of control over the data structures that are input to my system.  Uint8ClampedArray just adds a slight twist to that as it might look too much like a Uint8Array.
None of this relieves an application of validating its input — with a standard serialization format and a robust generic decoder, this can now simply be done on a higher level.

Grüße, Carsten