[jose] Fwd: Michael Jones 19725 NE 61st Pl, Redmond, WA 98053 425-985-8916 tomorrow (Tuesday) at 5:30am the ...

Michael Jones <michael_b_jones@hotmail.com> Tue, 16 October 2018 04:30 UTC

Return-Path: <michael_b_jones@hotmail.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 A5F19128D0C for <jose@ietfa.amsl.com>; Mon, 15 Oct 2018 21:30:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.125
X-Spam-Level:
X-Spam-Status: No, score=-1.125 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FORGED_HOTMAIL_RCVD2=0.874, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=hotmail.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 wNoDPgRN_gpA for <jose@ietfa.amsl.com>; Mon, 15 Oct 2018 21:30:21 -0700 (PDT)
Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-oln040092002068.outbound.protection.outlook.com [40.92.2.68]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 24F781292AD for <jose@ietf.org>; Mon, 15 Oct 2018 21:30:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=dsXjq+Z4LSqit3qJCzG4lIb4i70tHLU33QVba2yymNY=; b=NQbtd8CRkFVm/xx8V6dajJc+AqKwQCNITzu7YL9C2C6Ab0HTPsLktFQOHHmEyI1RLAbrHBT6seTxSjylZi5VKEPjvm5j3J6VQE2xRS4ZKN43D4pgauJwKy1W4K2gdUPZUwVC8llkyYxzKP8WJX3ZUz4sWEFrngopcB59/0gYw2Rl+tMu1H8dNlzGhNCasUemk+/rLLecWsM8qEQzj6uHTZqhWnb46Lpvz18h7hQYlPc7iMNF+XIgE4xEoUmaSXWNLS/pgQbacFHlOfEFpsfC4gTB6lGmWmRdqeDS7X5SHi1/EvODMU9kAsNTzrlvftWwlhjzt/F6/HvR3FbaTAnNPg==
Received: from BY2NAM01FT030.eop-nam01.prod.protection.outlook.com (10.152.68.59) by BY2NAM01HT074.eop-nam01.prod.protection.outlook.com (10.152.68.249) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.12; Tue, 16 Oct 2018 04:30:19 +0000
Received: from BL0PR02MB4276.namprd02.prod.outlook.com (10.152.68.55) by BY2NAM01FT030.mail.protection.outlook.com (10.152.69.205) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1250.12 via Frontend Transport; Tue, 16 Oct 2018 04:30:19 +0000
Received: from BL0PR02MB4276.namprd02.prod.outlook.com ([fe80::4588:c4c7:8cbe:d7ed]) by BL0PR02MB4276.namprd02.prod.outlook.com ([fe80::4588:c4c7:8cbe:d7ed%5]) with mapi id 15.20.1228.020; Tue, 16 Oct 2018 04:30:19 +0000
From: Michael Jones <michael_b_jones@hotmail.com>
To: Anders Rundgren <anders.rundgren.net@gmail.com>
CC: "jose@ietf.org" <jose@ietf.org>, Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com>, Carsten Bormann <cabo@tzi.org>, Phil Hunt <phil.hunt@oracle.com>, "Manger, James" <James.H.Manger@team.telstra.com>
Thread-Topic: Michael Jones 19725 NE 61st Pl, Redmond, WA 98053 425-985-8916 tomorrow (Tuesday) at 5:30am the ...
Thread-Index: AQHUZQjxlpru6vIJ8E+rn7q+hqRbEw==
Date: Tue, 16 Oct 2018 04:30:18 +0000
Message-ID: <BL0PR02MB4276166633D32020763F97C4B7FE0@BL0PR02MB4276.namprd02.prod.outlook.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-incomingtopheadermarker: OriginalChecksum:AAED4EC9E1433B08867328D7DD59251177F1CF71CEB61017D063107A26FFC319; UpperCasedChecksum:476EBA0A07B35B235A1374C156C8CD71E1B49697CF22A4E242125CF97567B1AA; SizeAsReceived:7486; Count:45
x-ms-exchange-messagesentrepresentingtype: 1
x-tmn: [e7fOgLP5Jt2kFbEWx84qLguH5W+8jg55AV1Gs3r+3TI=]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; BY2NAM01HT074; 6:Yt84uDEt92+lOtvx+Q8pplf70cV5iLrkEhjFaJrVSPl9NNd/MV6aU/nywCWgVqx67L7nnNaonlgPR9IjC14axTlm507GWs6s1jIRX/IXB7ZlIHLlSXT8OQF+LCBoNVBqJQuWL7hZ/8QM7KJgmzWD+6q8CRgy/6gj5EOuMuasTcTyWOtgDyG0iYqgWKexMJgIDQMVCqSXiwhM2DFFP+8kT8IUpbXzrY+SysHhWplnIe2V2F+tOCuDMlCLRhOoYX7ZPB7hsFmQUvD6MXZlK/gaJHQDzncC0rcd29+PbRnNUEb0psne24y/cd1xew6j0Zl9dLQbD8hcH0VnLemQsfZUIkh/CHGJ3Icxa8LxM2slH9WL2HTxwTVG5J6pt6BhAsfpM+KvF+DaP7xn/pw82ceYBzNQBbXg1bSUerrHqAqdO66aThO1spB84VNdFs2tZcbUqDhHsdCJlN4wrOBULKU1Mg==; 5:P9J44Kml7ru0D7hWintCJcdjMH6yTHIfAIY5RyKgDlTmoBUAahsWDvsQhAWCF4ZfhrNukIIxBoDE18HIEvaJG627skmw44tgEavt1Hg+5B8rLKQvVvRvdYcQI0OK3d3hQnrcUh7oM2/aNHJZuK1dYHUW+mf0UvdPihbOfLd8Wec=; 7:K9fs/N+d0xmHhz87WHTHBsC4BSn7jKVnaMmb2FfmXF2EtvjXT27AU4SxWXYIkjcBH4J41exIPqKiY5ZWJsBB27G03oxLisJgb8Z87GgCtTa6FhYZrOJGAdDGCjtlGEouxBT68RdFKcTO4IE8Fqlb9vRc4q7BptU6EvPn21hYvxmLIWtUE2Vk94IhckUwONmhjvzg/Rd/YRiceaB8VNgWxtRkXGQ/5WGu4RXHz+geazZy9D9M1SOX96UTxuGFjQNu
x-incomingheadercount: 45
x-eopattributedmessage: 0
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(201702061078)(5061506573)(5061507331)(1603103135)(2017031320274)(2017031324274)(2017031323274)(2017031322404)(1603101475)(1601125500)(1701031045); SRVR:BY2NAM01HT074;
x-ms-traffictypediagnostic: BY2NAM01HT074:
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(4566010)(82015058); SRVR:BY2NAM01HT074; BCL:0; PCL:0; RULEID:; SRVR:BY2NAM01HT074;
x-microsoft-antispam-message-info: O/8QhG69HRJlnTDKolQQzwQbdBWQiqXOdE8Xjiu84fpB+BEPKaqU7JVoLl0MewoA
Content-Type: multipart/alternative; boundary="_000_BL0PR02MB4276166633D32020763F97C4B7FE0BL0PR02MB4276namp_"
MIME-Version: 1.0
X-OriginatorOrg: hotmail.com
X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8
X-MS-Exchange-CrossTenant-Network-Message-Id: 83b16a27-e85c-459a-5f0a-08d633201438
X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: dd759f05-a917-4aa0-a2f5-4cc35c50e0c8
X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2018 04:30:18.9671 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Internet
X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2NAM01HT074
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/Jma4px7ECSCUMEuGR7e8DFCeM1s>
Subject: [jose] Fwd: Michael Jones 19725 NE 61st Pl, Redmond, WA 98053 425-985-8916 tomorrow (Tuesday) at 5:30am the ...
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.29
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: <https://mailarchive.ietf.org/arch/browse/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, 16 Oct 2018 04:30:24 -0000




Sent via the Samsung Galaxy S8, an AT&T 4G LTE smartphone



-------- Original message --------
From: Bret Jordan <jordan.ietf@gmail.com>
Date: 10/13/18 6:32 AM (GMT+09:00)
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Cc: Carsten Bormann <cabo@tzi.org>rg>, "Manger, James" <James.H.Manger@team.telstra.com>om>, Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com>om>, jose@ietf.org, Phil Hunt <phil.hunt@oracle.com>
Subject: Re: [jose] Canonical JSON form

-------- Original message --------
From: Bret Jordan <jordan.ietf@gmail.com>
Date: 10/13/18 6:32 AM (GMT+09:00)
To: Anders Rundgren <anders.rundgren.net@gmail.com>
Cc: Carsten Bormann <cabo@tzi.org>rg>, "Manger, James" <James.H.Manger@team.telstra.com>om>, Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com>om>, jose@ietf.org, Phil Hunt <phil.hunt@oracle.com>
Subject: Re: [jose] Canonical JSON form

Anders,

How do we move forward?  What can we do to make this happen?


Thanks,
Bret
PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
"Without cryptography vihv vivc ce xhrnrw, however, the only thing that can not be unscrambled is an egg."

On Oct 12, 2018, at 10:47 AM, Anders Rundgren <anders.rundgren.net@gmail.com<mailto:anders.rundgren.net@gmail.com>> wrote:

On 2018-10-12 17:20, Bret Jordan wrote:
Please correct me if I am wrong…. The way I understand the problem is as follows:

Hi Bret,
Comments in line...
1) If you verified the JSON string at consumption time, before it has been unmarshal-ed, then all you need to do is decide how to handle white space and carriage returns.  You could basically regex remove all white space and CR / CRLF and have a workable solution.

It depends on what your goal is.  Canonicalization builds on the assumption that there is a unique representation of the data, preferably even after it has passed through a processor like an intermediary.

2) Where this breaks down is, when a tool unmarshals the data into a map or struct, then you have no guarantee that you would recreate the keys in the same order (a struct may force it to the order of the struct definition). So you have no way of being able to verify the hash after it has been unmarshal-ed.  Further, if you recreate the JSON and send it back out, the next person that gets the data might have a hash that can not be verified in option 1 above.

Right, therefore option 1 is not very useful.  Sorting of keys is the cure for this issue.


3) Another problem once you have unmarshal-ed the data is what do you do with JSON numbers.

Right, but even string data needs adjustments.  "\u0020" and " " both represents a space character.


Some programming languages store them as a float, some as who-knows-what.  So you would need a way to ensure that the number was always stored in the same way, especially for strongly typed systems (is this architecture dependent too?). So the options here are, if the ontology / semantics of the JSON data were well defined in schema (a meaning it was standardized and documented), then the code could know what it should do and interoperability tests could be made to ensure that it worked.

This is (IMO) the only part of the puzzle that is non-trivial.  In my take on the matter, I have "prescribed" that the JSON Number type must be coerced into an IEEE 754 double precision number and be serialized according to ECMAScript V6+ rules.

If your application needs higher precision or bigger range, you are forced using the quoted string notation which (AFAIK...) is used by every IETF standard of any significance to date defining a JSON structure.


What am I not understanding here?  And what am I missing?


As I wrote earlier, there are (at least) two entirely different and documented approaches.

Using a schema based canonicalizer as you mention is also an option but that is a much more ambitious project.

Regards,
Anders


Thanks,
Bret
PGP Fingerprint: 63B4 FC53 680A 6B7D 1447  F2C0 74F8 ACAE 7415 0050
"Without cryptography vihv vivc ce xhrnrw, however, the only thing that can not be unscrambled is an egg."
On Oct 12, 2018, at 12:38 AM, Anders Rundgren <anders.rundgren.net@gmail.com<mailto:anders.rundgren.net@gmail.com> <mailto:anders.rundgren.net@gmail.com>> wrote:

On 2018-10-11 22:05, Bret Jordan wrote:
Anders,
I really like what you have done with this.  I am trying to figure out if it will work 100% for my needs, or if it will need some tweaking.  If it does work, then I think we should really try and figure out how we get your work standardized.

Thanx Bret!

The https://tools.ietf.org/html/draft-erdtman-jose-cleartext-jws-01 I-D provides quite a lot of features including an extension option that can be used for adding possibly missing functionality.

There is one thing that is good to know for anyone thinking about standardizing Canonical JSON and that's the fact that canonicalization also can be performed on the text level as described by: https://gibson042.github.io/canonicaljson-spec/

This has the advantage that it is very simple and supports the entire JSON RFC without restrictions.


So why didn't I took this [superficially obvious] route? There are several reasons for that:

A downside of source level canonicalization is that it doesn't integrate with JSON parsers and serializers. https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-01 was explicitly designed to eventually be an option of a standard JSON serializer as it already is in my Java reference implementation.

Another issue is that it is unclear what the value is with using the JSON "Number" format outside of the IEEE range.  In fact, it excludes parsers like JavaScript's JSON.parse() unless JavaScaript would be updated to always use a "BigNumber" as fundamental numeric type.

Regards,
Anders