Re: [jose] Should we delete the "typ" header field

John Bradley <ve7jtb@ve7jtb.com> Thu, 30 May 2013 00:58 UTC

Return-Path: <ve7jtb@ve7jtb.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 9ECEC21F92B2 for <jose@ietfa.amsl.com>; Wed, 29 May 2013 17:58:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.87
X-Spam-Level:
X-Spam-Status: No, score=-2.87 tagged_above=-999 required=5 tests=[AWL=0.128, BAYES_00=-2.599, HTML_MESSAGE=0.001, J_CHICKENPOX_34=0.6, 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 97P81-MwJV3z for <jose@ietfa.amsl.com>; Wed, 29 May 2013 17:58:27 -0700 (PDT)
Received: from mail-qe0-f44.google.com (mail-qe0-f44.google.com [209.85.128.44]) by ietfa.amsl.com (Postfix) with ESMTP id 6B74921F87D2 for <jose@ietf.org>; Wed, 29 May 2013 17:58:27 -0700 (PDT)
Received: by mail-qe0-f44.google.com with SMTP id 6so5534480qeb.17 for <jose@ietf.org>; Wed, 29 May 2013 17:58:26 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=content-type:mime-version:subject:from:in-reply-to:date:cc :message-id:references:to:x-mailer:x-gm-message-state; bh=S8xjUxc+P/8qzvPI1YA7kXbDHYSvFxejQo/tf+OgFnk=; b=gNxBOXzZrcXQfZmhUu7lzNXY3eLaFNIhNZw8KJtaKYR03wtLRy4ZGee/mFhuJiq+rB kc0t0+K41vPM6UH83lOUYKvE42YlyHsfSEe6FA0FVQS7qyAgNPgF4vnvR+LLrbTufFMw mqnKfUNEiMfX7Nlq2WQUvWx9UdvI73q8HGbjJmZ9qWeKces9zus8L8rSmZ/9xSFGkrrN FYey5CPEyaKJhs0fv300gc0weCWnmUWM+GxNh19QCZ8X7nwG9gXKE0rO/9o+VSElA0t1 LMLpjTAzPX5U0wuuJAD7VweJCd9ueTvL3xZLlOD8xduK0kdsxCzvIe4g+zKXiBc7uFZH WuNA==
X-Received: by 10.229.175.137 with SMTP id ba9mr1929534qcb.43.1369875506673; Wed, 29 May 2013 17:58:26 -0700 (PDT)
Received: from [192.168.1.36] (190-20-29-231.baf.movistar.cl. [190.20.29.231]) by mx.google.com with ESMTPSA id j9sm34251999qas.3.2013.05.29.17.58.23 for <multiple recipients> (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 17:58:25 -0700 (PDT)
Content-Type: multipart/signed; boundary="Apple-Mail=_F761954E-1CC4-445D-BA63-A15EC12C9157"; protocol="application/pkcs7-signature"; micalg="sha1"
Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\))
From: John Bradley <ve7jtb@ve7jtb.com>
In-Reply-To: <CAD9ie-tgN7NyEU4_AP=KvcJZWSY_iOk85YYR_7zndb5ZGcP3Bw@mail.gmail.com>
Date: Wed, 29 May 2013 20:58:15 -0400
Message-Id: <198079E6-D96A-4576-A950-FCD1BF45F315@ve7jtb.com>
References: <02b701ce5cb8$46ae77e0$d40b67a0$@augustcellars.com> <CAD9ie-vK3gY9b9GQrbUa=TACy5KVA1uPH_u_utucoKzVynjuiA@mail.gmail.com> <02f501ce5cc5$ec9a2200$c5ce6600$@augustcellars.com> <CAD9ie-uV-THE0+oL-dNUB0qXF7sx8jHMZDCz8vGESmUHWV=LMg@mail.gmail.com> <C84C740C-CA7F-40F4-829B-1A1C09EF357F@ve7jtb.com> <CAD9ie-tgN7NyEU4_AP=KvcJZWSY_iOk85YYR_7zndb5ZGcP3Bw@mail.gmail.com>
To: Dick Hardt <dick.hardt@gmail.com>
X-Mailer: Apple Mail (2.1503)
X-Gm-Message-State: ALoCoQmIioLMuj409QEN6/tRFUK+5U8XBaqzJ5wwdmMyZovou+3Il6dgo1CkJNC6HjNh2YFcSFb8
Cc: Jim Schaad <ietf@augustcellars.com>, "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] Should we delete the "typ" header field
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, 30 May 2013 00:58:33 -0000

JOSE is intended to be generic.  A JWS may unwrap to a XMPP message, GIF or some yet to be thought of JSON document.

What people want to use JOSE for colours there perception of it.   If in your environment all the body's are JWT claim sets then saying the over all token is a JWT is redundent

We will get into interop problems if one JWT library tags all its tokens as "typ":"jwt" and another is expecting them as "typ":"jwe" to shortcut looking at the alg.

From a JOSE perspective I can see why people think of typ as JWE or JWS but if you look at the text in JWS the options are JWS or JWS+JSON intended to differentiate between the two possible serializations.   What it is missing because the reference is awkward is the reference to  JWT saying that "typ":"JWT" is always compact serialization.   

John B.



On 2013-05-29, at 8:29 PM, Dick Hardt <dick.hardt@gmail.com> wrote:

> 
> 
> 
> On Wed, May 29, 2013 at 5:25 PM, John Bradley <ve7jtb@ve7jtb.com> wrote:
> In the JWT spec the value of "typ" SHOULD be "jwt".   That indicates as Mike stated that it is a JWT in compact format that has as its body a jwt claim set.   If the claim set is signed then encrypted, the inner JWT has a a typ of jwt and no cty , and the outer one has a typ of JWT and a cty of jws.
> 
> I'm doing symmetric encryption with an integrity check, so I don't have a JWT in a JWE
>  
> 
> If a JOSE object has a typ of jws then one would assume that it is a jws in compact serialization with some other body type then a jwt claimset.
> 
> I think this is somewhat a symptom of the JWT and JOSE specs getting split into different WG.
> 
> So Mike can correct me but I don't think putting jwe or jws in typ is the intended use of that element if you are in fact sending JWT.
> 
> I understand where Jim is coming from I think of JWT as a jwt claim-set and JWE and JWS as the outer layer, where JWT thinks of itself as a total security token definition including overall processing rules for security tokens, with a standard envelope segment and JWE or JWS encoding as determined by the alg.
> 
> That is confusing to me.
>  
> 
> In security token processing knowing that what you have will unwrap to a JWT claim-set , rather than to some other thing is quite important.
> 
> What else would it unwrap to?
>  
> 
> John B.
> 
> 
> On 2013-05-29, at 7:56 PM, Dick Hardt <dick.hardt@gmail.com> wrote:
> 
>> I use it all the time and my code would barf if it was not there.
>> 
>> I think it should be required rather than be a hint if it is going ot be there.
>> 
>> 
>> On Wed, May 29, 2013 at 4:40 PM, Jim Schaad <ietf@augustcellars.com> wrote:
>> I think the values just changed
>> 
>>  
>> 
>> However the way you are using it would be an argument to say that it should be a required field.  Are you just using it as a hint if it exists and then looking at the rest of the fields if it is not present?
>> 
>>  
>> 
>> Jim
>> 
>>  
>> 
>>  
>> 
>> From: Dick Hardt [mailto:dick.hardt@gmail.com] 
>> Sent: Wednesday, May 29, 2013 3:49 PM
>> To: Jim Schaad
>> Cc: jose@ietf.org
>> Subject: Re: [jose] Should we delete the "typ" header field
>> 
>>  
>> 
>> Well, I have been using, but now realize the spec changed or I was confused.
>> 
>>  
>> 
>> I had been setting "typ" to be either "JWE" or "JWS" depending on the type of token I was creating or parsing as it was easier than looking at "alg"
>> 
>>  
>> 
>> As currently defined, I don't see value in "typ".
>> 
>>  
>> 
>> -- Dick
>> 
>>  
>> 
>>  
>> 
>> On Wed, May 29, 2013 at 3:02 PM, Jim Schaad <ietf@augustcellars.com> wrote:
>> 
>> In reading the documents, I am trying to understand the justification for having the “typ” header parameter in the JOSE documents.
>> 
>>  
>> 
>> The purpose of the field is to hold the type of the object.  In the past, I believe that values which should now be placed in the cty field (such as “JWT”) were placed in this field as well.  However the parameter is optional and an implementation cannot rely on its being present.  This means that for all practical purposes all of the code to determine the value of the type field from the values of the alg and enc fields.  If the field was mandatory then this code would disappear at a fairly small space cost and I can understand why the parameter would be present.
>> 
>>  
>> 
>> Can anybody justify why this field should be present in the document – or should it just disappear?
>> 
>>  
>> 
>> Jim
>> 
>>  
>> 
>> 
>> _______________________________________________
>> jose mailing list
>> jose@ietf.org
>> https://www.ietf.org/mailman/listinfo/jose
>> 
>> 
>> 
>> 
>>  
>> 
>> -- 
>> -- Dick
>> 
>> 
>> 
>> 
>> -- 
>> -- Dick
>> _______________________________________________
>> jose mailing list
>> jose@ietf.org
>> https://www.ietf.org/mailman/listinfo/jose
> 
> 
> 
> 
> -- 
> -- Dick