Re: [Cbor] List of not-well-formed CBOR and test vectors

Laurence Lundblade <lgl@island-resort.com> Sat, 03 August 2019 16:54 UTC

Return-Path: <lgl@island-resort.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 50E2E12011A for <cbor@ietfa.amsl.com>; Sat, 3 Aug 2019 09:54:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=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 Gdf7nAohMtHH for <cbor@ietfa.amsl.com>; Sat, 3 Aug 2019 09:54:32 -0700 (PDT)
Received: from p3plsmtpa09-07.prod.phx3.secureserver.net (p3plsmtpa09-07.prod.phx3.secureserver.net [173.201.193.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 74F85120020 for <cbor@ietf.org>; Sat, 3 Aug 2019 09:54:32 -0700 (PDT)
Received: from [172.31.98.100] ([71.92.242.99]) by :SMTPAUTH: with ESMTPSA id txIdhgz8KfsR8txIdhIzTN; Sat, 03 Aug 2019 09:54:31 -0700
From: Laurence Lundblade <lgl@island-resort.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_2843802D-154C-4DB6-9E98-276C8AB491F6"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Sat, 3 Aug 2019 09:54:31 -0700
References: <CF3F871E-7489-4770-B2FE-1746C392ACF0@island-resort.com>
To: cbor@ietf.org
In-Reply-To: <CF3F871E-7489-4770-B2FE-1746C392ACF0@island-resort.com>
Message-Id: <985940F3-3C57-4A93-8568-C9B9CCE9A3FF@island-resort.com>
X-Mailer: Apple Mail (2.3445.9.1)
X-CMAE-Envelope: MS4wfDTS+IkOtm/b2NExYrjjmV/rfzcxVLwDt5lExPAmLMTOtXQmDtjBpB1Pdgu7benXBHga9nSWgkUezrcEMnqhTBj61+/GAPga8JmZYFtOJTlc6O9yIuT0 BBhXDwOCTu1lGYsMMmmaV+tVINgfiqunig30NJ7vC9wcp+h/0uDpR9eA
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/gBw00U6YvAEmsdsI9pc0suDQAqc>
Subject: Re: [Cbor] List of not-well-formed CBOR and test vectors
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, 03 Aug 2019 16:54:34 -0000

I’ve added:
    - The simple values 24-31, the ones marked as “reserved" in 7409 (I’d prefer to call them “permanently disallowed” or such)
    - Half-precision, float and short values that are missing some bytes

Will turn this in to an appendix for CBORbis in about a week. 

Thanks for any comments, additions, confirmations.

LL



> On Jul 29, 2019, at 11:49 AM, Laurence Lundblade <lgl@island-resort.com>; wrote:
> 
> I think I’ve made a comprehensive list of all things that are not well formed by going through the latest draft and my decoder. There are about a dozen of them. I’ve also created 110 test vectors that cover them pretty thoroughly. 
> 
> Everything is here <https://github.com/laurencelundblade/QCBOR/blob/not_well_formed/test/not_well_formed_cbor.h> in a C header. The dozen types of non-well-formedness are listed as comments in the header file. The test vectors are in an array that can be used for testing. It is BSD-3 license.
> 
> I’ve turned up one bug in the RFC’s pseudo code. It doesn’t catch an indefinite length string as a segment in another indefinite length string. 
> 
> I’d like to get some review, some folks to try it out and such to see if I’ve missed anything and all is right. When that is done I’ll make a pull request for the draft out it. Probably in about two weeks.
> 
> So please look it over and try it against your implementation.
> 
> LL
>