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

John Cowan <cowan@ccil.org> Sat, 11 March 2017 02:09 UTC

Return-Path: <cowan@ccil.org>
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 272FB129527 for <json@ietfa.amsl.com>; Fri, 10 Mar 2017 18:09:05 -0800 (PST)
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, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, URIBL_BLOCKED=0.001] autolearn=unavailable autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=ccil-org.20150623.gappssmtp.com
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 DUMdhTxCBhN8 for <json@ietfa.amsl.com>; Fri, 10 Mar 2017 18:09:04 -0800 (PST)
Received: from mail-wr0-x22f.google.com (mail-wr0-x22f.google.com [IPv6:2a00:1450:400c:c0c::22f]) (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 D4B4B129534 for <json@ietf.org>; Fri, 10 Mar 2017 18:08:57 -0800 (PST)
Received: by mail-wr0-x22f.google.com with SMTP id u48so74787309wrc.0 for <json@ietf.org>; Fri, 10 Mar 2017 18:08:57 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=09DcN8lr70VIKGmVSwBDfg4zFIJpN6+l9pPEM7I/2II=; b=AaNY1fO0w02ZlBqNKKJXurf6/N9ERh4CY8zf52eHGWar/akzNoxnYnPA7EIQDAXKLg IY7xNJyuUiXbRWmg6ZyTI5Z3WBiCP73RP0UvVHZmTDHpZV5S8sN2XiAvZv+cy0CR8m8V 7ZVozdONfvTr4Pr+TPx61LWk3/LkImM4DsPNsm1luehm2yfJAKh7ANBN58oqfSEVSYgA e5gbkL7tGLN3sm5LCGcsBhb94P5xewC8dwm9ktsioxADkFdBzG7rCpY5ZGlSBY0f9y+j alMowvOhGnLFoP9v5v5GQP25GSF1YyyGJ/oHqjVl7dt6WGRxIYRJZkUB28917imtsaNb hVbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=09DcN8lr70VIKGmVSwBDfg4zFIJpN6+l9pPEM7I/2II=; b=C7Q1WRUwgMa/7m15jtu92u/NHP+/58w78OaKVSQ2pv9rqUb19r7ahOWILoi7mwiOWn p7pJRX3DtwDLAHJ7LZvk1nYzKXTeXx3GFeUhcguSJxlfmdQXQl/zTROUNjk8V9O7igsz 1rk4YM3MU2neeHRNEn1OKBz5Gow2n3dz+cvbvymEDyuLDOtEVoh3eCA/avGqu80o1fgX 7wDdzSWebKIe6zU/9J9T1LF3d7IyrISFqov1u3EawUBYHRmBdzXHpPKRpAbK0V5VmuuK KM8IMiHAxBq2/gI4BSe0uHB/Dfg9BBMuF8m9AiO+OGtmlzVgI1x/huAGIiwfmKuI4n+L 674w==
X-Gm-Message-State: AMke39m23ngfGZeOM3j+lHZ6tsjpLom07EoPIPuku71qDZUrmxSz5g5NVI3e0aYP/+xedjpkj9sOPXU7UeovKjXg
X-Received: by 10.223.152.215 with SMTP id w81mr20250782wrb.151.1489198136300; Fri, 10 Mar 2017 18:08:56 -0800 (PST)
MIME-Version: 1.0
Received: by 10.28.181.14 with HTTP; Fri, 10 Mar 2017 18:08:35 -0800 (PST)
In-Reply-To: <20170309055348.GL30306@kduck.kaduk.org>
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>
From: John Cowan <cowan@ccil.org>
Date: Fri, 10 Mar 2017 21:08:35 -0500
Message-ID: <CAD2gp_TOxcZJxwPoMhq-xp6M+Yq+tQnMUv81YNFp-ydRMpH=5w@mail.gmail.com>
To: Benjamin Kaduk <kaduk@mit.edu>
Content-Type: multipart/alternative; boundary="001a113c36a6ea2d48054a6af5a1"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/TVPt_6M3TXwzxa8HT-CFfphUGSU>
Cc: Julian Reschke <julian.reschke@gmx.de>, draft-ietf-jsonbis-rfc7159bis.all@ietf.org, secdir@ietf.org, ietf@ietf.org, "json@ietf.org" <json@ietf.org>
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 02:09:05 -0000

On Thu, Mar 9, 2017 at 12:53 AM, Benjamin Kaduk <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.

-- 
John Cowan          http://vrici.lojban.org/~cowan        cowan@ccil.org
I don't know half of you half as well as I should like, and I like less
than half of you half as well as you deserve.  --Bilbo