Re: [Cbor] Failure Testcases (was: RE: Simple Value Example)

Jeffrey Yasskin <jyasskin@chromium.org> Wed, 30 January 2019 21:05 UTC

Return-Path: <jyasskin@google.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 AE7B4131356 for <cbor@ietfa.amsl.com>; Wed, 30 Jan 2019 13:05:56 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.051
X-Spam-Level:
X-Spam-Status: No, score=-14.051 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-4.553, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_SPF_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=chromium.org
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 IDPKmCUGAPz9 for <cbor@ietfa.amsl.com>; Wed, 30 Jan 2019 13:05:53 -0800 (PST)
Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) (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 697F2131342 for <cbor@ietf.org>; Wed, 30 Jan 2019 13:05:53 -0800 (PST)
Received: by mail-wr1-x42f.google.com with SMTP id x10so990927wrs.8 for <cbor@ietf.org>; Wed, 30 Jan 2019 13:05:53 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lyvsTVCsfptSrZRvDmpQAOJr9epBifSbEIS2P7vntTE=; b=QvUsK17sOqSH5aaWrj841B11YZDtuYobjUX7P2vfb1BaIt737h7rQEf32byCIp+iPg PsF20oZ6NtvdlqIWhDt3d9S8bAU/uItjY/bpiv53SJ3LEGE3KSkoBkyFdjy+tzqSFyEw QNn7OTyDz40rALxu/lbp3IvRUz35sETZZlaZA=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lyvsTVCsfptSrZRvDmpQAOJr9epBifSbEIS2P7vntTE=; b=bN1DNniJi+sEHLy/fZLRmlFFBBesUjOA2bvY5lHlKmxRU8kErzxgzLTkIDrmi1pmY/ lln5/lecofwSgNGZp6lJC5fvqx8i0/gVi9r5x25fkKnBfNDqonEL58hejxo9+kr6dazL Of6DQHjj8pDJcXb+mfLu4uHIJxMPHeom6Z8CJqsFx3jdlfa1YySQuJa1DXJmvm621a59 reJ/c4NVFyKyJcWLVeTVMnYcu3Kf4NQjHLvxc4Dqg3N25wcf0bAMtQcziSP5oYG9zmuQ wcwqwZPBnwOsTBy1GgGB4igHrh8EWJ8+nj8PUKDXeUL+9+lZdGULSuMiXGHa3G1D2483 0PJQ==
X-Gm-Message-State: AHQUAubNElZ70gNwne5993JzPUcIdDycK9wl1yko8wP2VesETNQh8vyv mXk0iRGeuqjuOqb8f+eCXJP9msUr+fUIcJCE6Mir9dY9owBX4A==
X-Google-Smtp-Source: AHgI3IZhZh7vuS6elFASfJnSSglpm4twFuLutl7qkRlfNJNexDtCiwQTHWMJKZMS+Nj9flb/PgMvmdj6K8McTp2Bwtw=
X-Received: by 2002:adf:dc4e:: with SMTP id m14mr12097169wrj.107.1548882350932; Wed, 30 Jan 2019 13:05:50 -0800 (PST)
MIME-Version: 1.0
References: <3da886c762564d20a75796733ec73e23@pdv-FS.de>
In-Reply-To: <3da886c762564d20a75796733ec73e23@pdv-FS.de>
From: Jeffrey Yasskin <jyasskin@chromium.org>
Date: Wed, 30 Jan 2019 13:05:36 -0800
Message-ID: <CANh-dXnPhoaOePAzuy-mCnQk9ydMFYAjooX9fX4j03O_vz5hpA@mail.gmail.com>
To: "Richter, Jörg" <Joerg.Richter@pdv-fs.de>
Cc: Carsten Bormann <cabo@tzi.org>, "cbor@ietf.org" <cbor@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000054084e0580b34667"
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/PHL-my98Q8sIg3SMcfpEM1AoCdo>
Subject: Re: [Cbor] Failure Testcases (was: RE: Simple Value Example)
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, 30 Jan 2019 21:06:01 -0000

On Wed, Jan 30, 2019 at 4:55 AM Richter, Jörg <Joerg.Richter@pdv-fs.de>
wrote:

> Another set of test cases can be constructed when using tags.  But I think
> this is more involved and not clearly defined.  But I might be wrong.
> Consider for example a bigfloat. Is it allowed that the array elements
> themselves
> are using a tag?
>
> Or what if a tag is followed by an element that is not allowed for this
> tag.
> Like following a tag for a set (tag=258) with a string instead of an
> array?  Should this
> cause a decode error?
>

<https://github.com/cbor-wg/CBORbis/pull/18>
https://github.com/cbor-wg/CBORbis/pull/18 tries to specify which contents
for tags are valid, and https://github.com/cbor-wg/CBORbis/pull/17 says
that generic decoders don't necessarily reject invalid-but-well-formed data.

Or is it allowed that Tag 55799 (0xd9d9f7) is the only content of a CBOR
> file?
>

No, because any well-formed tag contains another CBOR item.

Jeffrey