[jose] Other "Canonical JSON" efforts

Anders Rundgren <anders.rundgren.net@gmail.com> Sat, 07 September 2013 07:13 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id E798321F9F62 for <jose@ietfa.amsl.com>; Sat, 7 Sep 2013 00:13:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.432
X-Spam-Level:
X-Spam-Status: No, score=-2.432 tagged_above=-999 required=5 tests=[AWL=0.167, BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tl9H03hDUV9T for <jose@ietfa.amsl.com>; Sat, 7 Sep 2013 00:13:00 -0700 (PDT)
Received: from mail-la0-x230.google.com (mail-la0-x230.google.com [IPv6:2a00:1450:4010:c03::230]) by ietfa.amsl.com (Postfix) with ESMTP id 7DE3B21F9F5B for <jose@ietf.org>; Sat, 7 Sep 2013 00:13:00 -0700 (PDT)
Received: by mail-la0-f48.google.com with SMTP id er20so3450297lab.21 for <jose@ietf.org>; Sat, 07 Sep 2013 00:12:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=NKsc7WO9fZ+5HJZX66CExAiiZcMHmVfoYr8RBX3fdtQ=; b=tlriWxQx74TeVJRbeH4jMx4qs2dLtp9fMAaZoVluRD7Obg1jtQ1M9XBM8rVAM1QSQ9 B/MSBB+Iwm4r8rSb0+tgAovaoKVGRPHSa5luMpugjUnUtKARn9kBE2dFwWd6SKguShRe OgX6hX+sdCsPtgagiWgOB0T5Pvy7rRdWYCROcdCaG/b9iC0LsPdMyerqoK8QMR218CD3 /ZSnQD1gW2WAQJ/pwwT5Dyus0qV9WX+xTAeh8Q01C3KXSKUFdIualZ37tgDz77fSW1gn 68+P8C9MDAp5VURS7u5Y6gr34bvfyFrPYe/sklbmxrRi1Y5AqCAlohDAIjFbB8RHZXtY ZkKQ==
X-Received: by 10.112.149.197 with SMTP id uc5mr6138822lbb.19.1378537978770; Sat, 07 Sep 2013 00:12:58 -0700 (PDT)
Received: from [192.168.0.2] (37.250.35.171.bredband.tre.se. [37.250.35.171]) by mx.google.com with ESMTPSA id b6sm717465lae.0.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 07 Sep 2013 00:12:58 -0700 (PDT)
Message-ID: <522AD1EB.3080702@gmail.com>
Date: Sat, 07 Sep 2013 09:12:43 +0200
From: Anders Rundgren <anders.rundgren.net@gmail.com>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130801 Thunderbird/17.0.8
MIME-Version: 1.0
To: "jose@ietf.org" <jose@ietf.org>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 7bit
Cc: jhu@vmware.com, gstaykov@vmware.com
Subject: [jose] Other "Canonical JSON" efforts
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: Javascript Object Signing and Encryption <jose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/jose>, <mailto:jose-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/jose>
List-Post: <mailto:jose@ietf.org>
List-Help: <mailto:jose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/jose>, <mailto:jose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 07 Sep 2013 07:13:02 -0000

http://tools.ietf.org/html/draft-staykov-hu-json-canonical-form-00

The I-D doesn't mention the total mess regarding character escaping out in the wild which seems to be based on "this feels right" and "IE 7 doesn't like certain characters":
http://www.ietf.org/mail-archive/web/jose/current/msg03377.html
http://stackoverflow.com/questions/6011012/making-json-not-escape-forward-slashes

IMO it is better addressing canonicalization directly in JSON encoders and decoders by the use of a copy of the textual data for property values instead of relying on complex, slow and potentially brittle post-processing like most XML-based systems do.

To "straighten-up" the representation of floating-point numbers like described in the I-D would be awesome, but is in my take on the matter not an absolute necessity.

FWIW, V0.51 is almost there thanks to very useful feedback:
https://openkeystore.googlecode.com/svn/resources/trunk/docs/JSON-Clear-Text-Signature-Scheme.pdf

Anders