Re: [Json] secdir review of draft-ietf-jsonbis-rfc7159bis-03

Elwyn Davies <elwynd@dial.pipex.com> Sun, 12 March 2017 23:38 UTC

Return-Path: <elwynd@dial.pipex.com>
X-Original-To: json@ietfa.amsl.com
Delivered-To: json@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id F131F129413; Sun, 12 Mar 2017 16:38:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.934
X-Spam-Level:
X-Spam-Status: No, score=-1.934 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_SOFTFAIL=0.665] autolearn=no 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 o2ACz6TGtvvs; Sun, 12 Mar 2017 16:38:09 -0700 (PDT)
Received: from b-painless.mh.aa.net.uk (b-painless.mh.aa.net.uk [81.187.30.52]) (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 426C812940C; Sun, 12 Mar 2017 16:38:09 -0700 (PDT)
Received: from f.6.d.d.7.f.3.e.8.2.f.e.4.f.0.3.1.0.0.0.f.b.0.0.0.b.8.0.1.0.0.2.ip6.arpa ([2001:8b0:bf:1:30f4:ef28:e3f7:dd6f]) by b-painless.mh.aa.net.uk with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <elwynd@dial.pipex.com>) id 1cnCae-0007SI-2h; Sun, 12 Mar 2017 23:07:52 +0000
Date: Sun, 12 Mar 2017 23:07:40 +0000
Message-ID: <otwresf20y4vnpmoboqqjnux.1489359742487@email.android.com>
Importance: normal
From: Elwyn Davies <elwynd@dial.pipex.com>
To: Peter Cordell <petejson@codalogic.com>, Ned Freed <ned.freed@mrochek.com>, Julian Reschke <julian.reschke@gmx.de>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="--_com.samsung.android.email_4565109410242090"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/F0SqG4RYYj833cnTGswXJfC4qRY>
Cc: draft-ietf-jsonbis-rfc7159bis.all@ietf.org, John Cowan <cowan@ccil.org>, ietf@ietf.org, secdir@ietf.org, "json@ietf.org" <json@ietf.org>, Benjamin Kaduk <kaduk@mit.edu>
Subject: Re: [Json] secdir review of draft-ietf-jsonbis-rfc7159bis-03
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: "JavaScript Object Notation \(JSON\) WG mailing list" <json.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/json>, <mailto:json-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/json/>
List-Post: <mailto:json@ietf.org>
List-Help: <mailto:json-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/json>, <mailto:json-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 12 Mar 2017 23:38:12 -0000

(with half a Gen-art hat on...)
Does the WG really want to revisit the anguished discussions that resulted in the changes to Section 8.1 of draft-ietf-json-rfc4627bis between versions 07 and 08 back in late November 2013?
See https://www.ietf.org/mail-archive/web/json/current/msg02053.html and many, many messages beore this.
Cheers,Elwyn


Sent from Samsung tablet.
-------- Original message --------From: Peter Cordell <petejson@codalogic.com>; Date: 12/03/2017  09:06  (GMT+00:00) To: Ned Freed <ned.freed@mrochek.com>;, Julian Reschke <julian.reschke@gmx.de>; Cc: draft-ietf-jsonbis-rfc7159bis.all@ietf.org, John Cowan <cowan@ccil.org>;, ietf@ietf.org, secdir@ietf.org, json@ietf.org, Benjamin Kaduk <kaduk@mit.edu>; Subject: Re: [Json] secdir review of draft-ietf-jsonbis-rfc7159bis-03 
On 11/03/2017 15:41, Ned Freed wrote:
>> On 2017-03-11 03:08, John Cowan wrote:
>> >
>> > On Thu, Mar 9, 2017 at 12:53 AM, Benjamin Kaduk <kaduk@mit.edu
>> > <mailto:kaduk@mit.edu>> wrote:
>> >
>> >     If that's what's supposed to happen, it should probably be more
>> >     clear, yes.  (But aren't there texts that have valid
>> interpretations
>> >     in multiple encodings?)
>> >
>> >
>> > Not if the content is well-formed JSON and the only possible encodings
>> > are UTF-8, UTF-16, and UTF-32.  It suffices to examine the first four
>> > bytes of the input.  If there are no NUL bytes in the first four bytes,
>> > it is UTF-8; if there are two NUL bytes, it is UTF-16; if there are
>> > three NUL bytes, it is UTF-32.  This works because the grammar requires
>> > the first character to be in the ASCII repertoire, and the NUL
>> > *character* (U+0000) is not allowed at all.
>
>> Good explanation. Maybe the spec should include it.
>
> +1
>
> This exact issue just came up in a media type review, where someone
> specified a charset parameter because they weren't aware of this algorithm.
>
> It would be very helpful to have this text in the RFC.


Although it does need slightly more detail to take into account 
endian-ness in the case of UTF-16 and -32.

The XML spec may offer some example text:

https://www.w3.org/TR/2008/REC-xml-20081126/#sec-guessing

Pete Cordell
Codalogic Ltd
Read & write XML in C++, http://www.xml2cpp.com