Re: [Curdle] AD Review: draft-ietf-curdle-cms-ecdh-new-curves-04.txt

Eric Rescorla <ekr@rtfm.com> Tue, 09 May 2017 00:12 UTC

Return-Path: <ekr@rtfm.com>
X-Original-To: curdle@ietfa.amsl.com
Delivered-To: curdle@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4D46A12778D for <curdle@ietfa.amsl.com>; Mon, 8 May 2017 17:12:43 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.598
X-Spam-Level:
X-Spam-Status: No, score=-2.598 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=rtfm-com.20150623.gappssmtp.com
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 RVwTcWQbDMjD for <curdle@ietfa.amsl.com>; Mon, 8 May 2017 17:12:42 -0700 (PDT)
Received: from mail-yw0-x235.google.com (mail-yw0-x235.google.com [IPv6:2607:f8b0:4002:c05::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id E1960127601 for <curdle@ietf.org>; Mon, 8 May 2017 17:12:41 -0700 (PDT)
Received: by mail-yw0-x235.google.com with SMTP id 203so37301569ywe.0 for <curdle@ietf.org>; Mon, 08 May 2017 17:12:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rtfm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zxPBC4Wme6eBz2A8vHt7kZpr5uhfrB29TxN9u+HPW/I=; b=IqbpQz8JkWe72X2dpF3hyTlWCfzJds2gzbQsrY/ALu+rN5KVACLWojMM8ys4AiDYvr Dhyzm/dNRreBvqQ1rhAzXG4bSPQwb5pIbx86cCxxKd84vIv0XRx/Z5YKkwo/IcY84ynW uWyWJLiyYwwEW3CXfGX4DDyjxkSykbWYsUQzxBgYNP3+aG4anyUZvzPW/3R4h7rNA1Ez 4qqnAHZ8frNjFtdmRZfXu4lA6k/qeFrUyin2yNALHe/Ua9p1EgcqynSd2oMU7zYWD4pC ttKi1wN5E2/P3nPVaK8eY1Ghg4TsMkbCYtzJdnNW9CjUEU2930MIY1zBaOdpzie29Voj 3hEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zxPBC4Wme6eBz2A8vHt7kZpr5uhfrB29TxN9u+HPW/I=; b=fYX3Zqwh+VTTNkoY5m+iXVm2Yrik5ZnaVAdA06RPjsDMJJzmw5HUgY03pVUCEDbRh+ kAL2/eFRcgJKxc/+Q+6N7UcU2IacOZ+eVYbAU5X4s6K4kzwrBZbM2CifPSqdx2NbZlNa +I/ckaV7iy2fVH/4o5qJyXXl51g9rTZnBcAh5LtGvCf2XAwtPTqzaoDA8ceIuYZxmsAS 1/oK1yQm0V166C9/8FXDgrqZWDI6F7dz1lRd/abC1ADeUzeUaeS+TD49wQce8muRCKgo FvXAYjDaddcdO99dFa2xs+aNX/hpkwJBdTpw0iACPhlmISIdr5vniN6QkpevJef3rQcp 0zvA==
X-Gm-Message-State: AN3rC/44US/e6GEEakhhpsVCUv3GueMY/8QjLthHYVKLWEBcXVQ4yaLA 3ZN7yZnKX4ZlUvGVjqPYJ/uDoY4bh8Ir
X-Received: by 10.129.104.69 with SMTP id d66mr22921512ywc.74.1494288761051; Mon, 08 May 2017 17:12:41 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.129.131.150 with HTTP; Mon, 8 May 2017 17:12:00 -0700 (PDT)
In-Reply-To: <B61A14BA-39DD-4929-8E08-AF7BF0CB9DFE@vigilsec.com>
References: <CABcZeBPCGj81Br-=C4G4PPhB+vVLGwqi94q-vH1aZVs=MTQzng@mail.gmail.com> <B61A14BA-39DD-4929-8E08-AF7BF0CB9DFE@vigilsec.com>
From: Eric Rescorla <ekr@rtfm.com>
Date: Mon, 08 May 2017 17:12:00 -0700
Message-ID: <CABcZeBMMWbGd=SSPmtBHE6XOCRSG8q3NqtJdaMQcK5uxHsqqTA@mail.gmail.com>
To: Russ Housley <housley@vigilsec.com>
Cc: curdle <curdle@ietf.org>
Content-Type: multipart/alternative; boundary="001a11490b9acc066d054f0c3659"
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/21AVEGkqCEL8_HOz2ZiZ6fbbLU8>
Subject: Re: [Curdle] AD Review: draft-ietf-curdle-cms-ecdh-new-curves-04.txt
X-BeenThere: curdle@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: "List for discussion of potential new security area wg." <curdle.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/curdle>, <mailto:curdle-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/curdle/>
List-Post: <mailto:curdle@ietf.org>
List-Help: <mailto:curdle-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/curdle>, <mailto:curdle-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 09 May 2017 00:12:43 -0000

On Sat, May 6, 2017 at 2:27 PM, Russ Housley <housley@vigilsec.com> wrote:

> Eric:
>
> > OVERALL
> > I see a bunch of quasi-normative text here, e.g.,
> >
> >    [CURVES].  Those other curves are not deprecated, but support for
> >    curve25519 and curve448 is encouraged.
> >
> > Can you use RFC 2119 language here?
>
> The text says that other curves are not deprecated, but it is encouraging
> support for X25519 and X448.  We know that there are some communities that
> are not ready to embrace the CFRG curves over the NIST curves.  So, I’d
> rather drop the second half of the sentence than change it to RFC 2119
> language.
>

OK.


> TECHNICAL
> > S 2.
> >    X25519 is described in Section 6.1 of [CURVES], and X448 is described
> >    in Section 6.2 of [CURVES].  Since curve25519 and curve448 have
> >    cofactors of 8 and 4, respectively, an input point of small order
> >    will eliminate any contribution from the other party’s private key.
> >    As described in Section 7 of [CURVES], implementations SHOULD detect
> >    this situation by checking for the all-zero output.
> >
> > Why are you not requiring this check? SSH and TLS both do.
>
> RFC 7748 [CURVES] says:
>
>    Protocol designers using Diffie-Hellman over the curves defined in
>    this document must not assume "contributory behaviour".  Specially,
>    contributory behaviour means that both parties' private keys
>    contribute to the resulting shared key.  Since curve25519 and
>    curve448 have cofactors of 8 and 4 (respectively), an input point of
>    small order will eliminate any contribution from the other party's
>    private key.  This situation can be detected by checking for the all-
>    zero output, which implementations MAY do, as specified in Section 6.
>    However, a large number of existing implementations do not do this.
>
> We upgraded the MAY to a SHOULD.  We are being told that some
> implementations will not perform this check, so it seemed wrong to go all
> the way to MUST.
>

I'd like to push on this some, because I'm having trouble seeing why
different IETF protocols have different needs. When you say "you are being
told" is that an S/MIME specific point or merely the the text above?




>
> >    The ECC-CMS-SharedInfo entityUInfo field optionally contains
> >    additional keying material supplied by the sending agent.  Note that
> >    [CMS] requires implementations to accept a KeyAgreeRecipientInfo
> >    SEQUENCE that includes the ukm field.  If the ukm field is present,
> >    the ukm is placed in the entityUInfo field.  The ukm value need not
> >    be longer than the key-encryption key that will be produced by the
> >    KDF.
> >
> > Need not? Please clarify what the purpose is here. It seems like
> > it's to generate a unique KEK. In that case, the security bounds
> > are what, uniqueness?
>
> I suggest this wording:
>
>    … There is no security benefit to using a ukm value that is
>    longer than the key-encryption key that will be produced by
>    the KDF.
>

Hmm... I believe that this statement is true, but it also seems to be
incomplete. I may be reasoning about this incorrectly, but it seems
to me that the minimal security requirement is that the UKM be
unique, but that can be achieved with a value much smaller than
the KEK. For instance, it seems like if you have a 256-bit KEK,
then you would still be OK with a randomly-generated 128-bit
UKM. And if we're concerned about random collisions, then the
usefulness bound is actually min(|KEK|, |hash compression function size|).



> > S 9.
> > This section is kinda diffident about whether the sender's
> > ephemeral is truly ephemeral. Is this a MUST? If so, please
> > say so.
>
> Section 2 already explains that the originator uses an ephemeral key pair.
>

Yes, but it doesn't have any normative language (see above on this topic).


> Appendix:
> > How many people have checked this ASN.1 module?
>
> At least two people have compiled it with different toolsets.
>
> > EDITORIAL
> > S 2.
> > Please put KEK in parentheses in your first use.
>
> In most places, it is spelled out.  I added (KEK) to the first place, and
> left it in the other places.


SGTM.



>
> > S 3.
> > It would be easier to put this above the key derivation stage.
>
> I followed the outline used in other specifications.  I figures that the
> implementers were fine with the previous outline.
>
> > Please provide some sort of reference or cross-reference for
> > “kari"
>
> The kari is defined in [CMS] as one of the choices in RecipientInfo.  I
> think that is clear from the sentence.
>

Yeah, I didn't find it super-clear. How about quoting it.

-Ekr


>
> >    KeyAgreeRecipientInfo ukm is optional.  Note that [CMS] requires
> >    implementations to accept a KeyAgreeRecipientInfo SEQUENCE that
> >    includes the ukm field.  If present, the ukm is placed in the
> >    entityUInfo field of the ECC-CMS-SharedInfo as input to the KDF.  The
> >    ukm value need not be longer than the key-encryption key produced by
> >    the KDF.
> >
> > This seems to be duplicated.
>
> Yes.  I rewrote the text in Section 3.2 to point back to the earlier text.
>
> > S 5.
> > This also seems to be largely duplicated. Can you refactor out
> > the common stuff.
>
> Because the content type is different, I think I already reduced it to the
> minimum.
>
> Russ
>
>