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

"Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com> Mon, 18 March 2019 20:54 UTC

Return-Path: <sfluhrer@cisco.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 18EC51310F0; Mon, 18 Mar 2019 13:54:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.501
X-Spam-Level:
X-Spam-Status: No, score=-14.501 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 zhp-IY7stPyO; Mon, 18 Mar 2019 13:54:48 -0700 (PDT)
Received: from rcdn-iport-6.cisco.com (rcdn-iport-6.cisco.com [173.37.86.77]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 98A6112798C; Mon, 18 Mar 2019 13:54:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=44512; q=dns/txt; s=iport; t=1552942488; x=1554152088; h=from:to:cc:subject:date:message-id:references: in-reply-to:mime-version; bh=e1jzevJWvjcwq9tVLXgkIwHZmNaDw9tJy4ImdApWNjM=; b=bDsZxraOOOSLNNarkYTE8DTqpLkkdAr7YDuwaxKB8KVHJamXp+hsAbJV ozlBKw/1gkgckYcTCizt2qyvKQEcEw02zuVaNO+YbRh7FFkR54voPJnwV LdGkpIxnWL2WGm7ZCMv6wwmPTFjx5/crjr8VUV9BAHHukYtn1I/e72F/V A=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AHAACbBJBc/5FdJa1jGQEBAQEBAQEBAQEBAQcBAQEBAQGBUwIBAQEBAQsBgQ5TL2iBAycKhAGVTZgxgXcECwEBGAEKhEkCF4RDIjYHDQEBAwEBCQEDAm0cDIVKAQEBBAEBIQpBCxACAQgOAwQBARoCBQEGAwICAiULFAkIAgQBDQUIgxuBEWQPqiWBL4owBYEvAYsvF4FAP4ERgxKDHgEBgWgHCR8oAoIqglcDik8GggOED4c6i1VfCQKTGyGTV4sHknsCERWBKCYHKoFWcBU7gmyCFRiIX4U/QTGBZ4VIgSyBHwEB
X-IronPort-AV: E=Sophos;i="5.58,494,1544486400"; d="scan'208,217";a="536957462"
Received: from rcdn-core-9.cisco.com ([173.37.93.145]) by rcdn-iport-6.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 18 Mar 2019 20:54:47 +0000
Received: from XCH-RTP-009.cisco.com (xch-rtp-009.cisco.com [64.101.220.149]) by rcdn-core-9.cisco.com (8.15.2/8.15.2) with ESMTPS id x2IKskI7008405 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 18 Mar 2019 20:54:47 GMT
Received: from xch-rtp-006.cisco.com (64.101.220.146) by XCH-RTP-009.cisco.com (64.101.220.149) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 18 Mar 2019 16:54:46 -0400
Received: from xch-rtp-006.cisco.com ([64.101.220.146]) by XCH-RTP-006.cisco.com ([64.101.220.146]) with mapi id 15.00.1473.003; Mon, 18 Mar 2019 16:54:45 -0400
From: "Scott Fluhrer (sfluhrer)" <sfluhrer@cisco.com>
To: Jim Schaad <ietf@augustcellars.com>, 'Daniel Van Geest' <Daniel.VanGeest@isara.com>, 'Russ Housley' <housley@vigilsec.com>
CC: 'SPASM' <spasm@ietf.org>, "draft-ietf-lamps-cms-hash-sig@ietf.org" <draft-ietf-lamps-cms-hash-sig@ietf.org>
Thread-Topic: [lamps] Question on draft-ietf-lamps-cms-hash-sig
Thread-Index: AdTalFpsRD6NOLyJSie3veGv+fJZHgA0TvYAAEMkC4AAGVrygAA3JamAAACpblAADKEagAAHN+ig
Date: Mon, 18 Mar 2019 20:54:45 +0000
Message-ID: <952bf1f7896c4a5194b6e9871e31252a@XCH-RTP-006.cisco.com>
References: <00d701d4da95$425dc1d0$c7194570$@augustcellars.com> <13C0F2A6-8D71-4B67-B53A-A706125D65BD@isara.com> <D745A123-6600-456D-A646-487A892AD4C9@vigilsec.com> <000101d4dcb6$0d34cdf0$279e69d0$@augustcellars.com> <10EB05CC-DD01-49CE-A702-9CFAB436F542@isara.com> <80b7f5bb2c344841b197247187ef2398@XCH-RTP-006.cisco.com> <008a01d4ddc7$ce7a29d0$6b6e7d70$@augustcellars.com>
In-Reply-To: <008a01d4ddc7$ce7a29d0$6b6e7d70$@augustcellars.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.98.2.51]
Content-Type: multipart/alternative; boundary="_000_952bf1f7896c4a5194b6e9871e31252aXCHRTP006ciscocom_"
MIME-Version: 1.0
X-Outbound-SMTP-Client: 64.101.220.149, xch-rtp-009.cisco.com
X-Outbound-Node: rcdn-core-9.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/spasm/4K7JnK0DedifCmKV-yeH6tkQygE>
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: Mon, 18 Mar 2019 20:55:03 -0000

From: Jim Schaad <ietf@augustcellars.com>
Sent: Monday, March 18, 2019 4:19 PM
To: Scott Fluhrer (sfluhrer) <sfluhrer@cisco.com>; 'Daniel Van Geest' <Daniel.VanGeest@isara.com>; 'Russ Housley' <housley@vigilsec.com>
Cc: 'SPASM' <spasm@ietf.org>; draft-ietf-lamps-cms-hash-sig@ietf.org
Subject: RE: [lamps] Question on draft-ietf-lamps-cms-hash-sig



From: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> On Behalf Of Scott Fluhrer (sfluhrer)
Sent: Monday, March 18, 2019 2:21 PM
To: Daniel Van Geest <Daniel.VanGeest@isara.com<mailto:Daniel.VanGeest@isara.com>>; Jim Schaad <ietf@augustcellars.com<mailto:ietf@augustcellars.com>>; 'Russ Housley' <housley@vigilsec.com<mailto:housley@vigilsec.com>>
Cc: 'SPASM' <spasm@ietf.org<mailto:spasm@ietf.org>>; draft-ietf-lamps-cms-hash-sig@ietf.org<mailto:draft-ietf-lamps-cms-hash-sig@ietf.org>
Subject: Re: [lamps] Question on draft-ietf-lamps-cms-hash-sig



From: Spasm <spasm-bounces@ietf.org<mailto:spasm-bounces@ietf.org>> On Behalf Of Daniel Van Geest
Sent: Monday, March 18, 2019 1:58 PM
To: Jim Schaad <ietf@augustcellars.com<mailto:ietf@augustcellars.com>>; 'Russ Housley' <housley@vigilsec.com<mailto:housley@vigilsec.com>>
Cc: 'SPASM' <spasm@ietf.org<mailto:spasm@ietf.org>>; draft-ietf-lamps-cms-hash-sig@ietf.org<mailto:draft-ietf-lamps-cms-hash-sig@ietf.org>
Subject: Re: [lamps] Question on draft-ietf-lamps-cms-hash-sig



On 2019-03-17, 7:39 AM, "Jim Schaad" <ietf@augustcellars.com<mailto:ietf@augustcellars.com>> wrote:

I don’t know what Jim is arguing.  I think that I am trying to say that there may be some language that is not clear at some point in the future although it is perfectly fine today (mostly).  I do not remember ever seeing any language in any of the hash signature documents that say that the same hash function should be used from top to bottom.  I also think that there will be some push in the not so near future to have some other hash functions be permitted because of things like the better efficiency of SHA-512 in many cases or the move to SHAKE as a different hash function.  I worry that this means that the same hash function may not be used from top to bottom in a hash signature key.  I also worry that my current code base does not have any way to get the parameters for the bottom of the tree and the same thing may be true for an HSM.  The top algorithms can be retrieved from the public key, but not the bottom algorithms.

My colleagues have had similar concerns and we have raised them privately.  But the fact that the parameters are encoded in a signature means you can still verify the signature regardless of whether the parameters are in the public key.  And since the parameters could theoretically be changed as trees are used up they can’t be encoded with the public key (unless the use of HSS in CMS/X.509 specified that the parameters can’t change, which would be okay with me).

Actually, there is text in the LMS draft (which is becoming an RFC Real Soon Now) specifically forbidding changing the parameters on the fly…

[JLS] So we have the ability to have different parameters at each level from the beginning, but one is not supposed to change them when a new subtree is created.  I don’t remember seeing that and will look

Here’s the text (at the end of section 6); the wording is slightly different from the current draft (due to AUTH48 edits), but the meaning is the same:

   A close reading of the HSS verification pseudocode would show that it
   would allow the parameters of the nontop LMS public keys to change
   over time; for example, the signer might initially have the 1-th LMS
   public key use the LMS_SHA256_M32_H10 parameter set, but when that
   tree is exhausted, the signer might replace it with an LMS public key
   that uses the LMS_SHA256_M32_H15 parameter set.  While this would
   work with the example verification pseudocode, the signer MUST NOT
   change the parameter sets for a specific level.  This prohibition is
   to support verifiers that may keep state over the course of several
   signature verifications.



As for it being the same for HSMs, they could encode the parameters with their private key & state however they like.  IMO we shouldn’t standardize how to encode the private key since that implies replicating or moving it around, which will invariably be done wrong causing state to be reused, allowing forgeries.

Jim


From: Russ Housley <housley@vigilsec.com<mailto:housley@vigilsec.com>>
Sent: Saturday, March 16, 2019 4:33 PM
To: Daniel Van Geest <Daniel.VanGeest@isara.com<mailto:Daniel.VanGeest@isara.com>>
Cc: Jim Schaad <ietf@augustcellars.com<mailto:ietf@augustcellars.com>>; draft-ietf-lamps-cms-hash-sig@ietf.org<mailto:draft-ietf-lamps-cms-hash-sig@ietf.org>; SPASM <spasm@ietf.org<mailto:spasm@ietf.org>>
Subject: Re: [lamps] Question on draft-ietf-lamps-cms-hash-sig

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<mailto: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