Subject: [Cbor] [Errata Held for Document Update] RFC8610 (6543)

From: RFC Errata System <[email-masked]>
Date: Fri, 23 Apr 2021 08:34:23 -0700 (PDT)

The following errata report has been held for document update 
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

--------------------------------------
Status: Held for Document Update
Type: Technical

Reported by: Sean Bartell <[email-masked]>
Date Reported: 2021-04-13
Held by: Francesca Palombini (IESG)

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
-----
As discussed during the CBOR interim 2021-04-21 and in the mailing list: https://mailarchive.ietf.org/arch/msg/cbor/ekFn8a4GbUQAk4nyhc-Il-ZRLZc/
--

The ABNF used in [RFC8610] for the content of byte string literals lumps together byte strings notated as text with byte strings notated in base16 (hex) or base64 (but see also updated BCHAR production above):

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

Errata report 6543 proposes to handle the two cases in separate productions (where, with an updated SESC, BCHAR obviously needs to be updated as above):

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

This potentially causes a subtle change, which is hidden in the WS production:

WS = SP / NL
SP = %x20
NL = COMMENT / CRLF
COMMENT = ";" *PCHAR CRLF
PCHAR = %x20-7E / %x80-10FFFD
CRLF = %x0A / %x0D.0A

This allows any non-C0 character in a comment, so this fragment becomes possible:

foo = h'
   43424F52 ; 'CBOR'
   0A       ; LF, but don't use CR!
'

The current text is not unambiguously saying whether the three apostrophes need to be escaped with a \ or not, as in:

foo = h'
   43424F52 ; \'CBOR\'
   0A       ; LF, but don\'t use CR!
'
... which would be supported by the existing ABNF in [RFC8610].

--------------------------------------
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