Re: [lamps] Benjamin Kaduk's Discuss on draft-ietf-lamps-cms-mix-with-psk-06: (with DISCUSS and COMMENT)

Russ Housley <housley@vigilsec.com> Fri, 16 August 2019 18:09 UTC

Return-Path: <housley@vigilsec.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 078331200F4 for <spasm@ietfa.amsl.com>; Fri, 16 Aug 2019 11:09:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=unavailable 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 ORbRjAlDuKBx for <spasm@ietfa.amsl.com>; Fri, 16 Aug 2019 11:09:07 -0700 (PDT)
Received: from mail.smeinc.net (mail.smeinc.net [209.135.209.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3061E1200CD for <spasm@ietf.org>; Fri, 16 Aug 2019 11:09:07 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.smeinc.net (Postfix) with ESMTP id 213B4300B05 for <spasm@ietf.org>; Fri, 16 Aug 2019 13:49:49 -0400 (EDT)
X-Virus-Scanned: amavisd-new at mail.smeinc.net
Received: from mail.smeinc.net ([127.0.0.1]) by localhost (mail.smeinc.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id uT6r92WUJFlK for <spasm@ietf.org>; Fri, 16 Aug 2019 13:49:47 -0400 (EDT)
Received: from a860b60074bd.fios-router.home (unknown [138.88.156.37]) by mail.smeinc.net (Postfix) with ESMTPSA id 1FF42300ADA; Fri, 16 Aug 2019 13:49:47 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\))
From: Russ Housley <housley@vigilsec.com>
In-Reply-To: <156597611893.31967.2500700648100356711.idtracker@ietfa.amsl.com>
Date: Fri, 16 Aug 2019 14:09:03 -0400
Cc: IESG <iesg@ietf.org>, LAMPS WG <spasm@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <B73FED9C-8983-4CFE-AD66-E548CEEAD45B@vigilsec.com>
References: <156597611893.31967.2500700648100356711.idtracker@ietfa.amsl.com>
To: Ben Kaduk <kaduk@mit.edu>
X-Mailer: Apple Mail (2.3445.104.11)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/9yTqMyjCP5gu6oDK-yu_Jmj4JaI>
Subject: Re: [lamps] Benjamin Kaduk's Discuss on draft-ietf-lamps-cms-mix-with-psk-06: (with DISCUSS and COMMENT)
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: Fri, 16 Aug 2019 18:09:10 -0000

Ben:

Thanks for doing all of the reading necessary to raise this question.

I want to respond to the DISCUSS in this note.  I'll tackle the non-blocking comments is a separate message.

> ----------------------------------------------------------------------
> DISCUSS:
> ----------------------------------------------------------------------
> 
> I think we need to have a discussion about the abstract API for a
> KEY-DERIVATION instance and how that relates to what we need for a key
> combination operation.  In Section 5 we assume that we can use the
> HKDF terminology, but that doesn't seem to hold universally for
> KEY-DERIVATION; for example, while HKDF has IKM, salt, and info, PBKDF2
> (from RFC 3211 that AFAICT introduces keyDerivationalgorithm for CMS) is
> specified by RFC 2898 as taking just the input secret (password) and a
> salt, with no separate 'info' (and of course the different iteration
> count and PRF parameters needed for its construction).  I note (with
> chagrin, as sponsoring AD) that RFC 8619 says "PARAMS ARE absent" for
> the HKDF-based KEY-DERIVATION instances but is silent about how one is
> supposed to know what to pass for salt/info (the IKM we can perhaps
> assume will be obvious).
> 
> In short, should we be seeking to define a distinct key combination
> operation like KRB-FX-CF2 (RFC6113) rather than trying to repurpose key
> derivation?  Some KDFs support this fairly well, but it's not clear to
> me that it is a universal property.  For example, the proof in [H2019]
> seems to be assuming HKDF but this draft does not (as is clearly seen
> from the use of the X9.63 KDF in one of the examples).

NIST SP 800-56 Revision 1 offers this high-level interface to the KDF:

   KDF(Z, OtherInput)

  - Z: a byte string that represents the shared secret.  This ic called IKM in the HKDF terminology.

  - OtherInput includes:

   -- salt - a non-null (secret  or non-secret) byte string.
   
   -- L - a  positive  integer  that  indicates  the  length  (in  bits)  of  the  secret  keying  material to be derived.

   -- FixedInfo - a bit string of context-specific data that is appropriate for the relying key-establishment scheme.

I do not think that this very high level of API really solves your concern, but it did guide my thinking in writing the document.

The KDF algorithm identifier has this structure:

   AlgorithmIdentifier  ::=  SEQUENCE  {
        algorithm               OBJECT IDENTIFIER,
        parameters              ANY DEFINED BY algorithm OPTIONAL  }

The algorithm part lets us name many different KDFs.  As you point out, the examples in Appendix A and Appendix B use HKDF and X9.63 KDF.

Recent discussions in the LAMPS WG show a big bias against complex parameter strictures.  Instead, people have voiced a strong preference for an object identifier that names all of the options.  This leads to more object identifier assignments, but clear understanding of all options when one is chosen or negotiated.  The one exception is an initialization vector, where a fresh value is expected each time the algorithm is invoked.

So, in this document, I have defined a structure of the OtherInput portion of the NIST API.  If a particular KDF needs to use a value from that structure in a particular way, is can do so.  The document uses HKDF terminology.

If a KDF requires a salt, then it should be provided as a parameter.  I can certainly add that to the document.  I believe that KMAC128 and KMAC256 are algorithms that require a salt.

Russ