Re: [Json] RFC 8785 - JSON Canonicalization Scheme

John Cowan <cowan@ccil.org> Mon, 06 July 2020 03:04 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 0CC3C3A0E11 for <json@ietfa.amsl.com>; Sun, 5 Jul 2020 20:04:59 -0700 (PDT)
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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham 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 iWqaN94-4X2F for <json@ietfa.amsl.com>; Sun, 5 Jul 2020 20:04:51 -0700 (PDT)
Received: from mail-qv1-xf32.google.com (mail-qv1-xf32.google.com [IPv6:2607:f8b0:4864:20::f32]) (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 765593A0E0D for <json@ietf.org>; Sun, 5 Jul 2020 20:04:50 -0700 (PDT)
Received: by mail-qv1-xf32.google.com with SMTP id t7so16592189qvl.8 for <json@ietf.org>; Sun, 05 Jul 2020 20:04:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=lKVPgutc7LNrQM5W45n+PUqtDC5PGQyxx7znNHijqkE=; b=qCqX/VclzGeVGazcit08X9pX+7+iql5Vz5reiamWYhHYqcmwEb6A4azCiP433kP12h 91feiw33ZpMUSRWJymPE3zc7DGqTKDKH8bzRziRiMItFsNrwYH12lLdSPKKt4v5ATCNS BJJ7U0FXq6wdgmFm6gyQdzCDvLkpYwMNZxn9hLf7FKWGrHfeZ+9/ybuLnC/qnG7gWJHA Cb2A+qfWmsKtR+ctM3oG5VbzQI8OIA3kRVH/uRI95W0srQc3T2wqmCt+qIPkHx4bAuYN XjpTD12pZ5IiPlHVVQfOJ62ZAh3noRFK94cAqKynv9ZQTH1YvNuts21EfiHdPuAqdrCz R1tA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lKVPgutc7LNrQM5W45n+PUqtDC5PGQyxx7znNHijqkE=; b=e6kWvpmGCNrj4ZEANPoWp0HBpCaQ6f0UtW+HIqcX9sVcYGQItiv7gGQ5RazzdMOzgY EYWeXx0JAhZyNCiySmqU+/DufrIsQ1Znw5kSQ2FyfNsrJ3lSFOxzXJGTlsDYXNdQOKW2 A3tsoP3npG+qMqYBaN90k+87vdsJ9TEz4iFAkZpVrEf/cPLQc5iCc0utEeC3zrdMKana wFkjVEn3RObdSeVFEegW83LTX35E1HdrXRwTS8r6r1dQQXfuPIr1zDasuEf289mCRfhm 7g8zyU0Lvacubp3X7ya4Z8OLMWRfwiV+x8rt5I1BvzlsMo1KHJVQ0p4gFoYK9BTbaTJM woXg==
X-Gm-Message-State: AOAM532Tmg6RibhwdMneBgD/H3ZIwf6B6c9YypN0ixX22Bu9QqFohawh RjMojCTXFgPqFTjdpszLXZs7p7E9JlVtNmz3StU51A==
X-Google-Smtp-Source: ABdhPJwV6JiLzTpV1fa9iwRhOaeIT3/2xiDzQ6nBQo6ew/PRA8Po0GaROCi8gJ8vge4v9lKvl9piITje8aixf0kYnxk=
X-Received: by 2002:a0c:b2d1:: with SMTP id d17mr35067054qvf.100.1594004689946; Sun, 05 Jul 2020 20:04:49 -0700 (PDT)
MIME-Version: 1.0
References: <ce98d1e6-1f39-84ca-b9b0-d11b0aa3c2f7@gmail.com> <715bce33-a744-5a97-8c6b-c7d2b27510f2@gmail.com> <CAJK=1Rje7POnLVrUxPFAkAb5h8atP3n25GYyGdWob3wZRWH20g@mail.gmail.com>
In-Reply-To: <CAJK=1Rje7POnLVrUxPFAkAb5h8atP3n25GYyGdWob3wZRWH20g@mail.gmail.com>
From: John Cowan <cowan@ccil.org>
Date: Sun, 5 Jul 2020 23:04:38 -0400
Message-ID: <CAD2gp_RV0ipzKp7pCqpwvsDPdenje9V3j5SVNJrHVoh65sbhFg@mail.gmail.com>
To: Ulysse Carion <ulysse@segment.com>
Cc: Anders Rundgren <anders.rundgren.net@gmail.com>, "json@ietf.org" <json@ietf.org>
Content-Type: multipart/alternative; boundary="00000000000050a48b05a9bd23ab"
Archived-At: <https://mailarchive.ietf.org/arch/msg/json/ao5xG_-C7zDmTIGjzOOSUKIe9Os>
Subject: Re: [Json] RFC 8785 - JSON Canonicalization Scheme
X-BeenThere: json@ietf.org
X-Mailman-Version: 2.1.29
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: Mon, 06 Jul 2020 03:05:00 -0000

We need to catch and reject unpaired surrogates because all the world isn't
Java, JavaScript, and C#.  Languages that deal in UTF-8 literally have no
way to represent unpaired surrogates, and shouldn't have to do something
horribly wrong to handle them.

On Sun, Jul 5, 2020 at 9:11 PM Ulysse Carion <ulysse@segment.com> wrote:

> Hi Anders,
>
> Nice job with JCS. I've taken a stab at implementing it here (in
> Golang), because I have a possible use for something like this, and
> your Golang reference implementation wasn't super usable as-is:
>
> https://github.com/ucarion/jcs
>
> Overall, I think this document makes sense, and -- given its
> prerequisites -- is the design any one of us would have landed on
> given time to meditate on the details. I usually specifically avoid
> embedding signatures within the data being signed, but when that's not
> an option JCS seems a quite reasonable choice.
>
> Two notes on what you could do to help future implementers:
>
> 1. I wish you could provide some sort of script that generates
> floating-point test-cases, instead of having folks download a 3.8G
> file if they want to make sure they're correctly aping JavaScript's
> float-to-string algorithm.
>
> 2. I don't understand why implementations MUST detect and error on
> invalid surrogate pairs. For implementations that aren't implementing
> their own JSON parser at the same time, doing so may not always be
> possible. Can you elaborate on the reasoning, and maybe offer
> implementers guidance on the relevant parts of the Unicode spec? A
> prospective implementer already needs to go pretty deep into the hairy
> details of floating-point numbers and character encoding, and a bit of
> guidance in the developer portal would go a long way.
>
> These are just details. Overall, I think JCS is quite nicely done.
> Thanks for making this.
>
> Best,
> Ulysse
>
>
> On Sat, Jul 4, 2020 at 11:27 AM Anders Rundgren
> <anders.rundgren.net@gmail.com> wrote:
> >
> > https://www.rfc-editor.org/rfc/rfc8785
> >
> > In case you would like to test what you can do with JSON
> canonicalization, there are two public Web applications at your disposal:
> > Using JWS: https://mobilepki.org/jws-jcs
> > Using an "unwrapped" JWS called Java Signature Format (JSF):
> https://mobilepki.org/jsf-lab
> >
> > A real-world implementation from OWASP using JSF:
> https://cyclonedx.org/use-cases/#authenticity
> >
> > In Saturn JSF is not only a security solution, it is also used for
> counter-signatures to simplify state-holding in payment systems:
> > https://cyberphone.github.io/doc/saturn/hybrid-payment.html#6
> >
> > By securely embedding related messages in each other (aka "Russian
> doll"), there is no need for external references to previous messages.
> >
> > Enjoy!
> >
> > Anders
> >
> > _______________________________________________
> > json mailing list
> > json@ietf.org
> > https://www.ietf.org/mailman/listinfo/json
>
> _______________________________________________
> json mailing list
> json@ietf.org
> https://www.ietf.org/mailman/listinfo/json
>