Re: [jose] Concat KDF

"Manger, James H" <James.H.Manger@team.telstra.com> Tue, 25 June 2013 04:21 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 C225A21F9302 for <jose@ietfa.amsl.com>; Mon, 24 Jun 2013 21:21:57 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.722
X-Spam-Level:
X-Spam-Status: No, score=-0.722 tagged_above=-999 required=5 tests=[AWL=0.178, BAYES_00=-2.599, HELO_EQ_AU=0.377, HOST_EQ_AU=0.327, HTML_MESSAGE=0.001, 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 FkCvO6sx3Lom for <jose@ietfa.amsl.com>; Mon, 24 Jun 2013 21:21:51 -0700 (PDT)
Received: from ipxbvo.tcif.telstra.com.au (ipxbvo.tcif.telstra.com.au [203.35.135.204]) by ietfa.amsl.com (Postfix) with ESMTP id AD5DB21F930C for <jose@ietf.org>; Mon, 24 Jun 2013 21:21:50 -0700 (PDT)
X-IronPort-AV: E=Sophos; i="4.87,933,1363093200"; d="scan'208,217"; a="143164251"
Received: from unknown (HELO ipccvi.tcif.telstra.com.au) ([10.97.217.208]) by ipobvi.tcif.telstra.com.au with ESMTP; 25 Jun 2013 14:21:32 +1000
X-IronPort-AV: E=McAfee;i="5400,1158,7116"; a="140603663"
Received: from wsmsg3702.srv.dir.telstra.com ([172.49.40.170]) by ipccvi.tcif.telstra.com.au with ESMTP; 25 Jun 2013 14:21:32 +1000
Received: from WSMSG3153V.srv.dir.telstra.com ([172.49.40.159]) by WSMSG3702.srv.dir.telstra.com ([172.49.40.170]) with mapi; Tue, 25 Jun 2013 14:21:31 +1000
From: "Manger, James H" <James.H.Manger@team.telstra.com>
To: Jim Schaad <ietf@augustcellars.com>, 'Mike Jones' <Michael.Jones@microsoft.com>, 'Russ Housley' <housley@vigilsec.com>
Date: Tue, 25 Jun 2013 14:21:30 +1000
Thread-Topic: [jose] Concat KDF
Thread-Index: AQI2DKIeuNf4zKTggqGJ0eM46TKvwQJlRGK8ApvD+k8A6jOEoAH71aeeAt8ahgUCiwG8iAGlt3KlAsFOBucCSOBDEAJqvEIyl8FTy5CAAHPBIA==
Message-ID: <255B9BB34FB7D647A506DC292726F6E1151BD1D219@WSMSG3153V.srv.dir.telstra.com>
References: <255B9BB34FB7D647A506DC292726F6E1151B930A31@WSMSG3153V.srv.dir.telstra.com> <033601ce6c6c$492fa4d0$db8eee70$@augustcellars.com> <CAL02cgQCquK9KVdnXWoeK5HJLBrU_TFaw9wNPydFRA9t1wS5jw@mail.gmail.com> <255B9BB34FB7D647A506DC292726F6E1151BB8F972@WSMSG3153V.srv.dir.telstra.com> <4E1F6AAD24975D4BA5B1680429673943678805A6@TK5EX14MBXC283.redmond.corp.microsoft.com> <4E1F6AAD24975D4BA5B168042967394367880BB1@TK5EX14MBXC283.redmond.corp.microsoft.com> <CAL02cgRn5SA=WQDGsQUHQPRu8W+Fw0Xau0uyWXfFSn9ppe+cUQ@mail.gmail.com> <004a01ce6f8f$7b8df370$72a9da50$@augustcellars.com> <4E1F6AAD24975D4BA5B168042967394367888C47@TK5EX14MBXC283.redmond.corp.microsoft.com> <EE17904F-1717-4015-B998-899C5E42F1D9@vigilsec.com> <4E1F6AAD24975D4BA5B16804296739436788B908@TK5EX14MBXC283.redmond.corp.microsoft.com> <003901ce7066$e19f9470$a4debd50$@augustcellars.com>
In-Reply-To: <003901ce7066$e19f9470$a4debd50$@augustcellars.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: multipart/alternative; boundary="_000_255B9BB34FB7D647A506DC292726F6E1151BD1D219WSMSG3153Vsrv_"
MIME-Version: 1.0
Cc: "jose@ietf.org" <jose@ietf.org>
Subject: Re: [jose] Concat KDF
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: Tue, 25 Jun 2013 04:21:57 -0000

A few more observations on ConcatKDF…

Revision 2 of NIST 800-56A has just been published. JOSE should probably reference this update. The text about identifiers for parties is slightly better (section 4.1 “Key establishment Preparations”), but it still isn’t explicit about whether senders and/or receivers are responsible for validating AlgorithmID/PartyUInfo/PartyVInfo/SuppPubInfo/SuppPrivInfo.

Including a key owner’s name in a KDF calculation is going to be awkward for JOSE given it really leaves those details to higher layers, but it is necessary for interoperability if we use ConcatKDF.

Jim’s scheme might work. The recipient’s static ECDH key is assumed to come from a JWK that has an “ID” field.
Example: {"kty":"EC","crv":"P-521","kid":"537352","ID":"alice","x":"…","y":"…"}

If the “ID” field is absent but a “x5c” field is present, it might be easier to use the whole certificate (instead of the DER-encoded subject name) as PartyVInfo. It means the code doing the ConcatKDF calculation doesn’t need to decode DER. It does mean that a recipient’s key MUST be associated with an “ID” or “x5c” field to use ConcatKDF.

“ID” might not be such a good name as it is too easy to confuse with “kid”. Perhaps “owner”?

The originator of a JOSE ECDH message contributes an ephemeral key and is not authenticated so giving them a name feels unnecessary (or actively misleading). How about fixing PartyUInfo to be “anonymous” for the ECDH Ephemeral-Static algorithms?

[It’s a pity we don’t have a canonical form of JSON so we could describe the ConcatKDF OtherInput field as a JSON object — instead of needing to make up an ad hoc binary format.]


ConcatKDF in the XML encryption standard [http://www.w3.org/TR/xmlenc-core1/#sec-ConcatKDF] has separate XML attributes for AlgorithmID, PartyUInfo, PartyVInfo, SuppPubInfo, and SuppPrivInfo. Unfortunately the fields are concatenated together without preserving their boundaries. Hence it looks broken to me. There were some recent interop test cases from Microsoft and IBM for ConcatKDF in XML encryption. The KDF parts work, but the associated CBC encryption looks wrong as it is missing some padding. It doesn’t give much confidence that ConcatKDF is used much. [http://lists.w3.org/Archives/Public/public-xmlsec/2013Jun/0005.html]

--
James Manger

From: jose-bounces@ietf.org [mailto:jose-bounces@ietf.org] On Behalf Of Jim Schaad
Sent: Monday, 24 June 2013 9:11 AM
To: 'Mike Jones'; 'Russ Housley'
Cc: jose@ietf.org
Subject: Re: [jose] Concat KDF

I have been thinking about this and I am going to make a different proposal.


The proposal is as follows:


1.        We eliminate the two partyX fields from the specification

2.       We define a new “ID” field which MUST be present for ECDH keys.

3.       We say that you take the ID field from the sender/recipient respectively and use them in the PartyX fields when doing the KDC.

The only down side of this, is that if one has a certificate then we should use the DER encoded subject name of the certificate but I am not sure how this would be encoded in the case you have a JWK which contains an x5c member.  It might be that we will need to defined an ID and an IDb64 field to allow for a binary ID to be used.

There would still need to be a requirement that the ID field be length prefixed in the discussion.

Jim


From: jose-bounces@ietf.org [mailto:jose-bounces@ietf.org] On Behalf Of Mike Jones
Sent: Sunday, June 23, 2013 2:57 PM
To: Russ Housley
Cc: jose@ietf.org
Subject: Re: [jose] Concat KDF

Good idea, Russ.  How about this?

“In the general case, the specific identifiers used to tie the key derivation to the sender (Party U) and the receiver (Party V) are application specific and beyond the scope of this specification.  As an illustration of one possible usage, when the JWE is a JSON Web Token (JWT) [JWT], applications might specify that the “iss” (issuer) value be used as the “apu” value and the primary “aud” (audience) value be used as the “apv’ value.”

                                                            -- Mike

From: Russ Housley [mailto:housley@vigilsec.com]
Sent: Sunday, June 23, 2013 7:43 AM
To: Mike Jones
Cc: jose@ietf.org<mailto:jose@ietf.org>
Subject: Re: [jose] Concat KDF

Mike:

I can add a sentence along the lines of the following to make Jim’s points below clearer to non-expert readers:

“The specific identifiers used to tie the key derivation to the sender (Party U) and the receiver (Party V) are application specific and beyond the scope of this specification.”

I see the attraction of this approach, but I wonder if it would be possible to also include some advice to applications that make use of JOSE.

If the parties that are trying to form a pairwise key make different assumptions, then we do not get interoperability.  I am just trying to improve the likelihood of interoperability.

Russ