Subject: [Cbor] [Technical Errata Reported] RFC8610 (6543)

From: RFC Errata System <[email-masked]>
Date: Tue, 13 Apr 2021 17:13:22 -0700 (PDT)

The following errata report has been submitted for RFC8610,
"Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures".

--------------------------------------
You may review the report below and at:
https://www.rfc-editor.org/errata/eid6543

--------------------------------------
Type: Technical
Reported by: Sean Bartell <[email-masked]>

Section: B

Original Text
-------------
     bytes = [bsqual] %x27 *BCHAR %x27
     BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF

Corrected Text
--------------
     bytes = %x27 *BCHAR %x27
           / bsqual %x27 *QCHAR %x27
     BCHAR = %x20-26 / %x28-5B / %x5D-10FFFD / SESC / CRLF
     QCHAR = DIGIT / ALPHA / "+" / "/" / "-" / "_" / "=" / WS

Notes
-----
Section 3.1 states that comments are allowed in prefixed byte strings. This correction explicitly uses WS (which includes comments) in the rule for prefixed byte strings. Although the original ABNF would allow *most* comments, it would prohibit comments including a single quote, or comments with a backslash at the end of the line.

My correction allows prefixed byte strings to use every hex and base64 character. Alternatively, the ABNF could be narrowed down using separate rules for hex and base64, or it could be broadened to allow other characters. The ultimate effect would be the same regardless.

Note that both the original and corrected ABNF allow CRLF in unprefixed bytestrings.

(Note: Unlike my previous two errata, which affected unprefixed byte strings, this one affects prefixed byte strings.)

Instructions:
-------------
This erratum is currently posted as "Reported". If necessary, please
use "Reply All" to discuss whether it should be verified or
rejected. When a decision is reached, the verifying party  
can log in to change the status and edit the report, if necessary. 

--------------------------------------
RFC8610 (draft-ietf-cbor-cddl-08)
--------------------------------------
Title               : Concise Data Definition Language (CDDL): A Notational Convention to Express Concise Binary Object Representation (CBOR) and JSON Data Structures
Publication Date    : June 2019
Author(s)           : H. Birkholz, C. Vigano, C. Bormann
Category            : PROPOSED STANDARD
Source              : Concise Binary Object Representation Maintenance and Extensions
Area                : Applications and Real-Time
Stream              : IETF
Verifying Party     : IESG

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 14 Apr 2021 15:14:19 +0200

Hi Sean,

Thank you for submitting this report.

I don’t think bare single quotes are meant to be allowed in (comments in) qualified (h or b64 prefixed) byte string literals in CDDL.  The text doesn’t really say, and the grammar isn’t favorable.

The problem with “fixing” this ABNF to allow that is that it would typically be implemented as a two-level (three-level?) grammar, first processing the string syntax (e.g., handling the \’ processing) and then applying the WS syntax (e.g., comments) for the bsqual cases, and then the b64/b16 decoding.
But the other implementation approach, handling everything at the first level, is also valid.
This will make it require extra effort to get interoperability out of embedded single quotes.

I think most CDDL specification writers will survive without single quotes in comments in qualified byte string literals, at least until we review and update this specification.
Details like this generally need some WG time to resolve.

I put some text about the two open errata reports into draft-bormann-cbor-cddl-freezer, which is a list of items to consider during the next review and update of RFC 8610; will post the updated I-D SOON.

Grüße, Carsten

> On 2021-04-14, at 02:13, RFC Errata System <[email-masked]> wrote:
> 
> _______________________________________________
> CBOR mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/cbor

---

From: Carsten Bormann <[email-masked]>
Date: Wed, 14 Apr 2021 18:59:35 +0200

> On 2021-04-14, at 15:14, Carsten Bormann <[email-masked]> wrote:
> 
> SOON

https://www.ietf.org/archive/id/draft-bormann-cbor-cddl-freezer-06.html#name-clarifications

Grüße, Carsten