Re: [Cbor] Invalid Tag Values

Carsten Bormann <cabo@tzi.org> Thu, 24 June 2021 20:15 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 C56B63A29C7 for <cbor@ietfa.amsl.com>; Thu, 24 Jun 2021 13:15:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-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 9DUc3JCLh54D for <cbor@ietfa.amsl.com>; Thu, 24 Jun 2021 13:15:48 -0700 (PDT)
Received: from gabriel-2.zfn.uni-bremen.de (gabriel-2.zfn.uni-bremen.de [134.102.50.19]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3F8F53A29C8 for <cbor@ietf.org>; Thu, 24 Jun 2021 13:15:48 -0700 (PDT)
Received: from [192.168.217.118] (p548dcc89.dip0.t-ipconnect.de [84.141.204.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 4G9rwy1pk5z2xZG; Thu, 24 Jun 2021 22:15:46 +0200 (CEST)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <9bec699fcdc78de53f13e591ec139ff8@mothers-arms.co.uk>
Date: Thu, 24 Jun 2021 22:15:45 +0200
Cc: cbor@ietf.org
X-Mao-Original-Outgoing-Id: 646258545.590802-a5c3cd09b9bda28cfb4f62e34b9c4ded
Content-Transfer-Encoding: quoted-printable
Message-Id: <34EA7F4F-FC62-4175-A0C0-95AD37A85CCB@tzi.org>
References: <f5650d87a36b10f6b75d2a1123f84bb5@mothers-arms.co.uk> <C4A51BCF-D1C1-41D4-BF1B-47CB75EEFAFA@tzi.org> <9bec699fcdc78de53f13e591ec139ff8@mothers-arms.co.uk>
To: Kio Smallwood <kio@mothers-arms.co.uk>
X-Mailer: Apple Mail (2.3608.120.23.2.7)
Archived-At: <https://mailarchive.ietf.org/arch/msg/cbor/AW3doB5jaBhnFbyGomRyqdfjmv4>
Subject: Re: [Cbor] Invalid Tag Values
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: Thu, 24 Jun 2021 20:15:53 -0000

On 2021-06-24, at 22:11, Kio Smallwood <kio@mothers-arms.co.uk> wrote:
> 
> So if I follow the logic correctly, if my decoder encounters 0("1900-01-00T00:00;00") instead of raising an exception it could return
> 
> 65535({
>     "value": "1900-01-00T00:00;00", 
>     "_error":"invalid datetime string: '1900-01-00T00:00;00'",
>     "original_tag": 0
> })
> 
> to the application? We could then have a tag handler or schema verifier raise the error or just log it, but in this case the full CBOR stream would be decoded.

If you don’t have a way to funnel up an error indication completely separate from the tag system, this strikes me as the second best way to do it.

Grüße, Carsten