Re: [Cfrg] I-D Action: draft-irtf-cfrg-eddsa-08.txt

Ilari Liusvaara <ilariliusvaara@welho.com> Fri, 26 August 2016 05:40 UTC

Return-Path: <ilariliusvaara@welho.com>
X-Original-To: cfrg@ietfa.amsl.com
Delivered-To: cfrg@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 67F7512D09F for <cfrg@ietfa.amsl.com>; Thu, 25 Aug 2016 22:40:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.448
X-Spam-Level:
X-Spam-Status: No, score=-2.448 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.548] 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 hNFVoLzCnbiV for <cfrg@ietfa.amsl.com>; Thu, 25 Aug 2016 22:40:18 -0700 (PDT)
Received: from welho-filter3.welho.com (welho-filter3.welho.com [83.102.41.25]) by ietfa.amsl.com (Postfix) with ESMTP id 0B26D126579 for <cfrg@ietf.org>; Thu, 25 Aug 2016 22:40:17 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by welho-filter3.welho.com (Postfix) with ESMTP id 043E511238; Fri, 26 Aug 2016 08:40:16 +0300 (EEST)
X-Virus-Scanned: Debian amavisd-new at pp.htv.fi
Received: from welho-smtp1.welho.com ([IPv6:::ffff:83.102.41.84]) by localhost (welho-filter3.welho.com [::ffff:83.102.41.25]) (amavisd-new, port 10024) with ESMTP id 2SGHkjxwiZAM; Fri, 26 Aug 2016 08:40:15 +0300 (EEST)
Received: from LK-Perkele-V2 (87-100-177-32.bb.dnainternet.fi [87.100.177.32]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by welho-smtp1.welho.com (Postfix) with ESMTPSA id 87345C4; Fri, 26 Aug 2016 08:40:15 +0300 (EEST)
Date: Fri, 26 Aug 2016 08:40:05 +0300
From: Ilari Liusvaara <ilariliusvaara@welho.com>
To: Jim Schaad <ietf@augustcellars.com>
Message-ID: <20160826054005.hzdnq4h7w44z5vai@LK-Perkele-V2.elisa-laajakaista.fi>
References: <147160042450.24153.3490570099010698852.idtracker@ietfa.amsl.com> <DA93E216-3C40-465F-A580-4F31C9909355@gmail.com> <079801d1ff1c$58dcfd60$0a96f820$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <079801d1ff1c$58dcfd60$0a96f820$@augustcellars.com>
User-Agent: Mutt/1.6.2-neo (2016-08-21)
Sender: ilariliusvaara@welho.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/cfrg/t81-amVPePmFVoWMJsY_TiN8pjo>
Cc: cfrg@ietf.org
Subject: Re: [Cfrg] I-D Action: draft-irtf-cfrg-eddsa-08.txt
X-BeenThere: cfrg@irtf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: Crypto Forum Research Group <cfrg.irtf.org>
List-Unsubscribe: <https://www.irtf.org/mailman/options/cfrg>, <mailto:cfrg-request@irtf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cfrg/>
List-Post: <mailto:cfrg@irtf.org>
List-Help: <mailto:cfrg-request@irtf.org?subject=help>
List-Subscribe: <https://www.irtf.org/mailman/listinfo/cfrg>, <mailto:cfrg-request@irtf.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Aug 2016 05:40:20 -0000

On Thu, Aug 25, 2016 at 03:02:15PM -0700, Jim Schaad wrote:
> 
> 
> > -----Original Message-----
> > From: Cfrg [mailto:cfrg-bounces@irtf.org] On Behalf Of Yoav Nir
> > Sent: Thursday, August 25, 2016 2:07 PM
> > To: <cfrg@ietf.org> <cfrg@ietf.org>
> > Subject: Re: [Cfrg] I-D Action: draft-irtf-cfrg-eddsa-08.txt
> > 
> > Hi.
> > 
> > I’ve read this draft in the context of writing both RFC4492bis for TLS and draft-
> > nir-ipsecme-eddsa for IPsecME. So of course I’m mainly interested in selecting
> > the right variant for each key length. I’ll get back to that, bit first some things
> > that I found that I don’t think are clear enough:
> > 
> > Section 10.3 begins like this:
> >    Contexts can be used to separate uses of the protocol between
> >    different protocols (which is very hard to reliably do otherwise)
> > 
> > So I think you meant to separate uses of the *algorithm* between
> > different protocols.

Actually, uses of the same key between different protocols (of the level
that handle signatures).

These uses are actually very difficult to separate besides labeling
the key with the protocol it is used with (which sometimes is not an
option).
 
E.g. TLS server signatures and PKIX CSRs are signed by the same RSA or
ECDSA keypairs. No separation (nor can it reasonably be added), but
fortunately those don't seem to interact in nasty ways.

However, with some pairs that might use the same keys, one is not so
lucky... But best not to mix keys between protocols unless absolutely
necressary (given the problems signatures have).

> > The section proceeds to give some warnings about using contexts. The first
> > paragraph requires not to use parts of the message for the context, but prohibits
> > this with a SHOULD NOT. No explanation is given as to why not, nor in what
> > cases you would do so anyway (it is a SHOULD NOT rather than a MUST NOT).
> > The third paragraph is about percolating the context string through APIs which
> > currently do not have context parameters. That is pretty clear although I don’t
> > like the re-use of the word “protocol” at the very end. I think API is more
> > correct.
> > 
> > The second paragraph, I don’t understand:
> >       Contexts SHOULD NOT be used oppurtunistically, as that kind of use
> >       is very error-prone.  If contexts are used, one SHOULD require all
> >       signature schemes avaiable for use in that purpose support
> >       contexts.
> > 
> > What does that even mean? AFAIK EdDSA is the only scheme with contexts. So if
> > I plan to use EdDSA with context I SHOULD use contexts in, say, RSA? That can’t
> > work, so should I use contexts only when EdDSA is the only defined signature
> > algorithm for the protocol? I don’t think that’s what was meant.
> 
> The reading that I have from the text and which is enforced from other
> messages from Ilari is that he is saying don't use a context string unless
> all of the signature algorithms allow for the use of context strings. 
> So I believe that is exactly what is meant.

Right.

(Making contextualized RSA-based or ECDSA-based signature scheme is not
difficult).


> > Section 10.5 explains well the considerations for choosing between 25519 and
> > 448. It also makes the case for not using the pre-hashed version if it can be
> > avoided. Then there’s this text about contexts:
> >    Ed25519ctx and Ed448 have contexts.  However, this is balanced by the
> >    problems noted in section about contexts.
> >    On implementation front, Ed25519 is widely implemented, and has many
> >    high-quality implementations.  The others have much worse support.
> > 
> > I’m assuming that “section about contexts” is 10.3. Might be worth to clarify
> > that with a reference. And I’m guessing the problems noted are the ones in that
> > second paragraph, although I still don’t understand why it is error-prone.

It is not error-prone. Using contexts plays hell with interfaces (which are
usually not designed to take the new input).

> > So with all that in mind, which variants should I choose for TLS and IKE?
> > Obviously the pre-hashed variants are out, as there is a SHOULD NOT against
> > their use and neither TLS nor IKE sign any prohibitively large messages. These are
> > not like the multi-megabyte CRLs discussed recently on the curdle list. So it
> > comes down to contexts. Do I define some context strings like “IKEv2 Initiator
> > Sign”, “TLS Server Sign”, etc. Or do I use the non-context (or empty context)
> > versions because both protocols also support other signature schemes such as
> > RSA, DSA and ECDSA?
> 
> I wonder if the SHOULD NOT on pre-hash algorithms cannot be eased with the most
> recent updates to the document.

Ed25519ph is still problematic (in a different way now, an implementation
problem, not a security problem).

> At this point I am not sure that context strings are going to be useful.
> In the PKIX and CMS contexts I am planning on pushing the empty string or
> absent context.

Taking interfaces into account, contexts probably are pretty much useless.


-Ilari