Re: [jose] The use of \/ in JOSE
"Manger, James H" <James.H.Manger@team.telstra.com> Tue, 03 September 2013 00:28 UTC
Return-Path: <James.H.Manger@team.telstra.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 4FD4A21F9E3A for <jose@ietfa.amsl.com>; Mon, 2 Sep 2013 17:28:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.659
X-Spam-Level:
X-Spam-Status: No, score=-1.659 tagged_above=-999 required=5 tests=[AWL=-0.758, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
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 n0KzIqI+eJLG for <jose@ietfa.amsl.com>; Mon, 2 Sep 2013 17:28:47 -0700 (PDT)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by ietfa.amsl.com (Postfix) with ESMTP id 074BC21F9E1E for <jose@ietf.org>; Mon, 2 Sep 2013 17:28:46 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.89,1010,1367935200"; d="scan'208";a="156593305"
Received: from unknown (HELO ipcavi.tcif.telstra.com.au) ([10.97.217.200]) by ipobvi.tcif.telstra.com.au with ESMTP; 03 Sep 2013 10:28:44 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7186"; a="212941450"
Received: from wsmsg3752.srv.dir.telstra.com ([172.49.40.173]) by ipcavi.tcif.telstra.com.au with ESMTP; 03 Sep 2013 10:28:44 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3752.srv.dir.telstra.com ([172.49.40.173]) with mapi; Tue, 3 Sep 2013 10:28:44 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Date: Tue, 03 Sep 2013 10:28:43 +1000
Thread-Topic: [jose] The use of \/ in JOSE
Thread-Index: Ac6n7NR+YCmDxKmySHm2bTPEW6wVPQARXgzw
Message-ID: <255B9BB34FB7D647A506DC292726F6E11530258A87@WSMSG3153V.srv.dir.telstra.com>
References: <52243734.8050802@gmail.com> <CAL02cgQqgjSJUpMJEB6k=g_mEju=56fUB6AHTCL2QDx7sEs=4g@mail.gmail.com> <5224A74E.1000400@gmail.com>
In-Reply-To: <5224A74E.1000400@gmail.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Cc: "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] The use of \/ in JOSE
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: Tue, 03 Sep 2013 00:28:52 -0000
>> Why would "/" be escaped? > Well, the example shows a JSON object and then it would be logical to > escape / since this is a part of the JSON "standard". You can escape / as \/ in JSON, but you don't have to. "/" and "\/" are both equally valid JSON strings representing the same 1-character logical value. Any JSON parser needs to support both. I believe the one useful use of \/ is to escape "</script>" as "<\/script>" when it appears as a JSON string in HTML so the HTML parser does not misinterpret it as the end of the script. In a canonical form of JSON one form needs to be chosen: "/" is the best choice; it is the choice of ECMAScript’s JSON.stringify. JOSE does not require a canonical form so "http://example.com" and "http:\/\/example.com" are both acceptable. I'm glad the former is chosen for the JOSE examples. > However, when looking further I note that JOSE requires some kind of > non-standard/additional JSON normalizing before applying base64url: > > http://tools.ietf.org/id/draft-ietf-jose-json-web-signature-14.html#rfc.section.5.3 No. The string comparison rules are just trying to be clear that JOSE implementations are expected to compare logical string values (not JSON serializations, which are not unique due to optional escape sequences) and are not expected to perform any Unicode normalization, such as NFC or NFKD. -- James Manger
- Re: [jose] The use of \/ in JOSE Richard Barnes
- [jose] The use of \/ in JOSE Anders Rundgren
- Re: [jose] The use of \/ in JOSE Anders Rundgren
- Re: [jose] The use of \/ in JOSE Manger, James H
- Re: [jose] The use of \/ in JOSE Tim Bray
- Re: [jose] The use of \/ in JOSE Breno de Medeiros
- Re: [jose] The use of \/ in JOSE Anders Rundgren