Re: [Cbor] Handling duplicate map keys

David Kemp <dk190a@gmail.com> Wed, 04 December 2019 23:21 UTC

Return-Path: <dk190a@gmail.com>
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 DCB4512003F for <cbor@ietfa.amsl.com>; Wed, 4 Dec 2019 15:21:54 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.997
X-Spam-Level:
X-Spam-Status: No, score=-1.997 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com
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 yKYpZ4rvDuge for <cbor@ietfa.amsl.com>; Wed, 4 Dec 2019 15:21:53 -0800 (PST)
Received: from mail-oi1-x22f.google.com (mail-oi1-x22f.google.com [IPv6:2607:f8b0:4864:20::22f]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id F3E9D12002F for <cbor@ietf.org>; Wed, 4 Dec 2019 15:21:52 -0800 (PST)
Received: by mail-oi1-x22f.google.com with SMTP id 6so940624oix.7 for <cbor@ietf.org>; Wed, 04 Dec 2019 15:21:52 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=pQ03mW1WtA2wHyBkzrLmc28//ye+rHilVtCwzxMoM3Y=; b=NUIupglNWXVIcf6xBrF0M5Fj03SgJnQ0p0CDbV5bTZEsePTC/PQNaoseciCAWk1C8V FNE8M8CgCAths3RhRNX8pegfZ+vPr/Ozk3k2YOEFTmFBJiS1P6Wkkn3HZecg87s0TZK2 fGPqlj+jCY1eyGJSZ2MHjSboYENq7OHJHJbKU6RUqtfUBrSVX0nf6zaK5/LyKCMnFzL+ i4P9kHIm1L6TAcBW9pHgl7Rc2Lk8Px08XHG039gsaWwnOBZk/8N7xq6oiXOsOM8NHffY dG1C4UYp0NVbywDmepck/C0gT2m5uHHDhZBeh/aKlt61JWQba8CqKe4lIGjYe8jQL+Tl e/Rg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pQ03mW1WtA2wHyBkzrLmc28//ye+rHilVtCwzxMoM3Y=; b=BQe+zaJBtXOSQqln4i8L4FNj+hcG2Itg0RV4xTU3qDYTBD7FTDwSxGIOGcqFHUkWVQ hr1LbIiOhGlTJMWEHoUAqoUdabQ/WvKnPvejehaFDk7bNRvF9h2M8QAlSplE+lWnXoWB JkCcISeL76qtFUEDEfhjjKxsOisG2TgD4IIeN9xHSY9d186bj9GVm+7hps66QGkzP0QM 5YLw5Iz4HXpIft85Du9S+7e5TW2N2K5bS/16EP/85wkeXf4CoP1/YQaU2lwO4r//lrFO 13vhvVsCLvO7fqwZ0XHFq59hTLFZBpnuBRBzybXdl7qcfmE5+LYtf4Y1vTQ7pa23xJpo XsTQ==
X-Gm-Message-State: APjAAAUEy1CxgXW521ozPEuAJL9GKsvPLieSKbVwcjLqYARd0OX8zUnp OL9tHJAnIIrYV4f7Vup8QfWstAFVBanZhlRHtzhoIubd
X-Google-Smtp-Source: APXvYqzOwl5H7yeApo3fzpNh2xG+yxci8PZTP4gDVy3vCe69q6vbRZYnL7SJPGOQb2Stl4u0rTXeErBBkkP1SlkJUVc=
X-Received: by 2002:aca:36c5:: with SMTP id d188mr5048993oia.54.1575501712077; Wed, 04 Dec 2019 15:21:52 -0800 (PST)
MIME-Version: 1.0
From: David Kemp <dk190a@gmail.com>
Date: Wed, 04 Dec 2019 18:19:15 -0500
Message-ID: <CAE5tNmo+qVsLWMCHuHn-NMVUUSZvv19JYdatZod_W5+ZR45=vQ@mail.gmail.com>
To: cbor@ietf.org
Content-Type: multipart/alternative; boundary="000000000000e437940598e913b0"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/-Jfyzf18tQqhlEyxepZ-z4lG6sI>
Subject: Re: [Cbor] Handling duplicate map keys
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: Wed, 04 Dec 2019 23:21:55 -0000

> Laurence Lundblade <lgl@island-resort.com> wrote:
>>  Michael Richardson <mcr+ietf@sandelman.ca> wrote:
>> I am less afraid to declare an answer and make some decoders
non-compliant.
>> I think that they will get fixed.
>
> I would hope fix them means that they will error out when a duplicate is
detected.
>
> It probably doesn’t cost any more than take first and is the more clear,
clean and
> secure thing to do IMO.
>
> Seems like it will be easier to get agreement on that behavior than take
first.
> Also, there will always be some implementations that error out. We can’t
get them all
> to do take first.
>
> LL

+1.

Section 3.7: "The resulting rule in the protocol should respect the CBOR
data model:
it cannot prescribe a specific handling of the entries with the identical
keys, except ... error."

This "should" is, logically speaking, a must, because the alternative is to
declare that CBOR
implementations that do not respect the CBOR data model (by silently
accepting invalid input)
are conforming.