Re: [jose] #26: Allow for signature payload to not be base64 encoded

n-sakimura <n-sakimura@nri.co.jp> Thu, 27 June 2013 02:55 UTC

Return-Path: <n-sakimura@nri.co.jp>
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 2B6EA11E8169 for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 19:55:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.09
X-Spam-Level:
X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_JP=1.244, HOST_EQ_JP=1.265]
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 QhfnOe8TrooI for <jose@ietfa.amsl.com>; Wed, 26 Jun 2013 19:55:13 -0700 (PDT)
Received: from nrifs02.index.or.jp (nrigw01.index.or.jp [133.250.250.1]) by ietfa.amsl.com (Postfix) with ESMTP id AD26011E80BA for <jose@ietf.org>; Wed, 26 Jun 2013 19:55:12 -0700 (PDT)
Received: from nriea02.index.or.jp (unknown [172.19.246.37]) by nrifs02.index.or.jp (Postfix) with SMTP id AE6E2196882; Thu, 27 Jun 2013 11:55:11 +0900 (JST)
Received: from nrims00a.nri.co.jp ([192.50.135.11]) by nriea02.index.or.jp (unknown) with ESMTP id r5R2tBfY019783; Thu, 27 Jun 2013 11:55:11 +0900
Received: from nrims00a.nri.co.jp (localhost.localdomain [127.0.0.1]) by nrims00a.nri.co.jp (Switch-3.3.3/Switch-3.3.3) with ESMTP id r5R2tBCO013313; Thu, 27 Jun 2013 11:55:11 +0900
Received: (from mailnull@localhost) by nrims00a.nri.co.jp (Switch-3.3.3/Switch-3.3.0/Submit) id r5R2tBhd013311; Thu, 27 Jun 2013 11:55:11 +0900
X-Authentication-Warning: nrims00a.nri.co.jp: mailnull set sender to n-sakimura@nri.co.jp using -f
Received: from nrizmf21b.index.or.jp ([172.100.25.20]) by nrims00a.nri.co.jp (Switch-3.3.3/Switch-3.3.3) with ESMTP id r5R2tB1i013305; Thu, 27 Jun 2013 11:55:11 +0900
Received: from 127.0.0.1 (127.0.0.1) by m-FILTER with ESMTP; Thu, 27 Jun 2013 11:55:11 +0900
Message-ID: <51CBA981.4050006@nri.co.jp>
Date: Thu, 27 Jun 2013 11:54:57 +0900
From: n-sakimura <n-sakimura@nri.co.jp>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.12) Gecko/20130105 Thunderbird/10.0.12
MIME-Version: 1.0
To: Jim Schaad <ietf@augustcellars.com>
References: <061.c2fcfec0a75d48eb8b194991ce56157e@trac.tools.ietf.org> <076.3f5d1244c042cd87bfb07814924fcbc9@trac.tools.ietf.org> <033a01ce729b$26bc3910$7434ab30$@augustcellars.com>
In-Reply-To: <033a01ce729b$26bc3910$7434ab30$@augustcellars.com>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-MailAdviser: Ver1.3.3
Cc: michael.jones@microsoft.com, jose@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 02:55:20 -0000

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?

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