Re: [lamps] Question on draft-ietf-lamps-cms-hash-sig

Russ Housley <housley@vigilsec.com> Sat, 16 March 2019 23:33 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 3F83E130EE7 for <spasm@ietfa.amsl.com>; Sat, 16 Mar 2019 16:33:21 -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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001] 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 To7T-LR9jGzs for <spasm@ietfa.amsl.com>; Sat, 16 Mar 2019 16:33:18 -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 288BF124B0C for <spasm@ietf.org>; Sat, 16 Mar 2019 16:33:18 -0700 (PDT)
Received: from localhost (localhost [127.0.0.1]) by mail.smeinc.net (Postfix) with ESMTP id 53520300AA7 for <spasm@ietf.org>; Sat, 16 Mar 2019 19:15:00 -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 A9Cwx3hwDQsE for <spasm@ietf.org>; Sat, 16 Mar 2019 19:14:57 -0400 (EDT)
Received: from a860b60074bd.fios-router.home (unknown [138.88.156.37]) by mail.smeinc.net (Postfix) with ESMTPSA id EAB07300250; Sat, 16 Mar 2019 19:14:56 -0400 (EDT)
From: Russ Housley <housley@vigilsec.com>
Message-Id: <D745A123-6600-456D-A646-487A892AD4C9@vigilsec.com>
Content-Type: multipart/alternative; boundary="Apple-Mail=_5998D5AF-8389-4067-8244-5B3C81CC2BE6"
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
Date: Sat, 16 Mar 2019 19:33:13 -0400
In-Reply-To: <13C0F2A6-8D71-4B67-B53A-A706125D65BD@isara.com>
Cc: Jim Schaad <ietf@augustcellars.com>, "draft-ietf-lamps-cms-hash-sig@ietf.org" <draft-ietf-lamps-cms-hash-sig@ietf.org>, SPASM <spasm@ietf.org>
To: Daniel Van Geest <Daniel.VanGeest@isara.com>
References: <00d701d4da95$425dc1d0$c7194570$@augustcellars.com> <13C0F2A6-8D71-4B67-B53A-A706125D65BD@isara.com>
X-Mailer: Apple Mail (2.3445.102.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/MYgfz5Azd58UkY8SzqhvOhq8ft4>
Subject: Re: [lamps] Question on draft-ietf-lamps-cms-hash-sig
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: Sat, 16 Mar 2019 23:33:21 -0000

Daniel:

I believe that Jim is arguing that the same hash function should always be used for both the content and the HSS/LMS tree,

Russ


> On Mar 15, 2019, at 3:30 PM, Daniel Van Geest <Daniel.VanGeest@isara.com> wrote:
> 
> My thoughts,
>  
> On 2019-03-14, 2:39 PM, "Spasm on behalf of Jim Schaad" <spasm-bounces@ietf.org <mailto:spasm-bounces@ietf.org> on behalf of ietf@augustcellars.com <mailto:ietf@augustcellars.com>> wrote:
>  
> I was tossing together some code to look at producing some samples and I
> ended up with a pair of questions:
>  
> 1.  If I have a hash signature tree which uses multiple different hash
> algorithms in it, which of those hash algorithms am I to placed in the
> digestAlgorithm field?  For example, suppose that I am using an LMS type
> with a hash of SHAKE128 and an LMOTS type with a hash of SHA256.  Or as a
> different example, suppose that I have a two deep tree and the top level
> uses SHA512 in both places but the next level down uses SHAH256 in both
> places?  
>  
> RFC 5652 section 5.3 defines the digestAlgorithm member of SignerInfo as:
>       digestAlgorithm identifies the message digest algorithm, and any
>       associated parameters, used by the signer.  The message digest is
>       computed on either the content being signed or the content
>       together with the signed attributes using the process described in
>       Section 5.4.
>  
> In HSS, the hash algorithm used to digest the content is the one in the LMOTS type of the bottom-most tree.  The other hash algorithms are used to hash within the Merkle tree, or to hash the LMS public key of a lower tree.  So in both your examples the answer would be SHA256.
>  
> 2.  If there are signed attributes present, then it t required that the body
> digest algorithm match that of the hash signature tree or can it be
> different.  If it is different, is that not the value that should be placed
> in the digestAlgorithm field?  Consider digesting the body with SHA512, but
> only using SHA256 in the hash function on the assumption that the random
> field in the signing operation provides a higher level of security and thus
> a weak attempt is being made to match them together.  (I am sure that this
> is not the correct pairing for matching, just demonstrating a point.)
>  
> cms-hash-sigs says:
>       digestAlgorithm MUST contain the one-way hash function used to in
>          the HSS/LMS tree.
> This statement plus the one I quoted from RFC 5652 would imply that the body digest algorithm must match that of the HSS algorithm.
>  
> However, you are correct that the random field added during signing increases the collision resistance of the signature and so using the same algorithm to create the message-digest attribute in the signed attributes would reduce the collision resistance of the system.  If you wanted to allow a different hash algorithm in the signed attributes message digest, I think cms-hash-sigs would need to be modified to further specify signed-data conventions with/without signed attributes, similar to RFC 8419.
>  
> Daniel
>  
> Jim
>  
>  
> _______________________________________________
> Spasm mailing list
> Spasm@ietf.org <mailto:Spasm@ietf.org>
> https://www.ietf.org/mailman/listinfo/spasm <https://www.ietf.org/mailman/listinfo/spasm>