Re: [jose] Distinguishing signed, encrypted, and unprotected tokens

"Manger, James H" <James.H.Manger@team.telstra.com> Mon, 21 May 2012 00:43 UTC

Return-Path: <James.H.Manger@team.telstra.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 A9AA721F8597 for <jose@ietfa.amsl.com>; Sun, 20 May 2012 17:43:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.25
X-Spam-Level:
X-Spam-Status: No, score=0.25 tagged_above=-999 required=5 tests=[AWL=1.151, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, RELAY_IS_203=0.994]
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 qQM4z-etRnrb for <jose@ietfa.amsl.com>; Sun, 20 May 2012 17:43:18 -0700 (PDT)
Received: from ipxcvo.tcif.telstra.com.au (ipxcvo.tcif.telstra.com.au [203.35.135.208]) by ietfa.amsl.com (Postfix) with ESMTP id 6700C21F8594 for <jose@ietf.org>; Sun, 20 May 2012 17:43:18 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.75,627,1330866000"; d="scan'208";a="76626358"
Received: from unknown (HELO ipcdvi.tcif.telstra.com.au) ([10.97.217.212]) by ipocvi.tcif.telstra.com.au with ESMTP; 21 May 2012 10:43:17 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,6717"; a="63847151"
Received: from wsmsg3751.srv.dir.telstra.com ([172.49.40.172]) by ipcdvi.tcif.telstra.com.au with ESMTP; 21 May 2012 10:43:16 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3751.srv.dir.telstra.com ([172.49.40.172]) with mapi; Mon, 21 May 2012 10:43:16 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Mike Jones <Michael.Jones@microsoft.com>, "Richard L. Barnes" <rbarnes@bbn.com>, Jim Schaad <ietf@augustcellars.com>
Date: Mon, 21 May 2012 10:43:15 +1000
Thread-Topic: [jose] Distinguishing signed, encrypted, and unprotected tokens
Thread-Index: Ac0z6YIAkxSNdpPpSJGGHmreRKfuNABAjGsAAFxLuoAAF+hbAAAAY/yAAAbafnAAAdL98A==
Message-ID: <255B9BB34FB7D647A506DC292726F6E114F2F2EC9E@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E114F2E1C05D@WSMSG3153V.srv.dir.telstra.com> <44153647-17FA-4B02-B528-60456E1E4751@ve7jtb.com> <255B9BB34FB7D647A506DC292726F6E114F2F2E7DF@WSMSG3153V.srv.dir.telstra.com> <021601cd36bc$86606bf0$932143d0$@augustcellars.com> <AB155C9C-0848-4434-A780-1BB0BC8B12A2@bbn.com> <4E1F6AAD24975D4BA5B168042967394366510478@TK5EX14MBXC284.redmond.corp.microsoft.com>
In-Reply-To: <4E1F6AAD24975D4BA5B168042967394366510478@TK5EX14MBXC284.redmond.corp.microsoft.com>
Accept-Language: en-US, en-AU
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
acceptlanguage: en-US, en-AU
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Cc: 'John Bradley' <ve7jtb@ve7jtb.com>, "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] Distinguishing signed, encrypted, and unprotected tokens
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: Mon, 21 May 2012 00:43:19 -0000

I suggested:
>>> * 3 dots (4 segments) => JWE
>>> * 2 dots (3 segments) => JWS
>>> * 1 dot  (2 segments) => unprotected payload (<header>.<payload>)

Jim wrote:
>> What happens if you are distinguishing based on the number of dots and 
>> then you move to a new encoding format that is not dot separated?

Hang on Jim, of course interop fails if you change syntax.


Mike said:
> Indeed, we already have a JSON format proposed in response working
> group input with no dots.  See these specs:
>	http://tools.ietf.org/html/draft-jones-json-web-signature-json-serialization-01
>	http://tools.ietf.org/html/draft-jones-json-web-encryption-json-serialization-01

Neither of these 2 specs talk about having a field that can be a JWE-JS, or a JWS-JS, or an (undefined) Plain-JS and having to distinguish them -- which is the *-JS equivalent to the dot-separated-B64 issue we are discussing.

The *-JS alternatives are illustrative.
JWS-JS:  {"headers":[<h1>,<h2>...], "payload":<p>, "signatures":[<s1>,<s2>...]}
JWE-JS:  {"headers":[<h1>,<h2>...], "encrypted_keys":[<k1>,<k2>...],
          "ciphertext":<c>, "integrity_values":[<s1>,<s2>...]}

The *-JS syntaxes have an *array of headers*. Are you supposed to use the "alg" value from the first header, the last header, check all headers? Or look for an "enc" header field in the first, last, or every header? I hope they are not inconsistent.

A better alternative would be to leave the headers alone and look for an "encrypted_keys" field. Another alternative could be changing the "headers" label to "jws" or "jwe" or "header" (when unprotected).

If you want to send an unprotected payload in *-JS syntax, can you omit the "integrity_values" field, or send an empty array, or send an array with 1 value that is an empty string? The first option sounds best, but the last option is the equivalent of the "alg":"none"-fake-signature method in JWT.


I really think we need -- in the JOSE specs -- to defined the packaging of signed, encrypted, or unprotected content in a way that is trivial to distinguish these 3 modes. If we have another packaging syntax (eg *-JS) it also needs to support these 3 modes and make them trivial to distinguish.

This has nothing to do with a JSON object carrying a bunch of claims (for which the OAuth group might be more appropriate).


--
James Manger