[jose] "crit" (Critical) header parameter: unnecessary constraints

"Manger, James H" <James.H.Manger@team.telstra.com> Sun, 28 April 2013 14:30 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 102AA21F987E for <jose@ietfa.amsl.com>; Sun, 28 Apr 2013 07:30:44 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.901
X-Spam-Level:
X-Spam-Status: No, score=-0.901 tagged_above=-999 required=5 tests=[AWL=0.000, 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 ZVCgrfWiT353 for <jose@ietfa.amsl.com>; Sun, 28 Apr 2013 07:30:42 -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 4304A21F9977 for <jose@ietf.org>; Sun, 28 Apr 2013 07:30:39 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="4.87,566,1363093200"; d="scan'208";a="132426879"
Received: from unknown (HELO ipcdvi.tcif.telstra.com.au) ([10.97.217.212]) by ipocvi.tcif.telstra.com.au with ESMTP; 29 Apr 2013 00:30:36 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7058"; a="128277051"
Received: from wsmsg3755.srv.dir.telstra.com ([172.49.40.196]) by ipcdvi.tcif.telstra.com.au with ESMTP; 29 Apr 2013 00:30:37 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3755.srv.dir.telstra.com ([172.49.40.196]) with mapi; Mon, 29 Apr 2013 00:30:36 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: "jose@ietf.org" <jose@ietf.org>
Date: Mon, 29 Apr 2013 00:30:34 +1000
Thread-Topic: "crit" (Critical) header parameter: unnecessary constraints
Thread-Index: Ac5EHPH0IHQJQWrpT/W+TNqUbu9Inw==
Message-ID: <255B9BB34FB7D647A506DC292726F6E1150CD91C8D@WSMSG3153V.srv.dir.telstra.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="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
Subject: [jose] "crit" (Critical) header parameter: unnecessary constraints
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: Sun, 28 Apr 2013 14:30:44 -0000

The "crit" header parameter has been made unnecessarily complicated. It should say the "crit" parameter is an array of strings; a JOSE message MUST be rejected if any of the strings in the array is not understood.

The current definition includes additional constraints: the array "MUST NOT include header parameters defined by this specification, duplicate names, or names that do not occur as header parameters within the {JWE|JWS}".

This extra "MUST NOT" just adds extra work for implementations. Instead of simply checking that each "crit" string is in an implementation’s hardwired list of understood strings (probably 1 line of code in many languages), an implementation additionally has to check each "crit" string against headers defined in JWE/JWS specs (which version?), and check for duplicates, and check that each "crit" string is present in the JOSE message (at the top level?).

I cannot see any benefit from these additional checks; just an extra burden on implementers. I am also sure many implementation will not bother enforcing these additional checks, making them an interop mess.


"crit" strings need a registry. We should replace the "typ" registry with a registry of "crit" values. "typ" was ill-defined even before a recent draft muddied it further by defining different values based on the serialization being used (eg "typ":"JWE" and "typ":"JWE-JS").

P.S. We really need to stop defining so many things in duplicate or worse -- in JWS and in JWE. We really need to define a JOSE message.

--
James Manger