Re: [jose] SPI proposal

Hannes Tschofenig <hannes.tschofenig@gmx.net> Fri, 08 February 2013 08:10 UTC

Return-Path: <hannes.tschofenig@gmx.net>
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 0467321F8753 for <jose@ietfa.amsl.com>; Fri, 8 Feb 2013 00:10:41 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -102.876
X-Spam-Level:
X-Spam-Status: No, score=-102.876 tagged_above=-999 required=5 tests=[AWL=1.104, BAYES_00=-2.599, GB_I_LETTER=-2, RCVD_IN_SORBS_WEB=0.619, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3EM0XONa1mWu for <jose@ietfa.amsl.com>; Fri, 8 Feb 2013 00:10:40 -0800 (PST)
Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by ietfa.amsl.com (Postfix) with ESMTP id 09E5621F86F5 for <jose@ietf.org>; Fri, 8 Feb 2013 00:10:40 -0800 (PST)
Received: from mailout-de.gmx.net ([10.1.76.34]) by mrigmx.server.lan (mrigmx002) with ESMTP (Nemesis) id 0M0vpJ-1UwOBs0nvz-00v4Su for <jose@ietf.org>; Fri, 08 Feb 2013 09:10:39 +0100
Received: (qmail invoked by alias); 08 Feb 2013 08:10:38 -0000
Received: from unknown (EHLO [10.255.135.8]) [194.251.119.201] by mail.gmx.net (mp034) with SMTP; 08 Feb 2013 09:10:38 +0100
X-Authenticated: #29516787
X-Provags-ID: V01U2FsdGVkX18fCNcsdT0flGfOmJT4LxALkD3KYGz0uK+7IRjlu8 YaPco31I95MiYR
Mime-Version: 1.0 (Apple Message framework v1085)
Content-Type: text/plain; charset="us-ascii"
From: Hannes Tschofenig <hannes.tschofenig@gmx.net>
In-Reply-To: <CAL02cgRvUvf39RyDOStRXZ1Ne6p9gLrAxjtH8kfmdhE4kWG-3w@mail.gmail.com>
Date: Fri, 08 Feb 2013 10:10:34 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <288093BE-1330-4112-B2C2-BA048D453A4E@gmx.net>
References: <CAL02cgSt7w5CrP+DXo7bz_+YsxKsVMoRbZLNWa6EHjnAyScWMg@mail.gmail.com> <CA+k3eCQ_bsTxYq6u5BVe_Xk1ycOhAwWe=ebfAwk+66JavJJQfA@mail.gmail.com> <CAL02cgRvUvf39RyDOStRXZ1Ne6p9gLrAxjtH8kfmdhE4kWG-3w@mail.gmail.com>
To: Richard Barnes <rlb@ipv.sx>
X-Mailer: Apple Mail (2.1085)
X-Y-GMX-Trusted: 0
Cc: Hannes Tschofenig <hannes.tschofenig@gmx.net>, "jose@ietf.org" <jose@ietf.org>, Brian Campbell <bcampbell@pingidentity.com>
Subject: Re: [jose] SPI proposal
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: Fri, 08 Feb 2013 08:10:41 -0000

The question around the header-size is independent of the kid vs. spi proposal. In both cases the content could be the same, i.e., the key name are the same. 

In the context of OAuth (and OpenID connect) there is actually a key distribution protocol build around it and that's, for example, what the MAC specification does. 

On Feb 7, 2013, at 4:52 PM, Richard Barnes wrote:

> The motivation here is not very deep.  A lot of the current design (e.g., the three-letter names) is focused on reducing header size.  The SPI proposal further compresses header size in cases where two entities will be exchanging many JOSE objects.  I understood from some discussions with OpenID folks that this was often the case for their use cases.
> 
> Obviously, you could build a whole management protocol around this stuff (cf. IKE for IPsec).  Whatever application is using this would need to figure out how to deal with the issues you note, as well as things like what happens when an object shows up with an unknown SPI.  (I don't think collision is an issue, if you can scope to sender; the sender just ensures uniqueness.)  The idea of this basic proposal is to establish the basic behavior, around which you could then wrap more advanced management.  
> 
> --Richard
> 
> 
> On Thu, Feb 7, 2013 at 9:42 AM, Brian Campbell <bcampbell@pingidentity.com> wrote:
> Admittedly I'm not really up on this spi issue or the motivation behind it but a couple questions came to mind when I saw this. How does the receiver protect against unbounded growth of the cache? And index collision? And for distributed environments, it seems supporting this could be very cumbersome.
> 
> 
> 
> 
> 
> 
> 
> 
> On Wed, Feb 6, 2013 at 3:11 PM, Richard Barnes <rlb@ipv.sx> wrote:
> To move us toward closing Issue #9 [9], here is some proposed text for an SPI [1] field.  To recall, SPI stands for "security parameters index", borrowing a term from IPsec.  The idea is that in cases where the same crypto parameters are being used repeatedly, this would save the parties from having to re-send the same parameters.
> 
> The below text is designed for the JWE spec, but could be adapted for JWS (just keep header, ignore part about key/iv).  Similar text is probably needed for the encryption/decryption/signing/verification sections.
> 
> Feedback welcome,
> --Richard
> 
> -----BEGIN-----
> Section 4.1.X. "spi" Header Parameter
> 
> The "spi" (Security Parameters Index) header parameter contains an opaque byte string that labels a set of security parameters.  This index is designed to enable the use of smaller headers in cases where entities will be re-using the same security parameters for several messages.
> 
> Entities supporting the use of the "spi" parameter MUST maintain a table of cached security parameters.  When an entity receives an object whose header contains both "spi" and "alg" values, then it MUST cache the following values from the JWE, indexed by the "spi" value:
> -- Contents of the JWE header
> -- Encrypted Key
> -- Initialization Vector
> 
> If an object containing an "spi" parameter but no "alg" parameter, then it MUST NOT contain an Encrypted Key or Initialization Vector.  That is, it will have the form "header.ciphertext.integrity_value".  When a recipient receives such an object, it uses the "spi" value to retrieve cached header, key, and initialization vector and reconstructs a full JWE.  This full JWE can then be further processed according to the normal JWE processing rules.  If the recipient has no cached parameters for the "spi" value, the process MUST fail.
> -----END-----
> 
> 
> [9] http://tools.ietf.org/wg/jose/trac/ticket/9
> 
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose
> 
> 
> 
> _______________________________________________
> jose mailing list
> jose@ietf.org
> https://www.ietf.org/mailman/listinfo/jose