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

Ned Freed <ned.freed@mrochek.com> Sat, 11 March 2017 15:48 UTC

Return-Path: <ned.freed@mrochek.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 D87D9129507; Sat, 11 Mar 2017 07:48:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.003
X-Spam-Level:
X-Spam-Status: No, score=-0.003 tagged_above=-999 required=5 tests=[RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-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 WI45xcIi5XbC; Sat, 11 Mar 2017 07:48:46 -0800 (PST)
Received: from mauve.mrochek.com (mauve.mrochek.com [68.183.62.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D4F9912941D; Sat, 11 Mar 2017 07:48:46 -0800 (PST)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QBU8WKPNWW00OVR5@mauve.mrochek.com>; Sat, 11 Mar 2017 07:43:42 -0800 (PST)
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=us-ascii; format=flowed
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01QBQBR8XOKG0003XB@mauve.mrochek.com>; Sat, 11 Mar 2017 07:43:41 -0800 (PST)
Message-id: <01QBU8WJOCUO0003XB@mauve.mrochek.com>
Date: Sat, 11 Mar 2017 07:41:17 -0800 (PST)
From: Ned Freed <ned.freed@mrochek.com>
In-reply-to: "Your message dated Sat, 11 Mar 2017 07:12:45 +0100" <bed0e331-f5fb-f24d-6207-f5a36ec9e7be@gmx.de>
References: <20170308014823.GF30306@kduck.kaduk.org> <382aa5c8-c977-b24d-4d19-251257833b00@gmx.de> <456b4234-0d94-1033-507c-710878bb5159@gmx.de> <20170309055348.GL30306@kduck.kaduk.org> <CAD2gp_TOxcZJxwPoMhq-xp6M+Yq+tQnMUv81YNFp-ydRMpH=5w@mail.gmail.com> <bed0e331-f5fb-f24d-6207-f5a36ec9e7be@gmx.de>
To: Julian Reschke <julian.reschke@gmx.de>
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/fj8hYdDe0DTfKg4nfsaG2LpYjAc>
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: Sat, 11 Mar 2017 15:48:50 -0000

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

				Ned