Re: [jose] #26: Allow for signature payload to not be base64 encoded
Mike Jones <Michael.Jones@microsoft.com> Thu, 27 June 2013 16:49 UTC
Return-Path: <Michael.Jones@microsoft.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 0CBFF21F9DD4 for <jose@ietfa.amsl.com>; Thu, 27 Jun 2013 09:49:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.299
X-Spam-Level:
X-Spam-Status: No, score=-2.299 tagged_above=-999 required=5 tests=[AWL=1.300, BAYES_00=-2.599, RCVD_IN_DNSWL_LOW=-1]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id saMMvT3zjdGs for <jose@ietfa.amsl.com>; Thu, 27 Jun 2013 09:49:20 -0700 (PDT)
Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2lp0241.outbound.protection.outlook.com [207.46.163.241]) by ietfa.amsl.com (Postfix) with ESMTP id 7A81021F8793 for <jose@ietf.org>; Thu, 27 Jun 2013 09:49:20 -0700 (PDT)
Received: from BY2FFO11FD012.protection.gbl (10.1.15.204) by BY2FFO11HUB017.protection.gbl (10.1.14.91) with Microsoft SMTP Server (TLS) id 15.0.707.0; Thu, 27 Jun 2013 16:49:19 +0000
Received: from TK5EX14HUBC102.redmond.corp.microsoft.com (131.107.125.37) by BY2FFO11FD012.mail.protection.outlook.com (10.1.14.130) with Microsoft SMTP Server (TLS) id 15.0.707.0 via Frontend Transport; Thu, 27 Jun 2013 16:49:19 +0000
Received: from TK5EX14MBXC283.redmond.corp.microsoft.com ([169.254.2.25]) by TK5EX14HUBC102.redmond.corp.microsoft.com ([157.54.7.154]) with mapi id 14.03.0136.001; Thu, 27 Jun 2013 16:49:13 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Jim Schaad <ietf@augustcellars.com>, 'n-sakimura' <n-sakimura@nri.co.jp>
Thread-Topic: [jose] #26: Allow for signature payload to not be base64 encoded
Thread-Index: AQHOcgNOsVoAPXc/s02k5Wh9HChUEZlIUkQAgACNH4CAAObIgIAAAUow
Date: Thu, 27 Jun 2013 16:49:12 +0000
Message-ID: <4E1F6AAD24975D4BA5B1680429673943678A0114@TK5EX14MBXC283.redmond.corp.microsoft.com>
References: <061.c2fcfec0a75d48eb8b194991ce56157e@trac.tools.ietf.org> <076.3f5d1244c042cd87bfb07814924fcbc9@trac.tools.ietf.org> <033a01ce729b$26bc3910$7434ab30$@augustcellars.com> <51CBA981.4050006@nri.co.jp> <048f01ce7355$19f05bc0$4dd11340$@augustcellars.com>
In-Reply-To: <048f01ce7355$19f05bc0$4dd11340$@augustcellars.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.36]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(199002)(189002)(51704005)(13464003)(50084003)(374574003)(377454003)(365934002)(20776003)(47776003)(33656001)(51856001)(76786001)(81542001)(53806001)(76796001)(44976004)(50466002)(31966008)(77096001)(79102001)(47446002)(76482001)(56776001)(46102001)(16406001)(59766001)(54316002)(74366001)(6806003)(81342001)(77982001)(54356001)(56816003)(74502001)(65816001)(47736001)(63696002)(74662001)(50986001)(23676002)(4396001)(49866001)(74706001)(66066001)(74876001)(69226001)(55846006)(47976001)(80022001); DIR:OUT; SFP:; SCL:1; SRVR:BY2FFO11HUB017; H:TK5EX14HUBC102.redmond.corp.microsoft.com; CLIP:131.107.125.37; RD:InfoDomainNonexistent; A:1; MX:1; LANG:en;
X-OriginatorOrg: microsoft.onmicrosoft.com
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 08902E536D
Cc: "jose@ietf.org" <jose@ietf.org>, "draft-ietf-jose-json-web-signature@tools.ietf.org" <draft-ietf-jose-json-web-signature@tools.ietf.org>
Subject: Re: [jose] #26: Allow for signature payload to not be base64 encoded
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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, 27 Jun 2013 16:49:34 -0000
Jim, you wrote "If I am not transporting the base64url encoded content, because it is not in the "payload" field, then why should I need to base64 encode it just to validate the signature. This is the alto case." So am I correct then, in thinking that your motivation for #26 is actually #25 - Detached content for the ALTO use case? As John and Nat had written, this could be handled by the specs as they are today by signing a hash of the detached content and including a compact JWS representing that signature as an x-alto-signature header. That doesn't require changing the signature calculation. -- Mike -----Original Message----- From: Jim Schaad [mailto:ietf@augustcellars.com] Sent: Thursday, June 27, 2013 9:41 AM To: 'n-sakimura' Cc: draft-ietf-jose-json-web-signature@tools.ietf.org; Mike Jones; jose@ietf.org Subject: RE: [jose] #26: Allow for signature payload to not be base64 encoded Nat, The only thing that can be signed or encrypted is an octet string. (A slight over generalization. GOST for example hashes an integer, tree hashes can do strange things but a sufficiently true statement for our purposes.) A that being said - yes case 1 would be something you can do. Case #2 would not be something that you can do because it is not an octet string. If you are looking at JavaScript, in order to hash something as an octet string it can be one of three things. A UInt8Array, an Int8Array and, due to convention, a string where the top byte of all of the code points in the string is zero. We currently don't have an efficient way to encode the Uint8Array case, although that might not be true if we are looking at new ECMA specifications which apparently are adding more defined types and serialization methods for those types. > -----Original Message----- > From: n-sakimura [mailto:n-sakimura@nri.co.jp] > Sent: Wednesday, June 26, 2013 7:55 PM > To: Jim Schaad > Cc: draft-ietf-jose-json-web-signature@tools.ietf.org; > michael.jones@microsoft.com; jose@ietf.org > Subject: Re: [jose] #26: Allow for signature payload to not be base64 > encoded > > Let me understand the problem. > > Are you suggesting that we should be able to do something like: > > Case 1: > > {"protected":<integrity-protected shared header contents>", > "unprotected":<non-integrity-protected shared header contents>", > "payload":"this is a multi\nline text payload of which a line > can be very very very long and wrapped during transmission. " > "signatures":[ > {"header":"<per-signature unprotected header 1 contents>", > "signature":"<signature 1 contents>"}, > ... > {"header":"<per-signature unprotected header N contents>", > "signature":"<signature N contents>"}], > } > > or even > > Case 2: > > {"protected":<integrity-protected shared header contents>", > "unprotected":<non-integrity-protected shared header contents>", > "payload":{ > "this":"is a json", > "payload":"which is not base64url encoded" > } > "signatures":[ > {"header":"<per-signature unprotected header 1 contents>", > "signature":"<signature 1 contents>"}, > ... > {"header":"<per-signature unprotected header N contents>", > "signature":"<signature N contents>"}], > } > > Then, I am worried about allowing them because in general we would not > know what would a transmission mechanism and user agents (including > text > editors) would do to them, like Mike mentioned. I do not think we > should assume the property of the transmission mechanism in JOSE level. > Assuming that would cause brittleness in the implementations. > > For detached signature, I do not understand why you would want non- > base64url encoded payload. The application should define how to hash > the octet stream that it wants to calculate signature over it, and we > can just include the base64url encoded hash in the "payload". > Why would you like to do other encoding for the hash? If I am not transporting the base64url encoded content, because it is not in the "payload" field, then why should I need to base64 encode it just to validate the signature. This is the alto case. Jim > > -- > Nat Sakimura (n-sakimura@nri.co.jp) > Nomura Research Institute > > PLEASE READ: > The information contained in this e-mail is confidential and intended > for the named recipient(s) only. > If you are not an intended recipient of this e-mail, you are hereby > notified that any review, dissemination, distribution or duplication > of this message is strictly prohibited. If you have received this > message in error, please notify the sender immediately and delete your copy from your system.
- [jose] #26: Allow for signature payload to not be… jose issue tracker
- Re: [jose] #26: Allow for signature payload to no… jose issue tracker
- Re: [jose] #26: Allow for signature payload to no… Jim Schaad
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… John Bradley
- Re: [jose] #26: Allow for signature payload to no… n-sakimura
- Re: [jose] #26: Allow for signature payload to no… Jim Schaad
- Re: [jose] #26: Allow for signature payload to no… Jim Schaad
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… Jim Schaad
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… Dick Hardt
- Re: [jose] #26: Allow for signature payload to no… Edmund Jay
- Re: [jose] #26: Allow for signature payload to no… Matias Woloski
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Dick Hardt
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Dick Hardt
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Dick Hardt
- Re: [jose] #26: Allow for signature payload to no… Richard Barnes
- Re: [jose] #26: Allow for signature payload to no… Dick Hardt
- Re: [jose] #26: Allow for signature payload to no… John Bradley
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… Mike Jones
- Re: [jose] #26: Allow for signature payload to no… Manger, James H
- Re: [jose] #26: Allow for signature payload to no… jose issue tracker