Re: [COSE] Barry Leiba's Yes on draft-ietf-cose-hash-algs-04: (with COMMENT)

Jim Schaad <ietf@augustcellars.com> Tue, 02 June 2020 19:16 UTC

Return-Path: <ietf@augustcellars.com>
X-Original-To: cose@ietfa.amsl.com
Delivered-To: cose@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id DC4D53A0F8C; Tue, 2 Jun 2020 12:16:58 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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 cQ2gzTMiYeNM; Tue, 2 Jun 2020 12:16:56 -0700 (PDT)
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 DC04D3A0F79; Tue, 2 Jun 2020 12:16:55 -0700 (PDT)
Received: from Jude (73.180.8.170) by mail2.augustcellars.com (192.168.0.56) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 2 Jun 2020 12:16:50 -0700
From: Jim Schaad <ietf@augustcellars.com>
To: 'Barry Leiba' <barryleiba@computer.org>, 'The IESG' <iesg@ietf.org>
CC: draft-ietf-cose-hash-algs@ietf.org, cose-chairs@ietf.org, cose@ietf.org, 'Ivaylo Petrov' <ivaylo@ackl.io>
References: <159107239537.28693.16065000145824637198@ietfa.amsl.com>
In-Reply-To: <159107239537.28693.16065000145824637198@ietfa.amsl.com>
Date: Tue, 02 Jun 2020 12:16:48 -0700
Message-ID: <006201d63912$5e7663e0$1b632ba0$@augustcellars.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Outlook 16.0
Content-Language: en-us
Thread-Index: AQGAFY4lrc4Y2TOVahTQsjcD5477ZKlx5COw
X-Originating-IP: [73.180.8.170]
Archived-At: <https://mailarchive.ietf.org/arch/msg/cose/rowQI1_t5YQ6qKcLeBl99wYtiEQ>
Subject: Re: [COSE] Barry Leiba's Yes on draft-ietf-cose-hash-algs-04: (with COMMENT)
X-BeenThere: cose@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: CBOR Object Signing and Encryption <cose.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/cose>, <mailto:cose-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/cose/>
List-Post: <mailto:cose@ietf.org>
List-Help: <mailto:cose-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/cose>, <mailto:cose-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 02 Jun 2020 19:17:05 -0000


-----Original Message-----
From: Barry Leiba via Datatracker <noreply@ietf.org> 
Sent: Monday, June 1, 2020 9:33 PM
To: The IESG <iesg@ietf.org>
Cc: draft-ietf-cose-hash-algs@ietf.org; cose-chairs@ietf.org; cose@ietf.org; Ivaylo Petrov <ivaylo@ackl.io>; ivaylo@ackl.io
Subject: Barry Leiba's Yes on draft-ietf-cose-hash-algs-04: (with COMMENT)

Barry Leiba has entered the following ballot position for
draft-ietf-cose-hash-algs-04: Yes

When responding, please keep the subject line intact and reply to all email addresses included in the To and CC lines. (Feel free to cut this introductory paragraph, however.)


Please refer to https://www.ietf.org/iesg/statement/discuss-criteria.html
for more information about IESG DISCUSS and COMMENT positions.


The document, along with other ballot positions, can be found here:
https://datatracker.ietf.org/doc/draft-ietf-cose-hash-algs/



----------------------------------------------------------------------
COMMENT:
----------------------------------------------------------------------

— Abstract —

   There are however circumstances where
   hash algorithms are used, such as indirect signatures where the hash
   of one or more contents are signed, and X.509 certificate or other
   object identification by the use of a fingerprint.

I found this hard to parse, and had to read it a few times.  How about this?:

NEW
   There are, however, circumstances where
   hash algorithms are used, such as in indirect signatures, where the hash
   of some content is signed, and for fingerprinting of X.509 certificates or
   other objects.
END

[JLS] I have a bit of a problem with this.  If you look at things correctly then almost all of the current signature algorithms would fit this, but it does not match what I am trying to say.  ECDSA hashes a content and then computes the signature math on that hash value.  This is not what we want to call an indirect signature even though it could be considered to be one.  This is as oppose to Pure EdDSA where the entire content (with modifications) is hashed internally to the signature code.  How about

"where the content to be signed contains the hash of one or more external object,"

— Introduction —

   This omission was intentional as a structure consisting of
   just a digest identifier, the content, and a digest value does not by
   itself provide any strong security service.

Nit: this needs a few more commas... one after “intentional”, and one before and one after “by itself”.
[JLS] Done

   One of the primary things that has been identified by a hash
   function for secure message is a certificate.

Another that I had trouble parsing.  Maybe, “One of the primary things related to secure messages that has been identified by a hash function is a certificate.”

[JLS] How about "Many applications use the hash of a certificate to replace the certificate itself, this allows for uniquely identifying the certificate while using fewer bytes."

— Section 2 —

   hash functions is part of the base design as cryptographic advances
   are sure to reduce the strength of a hash function.

Nit: this needs a comma after “design”.
[JLS] Done

   The standard "Collision Attack" is one where an attacker can
   find two different messages that have the same hash value.  If a
   collision attack exists, then the function SHOULD NOT be used for a
   cryptographic purpose.

I’m uncomfortable with having this document give a brief tutorial on cryptographic hashing, as it has to be oversimplified... and it is.  If it’s going to stay, I’d like to see ar least one minor change, though I’ll defer to the Sec ADs on this point: for any hash alg, it is always possible to encounter a collision, and the text isn’t clear about what “if a collision attack exists”
really means.  I think it means not to use it if a collision attack is practical, and maybe this is a better way to say it?:

NEW
   A "collision attack" is one where an attacker can
   find two different messages that have the same hash value.  A
   hash function that is susceptible to collision attacks, SHOULD
   NOT be used for cryptographic purposes.
END

[JLS] Done.  Given how fast we are at getting hash algorithms changed, I don't know that the trigger I would use is that the attack is practical.  Just the ability to find a collision at all is the trigger that we need to start changing the hash algorithms we are using.  People have talked about SHA-1 collisions for the last twenty years, but only in the last two have they become practical.  Should we be suggesting the SHOULD earlier than 2017?

   checked to see if they are the correct one.

“They are the correct one?”  Oof.  How about, “to find the correct one,” or (maybe better), “to see if they are suitable.”?
[JLS] How about "An example of a non-cryptographic use of a hash is for filtering from a collection of values to find a set of possible candidates, the candidates can then be check to see if they can successfully be used."

   If the fingerprint is
   used to verify that it is the correct certificate, then that usage is
   subject to a collision attack as above.  If however, the fingerprint
   is used to sort through a collection of certificates

“then that usage is a cryptographic one and is subject to the warning above about collision attacks.”  And “however” also needs a comma before it, as well as after.
[JLS] Done

   In this case, one still needs to
   validate that the public key validates the signature

Make the first “validate” say “confirm” instead, to avoid the awkward double use of “validate”.
[JLS] Done

   To distinguish between these two cases, a new value in the
   recommended column of the COSE Algorithms registry is to be added.
   "Filter Only" indicates that the only purpose of a hash function
   should be to filter results and not those which require collision
   resistance.

Might it be better to have the new column be called “cryptographic use”, with values of “yes” and “no”?  Hint: I think it would.  Hint#2: this is a non-blocking comment, so you might disagree.
[JLS] I did think about this, the issue is that I do not know what the correct value would be to place in that column for "AES-GCM-128".  The table has things which are not hash algorithms.

— Section 2.1 —

   *  Additional data, this can be something as simple as a random value

Nit: make the comma a semicolon.
[JLS] Done

      appending to the content, but it is strongly suggested to it

Nit: change “to it” to “that it”.
[JLS] Done

— Section 3.1 —

   Because of the known issues for SHA-1 and the fact that is should no

Nit: change “that is” to “that it”.
[JLS] Done

— Section 3.2 —

      Locations that use this hash function
      need either to analysis the potential problems with having a
      collision occur, or where the only function of the hash is to
      narrow the possible choices.

Locations?  And do you mean to use “analysis” as a verb?  Maybe this?:

NEW
      Use of this hash function
      needs analysis of the potential problems with having a
      collision occur, or must be limited to where the function
      of the hash is non-cryptographic.
END
[JLS] Cleaner - done

— Section 3.3 —

   One of the benefits of this
   differences is that when computing a shorter SHAKE hash value

Nit: “difference”, singular.
[JLS] Done

— Section 5 —

   that need the cryptographic properties, i.e. collision resistance,
   and properties that correspond to possible object identification.

Collision resistance isn’t the only cryptographic property (there’s also, for example, preimage resistance), so change “i.e.” to “such as”.  This is another example of the hazard of trying to explain hashing in a simple document such as this one.
[JLS] Done

   This is
   the difference between collision resistance and second pre-image
   resistance.

If you have collision resistance, don’t you automatically have second preimage resistance?  What’s he point of mentioning second preimage resistance here, when you don’t mention it nor need it anywhere else?

[JLS] Looking at this, the two sentences do not really follow from what preceded it so I deleted the two sentences.  Yes a second preimage attack would imply a collision attack.  But looking at what Warren is having problems with, there is a difference between the originator of the message providing two different external objects which have the same hash value and an attacker trying to find a second external object that has the same hash value in order to get the bad firmware installed.

   are under constant attack and the strength of hash algorithms will be
   reduced over time.

I would say “the cryptographic strength”.
[JLS] Done.


Jim