[dispatch] PING2. Re: JSON Canonicalization Standard

Anders Rundgren <anders.rundgren.net@gmail.com> Wed, 05 September 2018 05:31 UTC

Return-Path: <anders.rundgren.net@gmail.com>
X-Original-To: dispatch@ietfa.amsl.com
Delivered-To: dispatch@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 18671130DF7 for <dispatch@ietfa.amsl.com>; Tue, 4 Sep 2018 22:31:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2
X-Spam-Level:
X-Spam-Status: No, score=-2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 MK7TZids1PSc for <dispatch@ietfa.amsl.com>; Tue, 4 Sep 2018 22:31:36 -0700 (PDT)
Received: from mail-wm0-x22a.google.com (mail-wm0-x22a.google.com [IPv6:2a00:1450:400c:c09::22a]) (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 9A0AB1277D2 for <dispatch@ietf.org>; Tue, 4 Sep 2018 22:31:36 -0700 (PDT)
Received: by mail-wm0-x22a.google.com with SMTP id o18-v6so6343616wmc.0 for <dispatch@ietf.org>; Tue, 04 Sep 2018 22:31:36 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=DuZ4uXvTxH8/KuHlA+ZKBXOCoZNkURrWfhAGMx4Uly8=; b=Z8KWEMy5ycCfEuzkFgBMh6KAV31nA5cKquxuqkEJ4s2eGDo+tvwQE8qoWY3pbeYZWC poY9YD8URFeObtpxDUoK+6wyoJ1MmcKhsrHcngwV0t16rrw3o0gNosEnN8RB6Y90DpDS Z1z3bLoaApf4RIIFGzxBzt+8Kur5fTm4hrOjRCDa+kgsipGjnaS2+l2FEChc8/9XkLQY 0/K21UMiZ4aG7a50rsB+QXFA7LpWRsyQz96XBJYPRXREAF+9hDju48RDGSDi45WJmGhd hRI6ubHASNGcmVBefpsJXEhMoQw7NWiuzwxGvBo0v0zDv51NvVu96QcKPE5VW+tlamOg SbdQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=DuZ4uXvTxH8/KuHlA+ZKBXOCoZNkURrWfhAGMx4Uly8=; b=k8ce3YwTyrjwgW4XekGAhS3enHOwxvjU6NVs6a9pV/vdxU4j/humQYewTtQdNlu9HK g3GIsVoeJEPg4skWZH5mrYCQu0nCoTkO87SsZ/yne4vwUsefNgnNwg4e59PKmnI9Duhb H4GcTRiqDuqtV4S959SVqrXk5M2eYPVNFRNPhAmcIBTYq6Sr9tuKE0nSBN3Sso9hftGV eXFy/DG69Xj3w63GJCf8GaZkGqax0NooA+DxH3vSYQX7qwgDKHfzot4MwZvKPJYEz66Z 9jeK94PRufDhz8MufNwefdNEHcJdVyWkGwmrZ8E7JcYw8gQ04XsE6JUWUTI2NSPOjHPA 6zkA==
X-Gm-Message-State: APzg51BDikimbp/U8BEz05xuH2g3hXgEVrwPZsruAK/VXEE/IPSNVDLc winiBt559yXzMXX5QiHvl4w=
X-Google-Smtp-Source: ANB0VdYSMae/VuMQZj5mTOCEGFpQbR1cJ3l5mbqffH2bDiH4GWihkHjPvlS8HIeVdcmWW2soT97bpA==
X-Received: by 2002:a1c:a401:: with SMTP id n1-v6mr4727452wme.125.1536125495081; Tue, 04 Sep 2018 22:31:35 -0700 (PDT)
Received: from [192.168.1.79] (25.131.146.77.rev.sfr.net. [77.146.131.25]) by smtp.googlemail.com with ESMTPSA id q3-v6sm1379611wma.45.2018.09.04.22.31.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 22:31:34 -0700 (PDT)
From: Anders Rundgren <anders.rundgren.net@gmail.com>
To: dispatch@ietf.org
Cc: Eric Rescorla <ekr@rtfm.com>, Ben Campbell <ben@nostrum.com>
References: <4fea5830-dd5a-1709-f0d6-c8af28a78f94@gmail.com>
Message-ID: <a51e4821-e022-d366-07ab-dab1c024961f@gmail.com>
Date: Wed, 5 Sep 2018 07:31:30 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1
MIME-Version: 1.0
In-Reply-To: <4fea5830-dd5a-1709-f0d6-c8af28a78f94@gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/dispatch/1N_dK1dvL6a26HjUg1b8Z4OFdEk>
Subject: [dispatch] PING2. Re: JSON Canonicalization Standard
X-BeenThere: dispatch@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DISPATCH Working Group Mail List <dispatch.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/dispatch>, <mailto:dispatch-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/dispatch/>
List-Post: <mailto:dispatch@ietf.org>
List-Help: <mailto:dispatch-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/dispatch>, <mailto:dispatch-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 05 Sep 2018 05:31:39 -0000

Apparently my message was too complex and required the reader to follow links so here is short version:

Assume that you have a JSON object like:
  {
    "statement": "Hello signed world!",
    "otherProperties": [2e+3, true]
  }


Signing using JOSE/JWS you would get:
eyJhbGciOiJIUzI1NiIsImtpZCI6Im15a2V5In0.eyJvdGhlclByb3BlcnRpZXMiOlsyMDAwLHRydWVdLCJzdG
F0ZW1lbnQiOiJIZWxsbyBzaWduZWQgd29ybGQhIn0.FcE8h0GXJaOZ4Th3fNDBgcBE5HfEplOnS8GGtoSLU1K

That is, something entirely different.


Using unmodified JOSE/JWS + JCS (the specification I'm talking about) you would rather get:
  {
    "statement": "Hello signed world!",
    "otherProperties": [2e+3, true],
    "signature": "eyJhbGciOiJIUzI1NiIsImtpZCI6Im15a2V5In0..5HfEplOnS8GGtoSLU1KFcE8h0GXJaOZ4Th3fNDBgcBE"
  }


JCS is quite similar to its XML counterpart, albeit much simpler. Signed XML data never needed to be Base64 encoded.

Anders
I-D: https://tools.ietf.org/html/draft-rundgren-json-canonicalization-scheme-01
More on the JWS+JCS combo: https://github.com/cyberphone/jws-jcs#combining-detached-jws-with-jcs-json-canonicalization-scheme
On-line testing: https://mobilepki.org/jws-jcs/home