[jose] Canonical JSON form

Bret Jordan <jordan.ietf@gmail.com> Wed, 10 October 2018 19:04 UTC

Return-Path: <jordan.ietf@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 AC5C712426A for <jose@ietfa.amsl.com>; Wed, 10 Oct 2018 12:04:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.999
X-Spam-Level:
X-Spam-Status: No, score=-1.999 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, HTML_MESSAGE=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 S-Z1shfqYx3f for <jose@ietfa.amsl.com>; Wed, 10 Oct 2018 12:04:21 -0700 (PDT)
Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) (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 7257F124BE5 for <jose@ietf.org>; Wed, 10 Oct 2018 12:04:21 -0700 (PDT)
Received: by mail-yb1-xb30.google.com with SMTP id o8-v6so2636694ybk.13 for <jose@ietf.org>; Wed, 10 Oct 2018 12:04:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:mime-version:subject:message-id:date:to; bh=shn+XeK1Dd6WN8bY4YV7ghtxi7a5BA7h/dZKmgZUaXc=; b=QAqB2ZAlkaSgxvs6R4A8G8zvaAVXjFoQTWCuPqcZgfUQ9vJC3F2OV99Hflki37fByt T7uQTnLVgqwIuNzi+NhIFjsAlvjQfHDuhdpGmz6urXQrpaBhZev7/+xGcC3UJGgPt7p3 vWfm3MesgCkoGQxchxgRmQA5BRid9LujFPqrQqCQsqZbD39AwvVm4+zOu+ncnZN6mqSa 68a5c8xIqN3GuJexXQV1/0vS1rp0c8jfzB1f45EuaODYQ0dNFPK+lVaRmk9Z3RT1dJ9w vhwTziUB7AyJ30FDsHoIgilPXZ6ZC/daQ4Z213LKl2PVuSqU9IW4tPVCv0avZlnVj7AN JGxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:mime-version:subject:message-id:date:to; bh=shn+XeK1Dd6WN8bY4YV7ghtxi7a5BA7h/dZKmgZUaXc=; b=c8OpCTqMK6rJLz/pp3NvakrD/t/UUJ9txi26z8+qpcs9pB+nEIL8u+eRUJCBgTmXJ3 dgI0rtFnhqKUk16HOLoSJ85C8SAvIw2WUgSWjplVeYR+0RY2kkUJEcWG8PwzuvjMFxLV 2wRWoAi0mN1zSB/O4cIlA/CfoHdayYai4awYb3Jxk6WRPebsN36uVxLO5BIL4eJrHHDv DpjWH8tluk/WxUJEXd3s698aY0OhvHiIPBuJzScB8NbL/+7XSXFgXLmOuVogP6TZwx36 oGsk5nD/kZ+BaOjp02jxRjWAzosg7AmJV13wsgkxULO7GseAyB2bK573nN+QvFsF50BN o5Dg==
X-Gm-Message-State: ABuFfoiZ1ZNmN8BBW7xC+6q9qc3Ya/s5fgdqve4S71/mCY1hoJryjrkD MQiwKh9Pmi/oqtznCTYby6KlZaFd
X-Google-Smtp-Source: ACcGV62mtmnCAq76HuPvC1qGd2ZJpoGD/SaKZ0GodNVI6vSxY2XvtwtCR4O3okaCPIdgrlwHJq7jvQ==
X-Received: by 2002:a25:b28b:: with SMTP id k11-v6mr19485283ybj.118.1539198260277; Wed, 10 Oct 2018 12:04:20 -0700 (PDT)
Received: from ?IPv6:2605:a601:3260:266:11d5:fada:d8f3:ba5c? ([2605:a601:3260:266:11d5:fada:d8f3:ba5c]) by smtp.gmail.com with ESMTPSA id m82-v6sm4729238ywc.67.2018.10.10.12.04.18 for <jose@ietf.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Oct 2018 12:04:19 -0700 (PDT)
From: Bret Jordan <jordan.ietf@gmail.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_2B4A6474-6D1F-48BF-86AC-F5942F80AA87"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Message-Id: <12DD2F97-80C3-4606-9C6B-03F7A4BF19DE@gmail.com>
Date: Wed, 10 Oct 2018 13:03:41 -0600
To: jose@ietf.org
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/m-nGRjKGXe7eO0gnRrUVVoD-rlo>
Subject: [jose] Canonical JSON form
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: Wed, 10 Oct 2018 19:04:24 -0000

Dear WG,

I was reading through RFC 7515 to see if it would work for a project I am working on.  Basically the need to sign and resign a JSON object.  However, in RFC 7515 there does not seem to be any definition for serializing a canonical form of JSON. This means that two organizations that serialize it differently would produce two different signatures.

Super simple example

{ “type” : “house”, “size” : “1000 sq feet” }



Or 

{
  “type” : “house”, 
  “size” : “1000 sq feet”
}



Or

{“type”:“house”,“size”:“1000 sq feet”}



Or (tabs not spaces)

{
	“type” : “house”, 
	“size” : “1000 sq feet”
}


All four of these JSON structures would produce a different signature as defined by RFC 7515. What am I missing?


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."