Re: [lamps] Review draft-ietf-lamps-cms-mix-with-psk-00

Jim Schaad <ietf@augustcellars.com> Thu, 29 November 2018 20:13 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: spasm@ietfa.amsl.com
Delivered-To: spasm@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 18917130EAA for <spasm@ietfa.amsl.com>; Thu, 29 Nov 2018 12:13:04 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
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 Y81uQC48wXPo for <spasm@ietfa.amsl.com>; Thu, 29 Nov 2018 12:13:02 -0800 (PST)
Received: from mail2.augustcellars.com (augustcellars.com [50.45.239.150]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 65BE7130EB5 for <spasm@ietf.org>; Thu, 29 Nov 2018 12:13:01 -0800 (PST)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 29 Nov 2018 12:07:53 -0800
From: Jim Schaad <ietf@augustcellars.com>
To: 'Russ Housley' <housley@vigilsec.com>
CC: 'SPASM' <spasm@ietf.org>
References: <018d01d477fa$97522760$c5f67620$@augustcellars.com> <14A5DD8E-15E3-4009-961C-2E33011E0C44@vigilsec.com> <02fc01d48059$7bd665c0$73833140$@augustcellars.com> <840DC27B-3F3A-4D2D-9944-67007F88DAA7@vigilsec.com> <044a01d48748$acbd9e10$0638da30$@augustcellars.com> <EB3BA34B-F9B8-42BD-9C57-A3FF89B75B80@vigilsec.com> <046a01d48751$2684dfd0$738e9f70$@augustcellars.com> <E9467D3D-2FA2-4528-ADA8-89FCD7ABB566@vigilsec.com>
In-Reply-To: <E9467D3D-2FA2-4528-ADA8-89FCD7ABB566@vigilsec.com>
Date: Thu, 29 Nov 2018 12:12:35 -0800
Message-ID: <051001d4881f$e7251d80$b56f5880$@augustcellars.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0511_01D487DC.D9031600"
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQEOA98DAf8amIgef52BMEtUzAscOAKFtv3nAjx3WgwA3KCLKwKKGefXAhmJlcsCkQqaZwC8PV0XpoYkwTA=
Content-Language: en-us
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/0fu_HW2hcsgus4I-xpn1nKr_zI8>
Subject: Re: [lamps] Review draft-ietf-lamps-cms-mix-with-psk-00
X-BeenThere: spasm@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "This is a venue for discussion of doing Some Pkix And SMime \(spasm\) work." <spasm.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/spasm>, <mailto:spasm-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/spasm/>
List-Post: <mailto:spasm@ietf.org>
List-Help: <mailto:spasm-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/spasm>, <mailto:spasm-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Nov 2018 20:13:04 -0000

While my position is the “more correct” position, I can understand why the library being used might influence your choice here.  In any event which one is being used needs to be stated especially if you are going to re-use the KEK algorithm at this point.

 

Given that KEK1 is an ephemeral value that is known only to the sender and the specific recipient, I cannot come up to any way that a third party (potentially another mail recipient) can remove or insert the PSK KDF step.  This would be the major issue that I would have with re-using the same algorithm identifier in both KDF steps.

 

Jim

 

 

From: Russ Housley <housley@vigilsec.com> 
Sent: Wednesday, November 28, 2018 11:57 AM
To: Jim Schaad <ietf@augustcellars.com>
Cc: SPASM <spasm@ietf.org>
Subject: Re: Review draft-ietf-lamps-cms-mix-with-psk-00 

 

That bit of ambiguity is what jumped out at me when I was working with my toy implementation.  I also discovered that the library that I was using did not easily allow additional OIDs in the key agreement.

 

Russ

 





On Nov 28, 2018, at 2:32 PM, Jim Schaad <ietf@augustcellars.com <mailto:ietf@augustcellars.com> > wrote:

 

Ahhh yes, I was planning on using the KDF algorithm identifier (assuming it has one) rather than the key wrap algorithm identifier for that step.

 

If there wasn’t one then I would probably have asked for one.  

 

Jim

 

 

From: Russ Housley < <mailto:housley@vigilsec.com> housley@vigilsec.com> 
Sent: Wednesday, November 28, 2018 11:25 AM
To: Jim Schaad < <mailto:ietf@augustcellars.com> ietf@augustcellars.com>
Cc: SPASM < <mailto:spasm@ietf.org> spasm@ietf.org>
Subject: Re: Review draft-ietf-lamps-cms-mix-with-psk-00 

 

Jim:

 

I was saying that KEK1 and KEK2 would use the same AlgorithmIdentifier value in any KDF that was used.  For example, KEK1 might come from ECDH with the X9.63 KDF, and then KEK2 would come from the HKDF as described in the I-D.  Both KDFs require an AlgorithmIdentifier as an input.

 

Russ

 






On Nov 28, 2018, at 1:32 PM, Jim Schaad < <mailto:ietf@augustcellars.com> ietf@augustcellars.com> wrote:

 

I don’t know if this is more clear or not.

 

I am not sure that I agree that this demonstrates why KEK1 and KEK2 ought to be the same length, to me it only shows why len(KEK1) >= len(KEK2) is a required factor.  

 

I don’t care enough to say you should change things however.

 

Jim

 

 

From: Russ Housley < <mailto:housley@vigilsec.com> housley@vigilsec.com> 
Sent: Tuesday, November 27, 2018 12:22 PM
To: Jim Schaad < <mailto:ietf@augustcellars.com> ietf@augustcellars.com>
Cc: SPASM < <mailto:spasm@ietf.org> spasm@ietf.org>
Subject: Re: Review draft-ietf-lamps-cms-mix-with-psk-00 

 

Jim:

 

* I am missing the discussion about what the KDK length is going to be for a

key agreement algorithm.   Am I just blind?

 

I have been playing with a toy implementation to make sure that I have sorted out all of the issues, and I think that the key agreement needs some fine tuning, not so much in what is actually going on, but more in the way that it is explained.

 

I think this processing description will make more sense, and it will encourage the intended code reuse...

 

   1. The content-encryption key is generated at random.

 

   2. The pairwise key-encryption key is established for each recipient.

        The recipient's public key and the sender's private key are used

        to produce a pairwise symmetric key-encryption key, called KEK1.

 

   3.  The key derivation function (KDF) is used to mix the pre-shared

         key (PSK) and KEK1, and the result is called KEK2.

 

   4. The KEK2 is used to encrypt the content-encryption key.

 

KEK1 is not actually used to encrypt anything, but it allows existing DH and ECDH implementations to used without any modification.

 

I think this also makes it very clear why KEK1 and KEK2 ought to be the same size.

 

Russ