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

Laurence Lundblade <> Sat, 03 August 2019 16:54 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 50E2E12011A for <>; Sat, 3 Aug 2019 09:54:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.896
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 ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id Gdf7nAohMtHH for <>; Sat, 3 Aug 2019 09:54:32 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 74F85120020 for <>; Sat, 3 Aug 2019 09:54:32 -0700 (PDT)
Received: from [] ([]) by :SMTPAUTH: with ESMTPSA id txIdhgz8KfsR8txIdhIzTN; Sat, 03 Aug 2019 09:54:31 -0700
From: Laurence Lundblade <>
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: <>
In-Reply-To: <>
Message-Id: <>
X-Mailer: Apple Mail (2.3445.9.1)
X-CMAE-Envelope: MS4wfDTS+IkOtm/b2NExYrjjmV/rfzcxVLwDt5lExPAmLMTOtXQmDtjBpB1Pdgu7benXBHga9nSWgkUezrcEMnqhTBj61+/GAPga8JmZYFtOJTlc6O9yIuT0 BBhXDwOCTu1lGYsMMmmaV+tVINgfiqunig30NJ7vC9wcp+h/0uDpR9eA
Archived-At: <>
Subject: Re: [Cbor] List of not-well-formed CBOR and test vectors
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Concise Binary Object Representation \(CBOR\)" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-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.


> On Jul 29, 2019, at 11:49 AM, Laurence Lundblade <>; 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 <> 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