Re: [jose] Stephen Farrell's Discuss on draft-ietf-jose-json-web-key-33: (with DISCUSS and COMMENT)

Mike Jones <Michael.Jones@microsoft.com> Tue, 07 October 2014 12:30 UTC

Return-Path: <Michael.Jones@microsoft.com>
X-Original-To: jose@ietfa.amsl.com
Delivered-To: jose@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 670EB1A1BAD; Tue, 7 Oct 2014 05:30:31 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.902
X-Spam-Level:
X-Spam-Status: No, score=-1.902 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R_eKkjW386g3; Tue, 7 Oct 2014 05:30:29 -0700 (PDT)
Received: from na01-by2-obe.outbound.protection.outlook.com (mail-by2on0140.outbound.protection.outlook.com [207.46.100.140]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 0A8FF1A1BAA; Tue, 7 Oct 2014 05:30:28 -0700 (PDT)
Received: from CO2PR03CA0042.namprd03.prod.outlook.com (10.141.194.169) by BN3PR0301MB1201.namprd03.prod.outlook.com (25.161.207.154) with Microsoft SMTP Server (TLS) id 15.0.1044.10; Tue, 7 Oct 2014 12:30:27 +0000
Received: from BL2FFO11FD018.protection.gbl (2a01:111:f400:7c09::189) by CO2PR03CA0042.outlook.office365.com (2a01:111:e400:1414::41) with Microsoft SMTP Server (TLS) id 15.0.1044.10 via Frontend Transport; Tue, 7 Oct 2014 12:30:26 +0000
Received: from mail.microsoft.com (131.107.125.37) by BL2FFO11FD018.mail.protection.outlook.com (10.173.161.36) with Microsoft SMTP Server (TLS) id 15.0.1039.16 via Frontend Transport; Tue, 7 Oct 2014 12:30:25 +0000
Received: from TK5EX14MBXC286.redmond.corp.microsoft.com ([169.254.1.93]) by TK5EX14HUBC102.redmond.corp.microsoft.com ([157.54.7.154]) with mapi id 14.03.0210.003; Tue, 7 Oct 2014 12:29:47 +0000
From: Mike Jones <Michael.Jones@microsoft.com>
To: Barry Leiba <barryleiba@computer.org>, Stephen Farrell <stephen.farrell@cs.tcd.ie>
Thread-Topic: [jose] Stephen Farrell's Discuss on draft-ietf-jose-json-web-key-33: (with DISCUSS and COMMENT)
Thread-Index: AQHP3jI0y2YQdh1++ku2NamIZ5KlrpwiPARQgAFPwQCAAAGVAIAADBaAgAAB+ACAAAMNgIAAAq0AgAA3FFCAABWNAIAAAScggACEiYCAACB4gIAAAjAQ
Date: Tue, 07 Oct 2014 12:29:46 +0000
Message-ID: <4E1F6AAD24975D4BA5B16804296739439BAF4627@TK5EX14MBXC286.redmond.corp.microsoft.com>
References: <20141002111501.6046.52416.idtracker@ietfa.amsl.com> <4E1F6AAD24975D4BA5B16804296739439BAF0C1E@TK5EX14MBXC286.redmond.corp.microsoft.com> <00c601cfe1a4$15d32900$41797b00$@augustcellars.com> <7ABF79CB-61C8-490B-A727-465530222F0B@nominum.com> <00dd01cfe1aa$eba7db10$c2f79130$@augustcellars.com> <54330888.4090605@cs.tcd.ie> <00f101cfe1ad$6dc9fea0$495dfbe0$@augustcellars.com> <54330D56.507@cs.tcd.ie> <4E1F6AAD24975D4BA5B16804296739439BAF2783@TK5EX14MBXC286.redmond.corp.microsoft.com> <011b01cfe1d5$17f6d610$47e48230$@augustcellars.com> <4E1F6AAD24975D4BA5B16804296739439BAF321C@TK5EX14MBXC286.redmond.corp.microsoft.com> <5433BDC3.2050404@cs.tcd.ie> <CALaySJ+cDNPGc6orsJqwnhx-p3puRH_q1E4=vx0Vcodv-Npz+Q@mail.gmail.com>
In-Reply-To: <CALaySJ+cDNPGc6orsJqwnhx-p3puRH_q1E4=vx0Vcodv-Npz+Q@mail.gmail.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [157.54.51.33]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-EOPAttributedMessage: 0
X-Forefront-Antispam-Report: CIP:131.107.125.37; CTRY:US; IPV:CAL; IPV:NLI; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(438002)(377454003)(189002)(13464003)(51704005)(199003)(51444003)(23726002)(85806002)(106116001)(104016003)(87936001)(19580405001)(81156004)(95666004)(107046002)(93886004)(20776003)(85306004)(55846006)(64706001)(230783001)(47776003)(50466002)(4396001)(2656002)(84676001)(46406003)(99396003)(106466001)(85852003)(31966008)(92566001)(120916001)(69596002)(33656002)(50986999)(97756001)(97736003)(54356999)(86612001)(92726001)(66066001)(86362001)(44976005)(76176999)(77096002)(68736004)(76482002)(6806004)(19580395003)(80022003)(21056001)(26826002)(46102003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0301MB1201; H:mail.microsoft.com; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en;
X-Microsoft-Antispam: UriScan:;
X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BN3PR0301MB1201;
X-O365ENT-EOP-Header: Message processed by - O365_ENT: Allow from ranges (Engineering ONLY)
X-Forefront-PRVS: 035748864E
Received-SPF: Pass (protection.outlook.com: domain of microsoft.com designates 131.107.125.37 as permitted sender) receiver=protection.outlook.com; client-ip=131.107.125.37; helo=mail.microsoft.com;
Authentication-Results: spf=pass (sender IP is 131.107.125.37) smtp.mailfrom=Michael.Jones@microsoft.com;
X-OriginatorOrg: microsoft.onmicrosoft.com
Archived-At: http://mailarchive.ietf.org/arch/msg/jose/8AxFTqlf5ZMqqyYJOLfx5URggtA
Cc: "jose-chairs@tools.ietf.org" <jose-chairs@tools.ietf.org>, Jim Schaad <ietf@augustcellars.com>, Ted Lemon <Ted.Lemon@nominum.com>, "jose@ietf.org" <jose@ietf.org>, "draft-ietf-jose-json-web-key@tools.ietf.org" <draft-ietf-jose-json-web-key@tools.ietf.org>, The IESG <iesg@ietf.org>
Subject: Re: [jose] Stephen Farrell's Discuss on draft-ietf-jose-json-web-key-33: (with DISCUSS and COMMENT)
X-BeenThere: jose@ietf.org
X-Mailman-Version: 2.1.15
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: Tue, 07 Oct 2014 12:30:31 -0000

> -----Original Message-----
> From: barryleiba@gmail.com [mailto:barryleiba@gmail.com] On Behalf Of Barry
> Leiba
> Sent: Tuesday, October 07, 2014 5:14 AM
> To: Stephen Farrell
> Cc: Mike Jones; Jim Schaad; Ted Lemon; jose-chairs@tools.ietf.org; draft-ietf-
> jose-json-web-key@tools.ietf.org; The IESG; jose@ietf.org
> Subject: Re: [jose] Stephen Farrell's Discuss on draft-ietf-jose-json-web-key-33:
> (with DISCUSS and COMMENT)
> 
> I think I've kept the relevant bits here:
> 
> >>>>> Because there will be cases where two different implementations
> >>>>> with code try to create the same key id from its components and
> >>>>> get it wrong otherwise. Not all cases, but some.
> >>>>
> >>>> All of this is making me think that saying anything specifically
> >>>> about the use of DNS names in Key IDs is opening up a can of worms
> >>>> - particularly
> >>> I18N worms.
> >>>> ;-)
> >>>>
> >>>> In my initial response, I'd proposed that we add more generic text
> >>>> like the following.  Would that work for you, Stephen?
> >>>>
> >>>> "If case-insensitive values, such as DNS names, are included in "kid"
> >>>> values, then the application specifying their inclusion needs to
> >>>> define a canonical case-sensitive representation to use for the
> >>>> case-insensitive portions inside the "kid", such as lowercasing them."
> >>>
> >>> In cases where applications assign semantics to the kid field,
> >>> applications may need to define canonicalization routines for these
> >>> values.  For example, if DNS names are to be used as a "kid" value,
> >>> then it applications should probably specify that it be converted to
> lowercase before using it as a value.
> >>>
> >>> I kind of like using the assumption that this is important only when
> >>> applications assign semantics to the field.  Otherwise it is just
> >>> going to be some random string.
> >
> > I disagree. There is no assignment of semantics if two different
> > implementations are written to read a DNS name from somewhere and then
> > use that as part of a kid. The issue is nothing to do with semantics
> > but all do to with whether those two chunks of code both do or do not
> > include a tolower() call.
> >
> > The text suggested above is almost ok however, but I'd prefer it more
> > like:
> >
> >    If case-insensitive values, such as DNS names, are included
> >    in "kid" values, then the application including those needs
> >    to ensure that a canonical case-sensitive representation is
> >    used as otherwise different implementations will be highly
> >    likely to suffer interoperability problems. In the case of
> >    DNS names, the common approach taken is lowercasing."
> >
> > I'd prefer "SHOULD be lowercased" myself but can live with the above.
> 
> On the desire not to open the I18N "can of worms": I'm sorry, folks, but just
> wanting not to open it doesn't make it stay closed.  If you will ver have to
> compare strings, you *have* to deal with it.  It doesn't matter whether you've
> assigned semantic significance to the field or not.  If a kid value (for example)
> will ever have to be compared to another string (be it another kid value or any
> other string from any other source), and you do not want a straight byte-by-byte
> comparison -- say, you created a kid value and I created a kid value, and you
> need to see if they match -- then you need to address now to do the
> comparison... or how to create the strings so that the byte-by-byte comparison
> works.
> 
> Even with Stephen's "SHOULD" there, I don't see how interop happens.
> If you lowercase your DNS names (or other case-insensitive values), using "the
> common approach", but I decide to be uncommon and uppercase them (perhaps
> I have a system that internally stores these things in upper case, so it's easier for
> me to leave them that way), then we don't interoperate.
> 
> Why, then, is this not a "MUST"?

This brings me back around to wondering why just saying that Key ID values are case sensitive strings is not enough, and leaving it up to applications how to choose the contents of those case-sensitive strings?  I really feel like injecting domain names into the discussion, when I'm aware of no deployments that use domain names in Key ID values, is a red herring.

It's also worth noting that, from a protocol perspective, the same party that creates the Key ID value will almost certainly be publishing it to the recipients, so there's no chance of mismatch.  If I'm a signer, I'll both put the "kid" value in a JWK Set to advertise my keys and put the same "kid" value in a JWS in which the key is used.  There's no chance for mismatch, since the same party is publishing the same "kid" value in all the places it is used.

I think that by even talking about domain names in the context of Key IDs, we're creating an issue where none actually exists.  I'm hoping that simplicity can prevail here...

> Barry

				-- Mike