Re: [jose] Canonical JSON form

Phil Hunt <phil.hunt@oracle.com> Thu, 11 October 2018 18:23 UTC

Return-Path: <phil.hunt@oracle.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 508FA1200D7 for <jose@ietfa.amsl.com>; Thu, 11 Oct 2018 11:23:12 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.31
X-Spam-Level:
X-Spam-Status: No, score=-2.31 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, HTTPS_HTTP_MISMATCH=1.989, RCVD_IN_DNSWL_MED=-2.3, 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=oracle.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 NI78MRpaFNZk for <jose@ietfa.amsl.com>; Thu, 11 Oct 2018 11:23:08 -0700 (PDT)
Received: from userp2120.oracle.com (userp2120.oracle.com [156.151.31.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id A8311130ECF for <jose@ietf.org>; Thu, 11 Oct 2018 11:23:08 -0700 (PDT)
Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9BIITUa190909; Thu, 11 Oct 2018 18:23:06 GMT
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : message-id : content-type : mime-version : subject : date : in-reply-to : cc : to : references; s=corp-2018-07-02; bh=yTQfQIiY7jeGplpCwMeLg1/lYpjFr4ETP3VZ6i1agJM=; b=ULz86inHvfJURRQQKvrityEKCMrM8bF0u0LWGFKERNJhIsI/PkJT+U4nn1gZpZb/YzgK YA/G8EGE5LWHtB7uzBa7uS0sbpqzKIDYh1BqYsOHdnWH6P1Cg/agd6dIkN7iRPqF626N sHP8aYzxhdFIlZrxMCGgAkMPACLa2TgnWBVYxhyf36FsY6s5MMPemhe2FkfxWDjBGizQ pg6EkyApXYb5CiiVHseNAOdEMDBK8B/uQ9g+5LAEXStLuorLArO9iKVYx+Tf244RKP1c saahy2gABDA8RMaIiz4xqrG47+DS3vY8zF3A9UyOMECPLU5N6aXNxO/YpKTHVnrRurlr xg==
Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2120.oracle.com with ESMTP id 2mxnpre2kj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 18:23:06 +0000
Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9BIN5wM003877 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 11 Oct 2018 18:23:05 GMT
Received: from abhmp0007.oracle.com (abhmp0007.oracle.com [141.146.116.13]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9BIN4G5032343; Thu, 11 Oct 2018 18:23:04 GMT
Received: from [10.0.1.37] (/24.86.190.97) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 11 Oct 2018 18:23:04 +0000
From: Phil Hunt <phil.hunt@oracle.com>
Message-Id: <073CB50F-8D91-4EF6-90BE-FC897D557AA6@oracle.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_88EA06CB-34F5-4C31-B63B-8CE68E11F254"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
Date: Thu, 11 Oct 2018 11:23:02 -0700
In-Reply-To: <CAHbuEH5oH-Km6uAjrSr0pEHswFBLuDpfVweQ+gpj472yk+8iTQ@mail.gmail.com>
Cc: Bret Jordan <jordan.ietf@gmail.com>, "Manger, James" <James.H.Manger@team.telstra.com>, jose@ietf.org
To: Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com>
References: <12DD2F97-80C3-4606-9C6B-03F7A4BF19DE@gmail.com> <CAOASepNX4aYVmPWXyODn0E2Om_rimACPECqJBvZSOXVVd_p8LA@mail.gmail.com> <D21F3A95-0085-4DB7-A882-3496CC091B34@gmail.com> <CAOASepM=hB_k7Syqw4+b7L2vd6E_J0DSAAW0mHYdLExBZ6VBuw@mail.gmail.com> <00ad01d460f4$69ae8a00$3d0b9e00$@augustcellars.com> <8436AEE7-B25A-4538-B8F6-16D558D9A504@gmail.com> <MEAPR01MB35428606C09BF315DE04CC79E5E10@MEAPR01MB3542.ausprd01.prod.outlook.com> <CAHbuEH6DCD7Zc+PK3TnCBkKv1esnROwyCcDb8ZR+TKwgQQ+yXQ@mail.gmail.com> <0E6BD488-74D5-4640-BC31-5E45B0531AFC@gmail.com> <CAHbuEH5oH-Km6uAjrSr0pEHswFBLuDpfVweQ+gpj472yk+8iTQ@mail.gmail.com>
X-Mailer: Apple Mail (2.3445.9.1)
X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9042 signatures=668706
X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810110173
Archived-At: <https://mailarchive.ietf.org/arch/msg/jose/fGiwBNBo8Hj67vm1OmgN_axI30w>
Subject: Re: [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: Thu, 11 Oct 2018 18:23:12 -0000

I am not sure of the value of canonicalization.  I prefer bytestream encoding style where the original content goes with the signature.

Another example is ATLAS which signs encoded http requests.

Some JSON formats will have the same issues that XMLDSIG had.  For example, SCIM supports multiple ways to identfiy attributes much like XML (it uses IANA registered schemas). You can reference an attribute with the full path or just its name.  We tried to avoid schemas, but localized extensibility and easy of coding forced us to do this.  So for SCIM it is easier to canonicalize than XML, but I would not say simple.  

In the end, I felt it was a good trade-off because of an assumption to sign encoded json data instead.

Note:  SCIM does not yet have a signed format. I anticipate however the development of signed SCIM events per the new SET spec.

If you were to proceed, I would recommend including considerations identifying JSON formats not well suited to canonicalization.

Phil

Oracle Corporation, Identity Cloud Services Architect
@independentid
www.independentid.com <http://www.independentid.com/>phil.hunt@oracle.com <mailto:phil.hunt@oracle.com>

> On Oct 11, 2018, at 11:06 AM, Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com> wrote:
> 
> Hi Bret,
> 
> JOSE is closed, so a new WG would have to be formed if this were to be done in a WG.  That might be reopening JOSE or something else.  Another possibility is for James to try to progress his existing draft and determine interest.  Has it been presented at SecDispatch yet to gauge interest and uncover problems?
> 
> You could also consider alternate solutions.  The problems cited were problems with XML already.  Since RID defined the same capability, you could test out interoperability using RID in XML more extensively as you'd be mapping the same functionality into JSON.  This would give you in your new effort feedback into design considerations and help you determine if you really want to go this route or perhaps some other solution may be preferred (see Neil's message).  In any case, more work should be done before a new WG around canonicalization is performed IMO, but I am also no longer an AD, so advice from current ones may vary :-)
> 
> Best,
> Kathleen
> 
> On Thu, Oct 11, 2018 at 1:24 PM Bret Jordan <jordan.ietf@gmail.com <mailto:jordan.ietf@gmail.com>> wrote:
> Kathleen,
> 
> From your comments I take it is okay then to do a draft proposal in another WG and then have this mailing list review it?  Would we then restart JOSE if the draft was good to have it standardized in JOSE or just some other WG?  
> 
> I just want to be sensitive to the work that has already been done and build on it.  I also do not want to do things that are “bad form”.  We are all in this boat together, and I just want to work with everyone to row in the same direction.
> 
> BTW, I have spoken with a few other vendors and service providers and they are also very interested in this work as it would solve a lot of problems they have or are seeing. 
> 
> 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 10, 2018, at 7:47 PM, Kathleen Moriarty <kathleen.moriarty.ietf@gmail.com <mailto:kathleen.moriarty.ietf@gmail.com>> wrote:
>> 
>> Bret,
>> 
>> You could define it within a draft in a different working group other than JOSE and ask for reviewers from JOSE to review and comment to catch problems.  Although already described above, there are issues with this and JSON, which is why the WG didn't want to do canonicalization.
>> 
>> I'm assuming you want to do basically what was done for RID in XML using JSON.  You may want to look at the set of possibilities to replicate as they are all likely needed with what you are trying to do or just as part of your gap analysis.
>> 
>> https://tools.ietf.org/html/rfc6545#section-9.1 <https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_rfc6545-23section-2D9.1&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=MMo12b48B6GqvKdy8eBzH6ZAMMue9XSrSjSfwjHnqkQ&s=22u9NErU0ozC5-MfcgjryGcdeGT_X5t9OCSSYtvY-a0&e=>
>> Also look at 9.3.1 and 9.3.2 as you're likely to also need multi-hop authentication too.
>> 
>> To David's point in the message that follows this (came in while typing), RID signed portions of the message to enable interoperability and you are likely to need to do very similar things that are described in RID related to the policy work I had previously mentioned for your gap analysis as being similar functionality.  If you haven't looked at that part of the document, I think it will be helpful.
>> 
>> Best regards,
>> Kathleen
>> 
>> 
>> 
>> On Wed, Oct 10, 2018 at 8:29 PM Manger, James <James.H.Manger@team.telstra.com <mailto:James.H.Manger@team.telstra.com>> wrote:
>> https://tools..ietf.org/html/draft-rundgren-json-canonicalization-scheme <https://urldefense.proofpoint.com/v2/url?u=https-3A__tools.ietf.org_html_draft-2Drundgren-2Djson-2Dcanonicalization-2Dscheme&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=MMo12b48B6GqvKdy8eBzH6ZAMMue9XSrSjSfwjHnqkQ&s=sZq9Tv1-r2RLEkVR50tXkMNdFi6nOmqWmEkuNbdTJio&e=>
>> is a decent attempt at JSON canonicalization (and an appendix lists a few other attempts).
>> 
>> This one sorts object members based on their UTF-16 encoding (without escapes), and assumes double precision floats is the model for numbers.
>> 
>>  
>> 
>> --
>> 
>> James Manger
>> 
>>  
>> 
>> From: jose [mailto:jose-bounces@ietf.org <mailto:jose-bounces@ietf.org>] On Behalf Of Bret Jordan
>> Sent: Thursday, 11 October 2018 11:02 AM
>> To: Jim Schaad <ietf@augustcellars.com <mailto:ietf@augustcellars.com>>
>> Cc: Nathaniel McCallum <npmccallum@redhat.com <mailto:npmccallum@redhat.com>>; jose@ietf.org <mailto:jose@ietf.org>
>> Subject: Re: [jose] Canonical JSON form
>> 
>>  
>> 
>> 
>> Other implementations say that you should preserver the order of the fields you read when serialized which is part of JSON for the browser implementations but not necessarily elsewhere.
>> 
>>  
>> 
>> Preserving order is hard.  Depending on your programming language you might be deserializing the content in to a struct or you may be using a map. 
>> 
>>  
>> 
>> What I need is a way for individuals and organizations to be able to pass around and share JSON data and collaboratively work on that JSON data and sign the parts that they have done. 
>> 
>>  
>> 
>>  
>> 
>>  
>> 
>> 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."
>> 
>>  
>> 
>>  
>> 
>> _______________________________________________
>> jose mailing list
>> jose@ietf.org <mailto:jose@ietf.org>
>> https://www.ietf.org/mailman/listinfo/jose <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_jose&d=DwMFaQ&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=MMo12b48B6GqvKdy8eBzH6ZAMMue9XSrSjSfwjHnqkQ&s=68ephlmudUEVF-9EE70huCbhCWZMtZFLhQwmunkXcbc&e=>
>> 
>> 
>> -- 
>> 
>> Best regards,
>> Kathleen
> 
> 
> 
> -- 
> 
> Best regards,
> Kathleen
> _______________________________________________
> jose mailing list
> jose@ietf.org <mailto:jose@ietf.org>
> https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_jose&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=MMo12b48B6GqvKdy8eBzH6ZAMMue9XSrSjSfwjHnqkQ&s=68ephlmudUEVF-9EE70huCbhCWZMtZFLhQwmunkXcbc&e= <https://urldefense.proofpoint.com/v2/url?u=https-3A__www.ietf.org_mailman_listinfo_jose&d=DwICAg&c=RoP1YumCXCgaWHvlZYR8PZh8Bv7qIrMUB65eapI_JnE&r=na5FVzBTWmanqWNy4DpctyXPpuYqPkAI1aLcLN4KZNA&m=MMo12b48B6GqvKdy8eBzH6ZAMMue9XSrSjSfwjHnqkQ&s=68ephlmudUEVF-9EE70huCbhCWZMtZFLhQwmunkXcbc&e=>