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

Jim Schaad <ietf@augustcellars.com> Tue, 09 May 2017 20:18 UTC

Return-Path: <ietf@augustcellars.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 81AF612EAF7 for <curdle@ietfa.amsl.com>; Tue, 9 May 2017 13:18:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Level:
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=augustcellars.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 upd-oupVldV1 for <curdle@ietfa.amsl.com>; Tue, 9 May 2017 13:18:01 -0700 (PDT)
Received: from mail4.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 9C75512932A for <curdle@ietf.org>; Tue, 9 May 2017 13:18:00 -0700 (PDT)
Content-Type: multipart/alternative; boundary="----=_NextPart_000_0169_01D2C8C6.B1CE41D0"
Content-Language: en-us
DKIM-Signature: v=1; a=rsa-sha256; d=augustcellars.com; s=winery; c=simple/simple; t=1494361077; h=from:subject:to:date:message-id; bh=nCAmqRAX0fZtEHx63mODlQ1kubkQTaj6Q2FrZH/m5aw=; b=kCF57TyaKJVyDJQvMLoGE5s2GOBFCSeknUUUR1zV+NjtJCmrHufq3CZbDMmRDYZE3egwUcMNOVx jkHl9ANTvbbH9o3iFmiFzQjlqxGsrxZZySL6YCvxTF6mbNKvXj6y8c9fm8oyx3WmdP7s8dsk3p934 UJ0waS5/z4GgzLYsLvFK1EZ54KolIzGhCtIsnqHAmH+dFq2e0H2egFIzPsLCtltdAlNDaIoINZ6QB W67gwlazrShB3A/85yhpvuXsyjn868gRTpikKQZeYwC+0Svg4PkGKlvVs6sfSzOW80aNc+nX/qRiV iO/wL0ye5ouJ3rmdOfpCadzVjUYYoG7oFXmA==
Received: from mail2.augustcellars.com (192.168.1.201) by mail4.augustcellars.com (192.168.1.153) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 9 May 2017 13:17:55 -0700
Received: from Hebrews (24.21.96.37) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1263.5; Tue, 9 May 2017 13:17:43 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: 'Russ Housley' <housley@vigilsec.com>
CC: 'Eric Rescorla' <ekr@rtfm.com>, 'curdle' <curdle@ietf.org>
References: <CABcZeBPCGj81Br-=C4G4PPhB+vVLGwqi94q-vH1aZVs=MTQzng@mail.gmail.com> <B61A14BA-39DD-4929-8E08-AF7BF0CB9DFE@vigilsec.com> <CABcZeBMMWbGd=SSPmtBHE6XOCRSG8q3NqtJdaMQcK5uxHsqqTA@mail.gmail.com> <5EEB2415-61EF-4B6E-91CA-EE2EB7C3E087@vigilsec.com> <013101d2c8ec$586cd450$09467cf0$@augustcellars.com> <30A1145E-F049-454C-93AB-1445767BA67C@vigilsec.com>
In-Reply-To: <30A1145E-F049-454C-93AB-1445767BA67C@vigilsec.com>
Date: Tue, 09 May 2017 13:18:03 -0700
Message-ID: <016801d2c901$5e299760$1a7cc620$@augustcellars.com>
MIME-Version: 1.0
X-Mailer: Microsoft Outlook 16.0
Thread-Index: AQH9xBMcsIwTVYthAE2k4UvXwpKedQIe2gLjAVvwxw4CXdRt+QMS7ygCAmXEUp6hO+1AgA==
X-Originating-IP: [24.21.96.37]
Archived-At: <https://mailarchive.ietf.org/arch/msg/curdle/bucCQpvvUZ5P09SlCTKIGqwYMEQ>
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 20:18:05 -0000

 

 

From: Russ Housley [mailto:housley@vigilsec.com] 
Sent: Tuesday, May 9, 2017 12:36 PM
To: Jim Schaad <ietf@augustcellars.com>
Cc: Eric Rescorla <ekr@rtfm.com>; curdle <curdle@ietf.org>
Subject: Re: [Curdle] AD Review: draft-ietf-curdle-cms-ecdh-new-curves-04.txt

 

 

On May 9, 2017, at 1:47 PM, Jim Schaad <ietf@augustcellars.com <mailto:ietf@augustcellars.com> > wrote:

 

See inline.

 

From: Curdle [ <mailto:curdle-bounces@ietf.org> mailto:curdle-bounces@ietf.org] On Behalf Of Russ Housley
Sent: Tuesday, May 9, 2017 9:04 AM
To: Eric Rescorla < <mailto:ekr@rtfm.com> ekr@rtfm.com>
Cc: curdle < <mailto:curdle@ietf.org> curdle@ietf.org>
Subject: Re: [Curdle] AD Review: draft-ietf-curdle-cms-ecdh-new-curves-04.txt

 

I dropped the parts that have been resolved.






> 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 text above, which I gather is about some existing implementations, probably libraries.  I do not know what protocols use those implementations, but if they are libraries they will get used with many different protocols.

 

[JLS] As I have stated in the past – I am with EKR on this.

 

Previously, only Jim had posted in support for this check.  I will change the SHOULD to a MUST.









>    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|).

 

Yes. The umm value needs to be different for each invocation of the KDF, otherwise it does not provide the assurance that different keying material will be produced.  Of course, an implementation will generate the umm value using random number generator, not track the values that are used.  Several years ago, there was a discussion about the size of the ukm needed.  Some people were suggesting crazy large values, and the point was made that anything beyond the SIZEOF(KEK) did not improve security.

 

Are you asking for a sentence saying that the ukm, if present, MUST be at least 128 bits?

 

[JLS] I would disagree that the value has to be random, a counter will work as well.  (An encrypted counter is better.)  I not be happy with a fixed size requirement on this easier.  There is no reason to make such a requirement that I can think of.  A 64-bit counter is just as rational.  It might make more sense to change this statement into something along the lines of 

 

* Any pair of static keys MUST NOT be used more times than the size of the key.  I.e. if 128-bit KEKs may be used, then there is a 2^128 limit on the number of times the key pair can be used.

* The size of the KEK is normally not longer than the length of the resulting KEK as that is the limit of unique values that can be generated in any event.

 

Section 2 already says that the ephemeral key MUST be used for only one message.  Thus, a UKM is not really needed.  However, the CMS requires support for a UKM if the sender include it.  For this reason, the document says how to handle it in the KDF if it is present.

 

You are correct that a counter, encrypted counter, or random value will work, even if the originator uses the same ephemeral key for many messages.  The text does not limit the choices in any way.

 

The text already says that there is no security reason for a UKM value that is longer than the KEK.  I think that EKR is asking for guidance on the minimum size too.

 

[JLS] It’s kind of a stupid thing to do, but the minimum size would be one bit.  Although this is not legal from an ASN.1 standpoint – so the minimum would be one byte. 

 

A single byte with all bits zero and two bytes with all bits zero are different ukm values because of the way that they are used in the ECC-CMS-SharedInfo structure.  Note that this would not be the case if the ukm value was only used as a salt value to HKDF.  I do not see any reason to specify a minimum length of this value.  The only thing that is required is uniqueness, EKR is correct about saying this. 

 

 

Russ