 1/draftietflampscmshashsig09.txt 20190918 14:13:10.856380571 0700
+++ 2/draftietflampscmshashsig10.txt 20190918 14:13:10.888381381 0700
@@ 1,19 +1,19 @@
INTERNETDRAFT R. Housley
Internet Engineering Task Force (IETF) Vigil Security
Intended Status: Proposed Standard
Expires: 10 February 2020 10 August 2019
+Expires: 18 March 2020 18 September 2019
Use of the HSS/LMS Hashbased Signature Algorithm
in the Cryptographic Message Syntax (CMS)

+
Abstract
This document specifies the conventions for using the Hierarchical
Signature System (HSS) / LeightonMicali Signature (LMS) hashbased
signature algorithm with the Cryptographic Message Syntax (CMS). In
addition, the algorithm identifier and public key syntax are
provided. The HSS/LMS algorithm is one form of hashbased digital
signature; it is described in RFC 8554.
@@ 79,87 +79,84 @@
This document specifies the conventions for using the Hierarchical
Signature System (HSS) / LeightonMicali Signature (LMS) hashbased
signature algorithm with the Cryptographic Message Syntax (CMS) [CMS]
signeddata content type. The LMS system provides a onetime digital
signature that is a variant of Merkle Tree Signatures (MTS). The HSS
is built on top of the LMS system to efficiently scale for a larger
numbers of signatures. The HSS/LMS algorithm is one form of hash
based digital signature, and it is described in [HASHSIG]. The
HSS/LMS signature algorithm can only be used for a fixed number of
 signing operations. The number of signing operations depends upon
 the size of the tree. The HSS/LMS signature algorithm uses small
 public keys, and it has low computational cost; however, the
 signatures are quite large. The HSS/LMS private key can be very
 small when the signer is willing to perform additional computation at
 signing time; alternatively, the private key can consume additional
 memory and provide a faster signing time. The HSS/LMS signatures
 [HASHSIG] are currently defined to use exclusively SHA256 [SHS].
+ signing operations with a given private key, and the number of
+ signing operations depends upon the size of the tree. The HSS/LMS
+ signature algorithm uses small public keys, and it has low
+ computational cost; however, the signatures are quite large. The
+ HSS/LMS private key can be very small when the signer is willing to
+ perform additional computation at signing time; alternatively, the
+ private key can consume additional memory and provide a faster
+ signing time. The HSS/LMS signatures [HASHSIG] are currently defined
+ to use exclusively SHA256 [SHS].
1.1. ASN.1
CMS values are generated using ASN.1 [ASN1B], using the Basic
Encoding Rules (BER) and the Distinguished Encoding Rules (DER)
[ASN1E].
1.2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here.
1.3. Motivation
 There have been recent advances in cryptanalysis and advances in the
 development of quantum computers. Each of these advances pose a
 threat to widely deployed digital signature algorithms.

 Recent advances in cryptoanalysis [BH2013] and progress in the
+ Recent advances in cryptanalysis [BH2013] and progress in the
development of quantum computers [NAS2019] pose a threat to widely
deployed digital signature algorithms. As a result, there is a need
to prepare for a day that cryptosystems such as RSA and DSA that
depend on discrete logarithm and factoring cannot be depended upon.
If largescale quantum computers are ever built, these computers will
be able to break many of the publickey cryptosystems currently in
use. A postquantum cryptosystem [PQC] is a system that is secure
against quantum computers that have more than a trivial number of
 quantum bits (qubits). It is open to conjecture when it will be
+ quantum bits (qubits). It is open to conjecture when it will be
feasible to build such computers; however, RSA, DSA, ECDSA, and EdDSA
are all vulnerable if largescale quantum computers come to pass.
 The HSS/LMS signature algorithm does not depend on the difficulty of
 discrete logarithm or factoring, as a result these algorithms are
 considered to be postquantum secure. One use of postquantum secure
 signatures is the protection of software updates, perhaps using the
 format described in [FWPROT], to enable deployment of software that
 implements new cryptosystems.
+ Since the HSS/LMS signature algorithm does not depend on the
+ difficulty of discrete logarithm or factoring, the HSS/LMS signature
+ algorithm is considered to be postquantum secure. One use of post
+ quantum secure signatures is the protection of software updates,
+ perhaps using the format described in [FWPROT], to enable deployment
+ of software that implements new cryptosystems.
2. HSS/LMS Hashbased Signature Algorithm Overview
Merkle Tree Signatures (MTS) are a method for signing a large but
fixed number of messages. An MTS system depends on a onetime
signature method and a collisionresistant hash function.
This specification makes use of the hashbased algorithm specified in
[HASHSIG], which is the Leighton and Micali adaptation [LM] of the
original LamportDiffieWinternitzMerkle onetime signature system
[M1979][M1987][M1989a][M1989b].
As implied by the name, the hashbased signature algorithm depends on
a collisionresistant hash function. The hashbased signature
 algorithm specified in [HASHSIG] currently uses only the SHA256 one
 way hash function [SHS], but it also establishes an IANA registry
 [IANALMS] to permit the registration of additional oneway hash
 functions in the future.
+ algorithm specified in [HASHSIG] uses only the SHA256 oneway hash
+ function [SHS], but it establishes an IANA registry [IANALMS] to
+ permit the registration of additional oneway hash functions in the
+ future.
2.1. Hierarchical Signature System (HSS)
The MTS system specified in [HASHSIG] uses a hierarchy of trees. The
Hierarchical Ntime Signature System (HSS) allows subordinate trees
to be generated when needed by the signer. Otherwise, generation of
the entire tree might take weeks or longer.
An HSS signature as specified in [HASHSIG] carries the number of
signed public keys (Nspk), followed by that number of signed public
@@ 195,22 +192,22 @@
the public key itself. Note that Nspk is the number of levels in the
hierarchy of trees minus 1.
2.2. LeightonMicali Signature (LMS)
Each tree in the system specified in [HASHSIG] uses the Leighton
Micali Signature (LMS) system. LMS systems have two parameters. The
first parameter is the height of the tree, h, which is the number of
levels in the tree minus one. The [HASHSIG] specification supports
five values for this parameter: h=5; h=10; h=15; h=20; and h=25.
 Note that there are 2^h leaves in the tree. The second parameter is
 the number of bytes output by the hash function, m, which is the
+ Note that there are 2^h leaves in the tree. The second parameter, m,
+ is the number of bytes output by the hash function, and it is the
amount of data associated with each node in the tree. The [HASHSIG]
specification supports only the SHA256 hash function [SHS], with
m=32. As a result, the [HASHSIG] specification supports five tree
sizes; they are identified as:
LMS_SHA256_M32_H5;
LMS_SHA256_M32_H10;
LMS_SHA256_M32_H15;
LMS_SHA256_M32_H20; and
LMS_SHA256_M32_H25.
@@ 298,29 +295,31 @@
The algorithm identifier for an HSS/LMS hashbased signatures is:
idalghsslmshashsig OBJECT IDENTIFIER ::= { iso(1)
memberbody(2) us(840) rsadsi(113549) pkcs(1) pkcs9(9)
smime(16) alg(3) 17 }
When this object identifier is used for an HSS/LMS signature, the
AlgorithmIdentifier parameters field MUST be absent (that is, the
parameters are not present; the parameters are not set to NULL).
 The signature value is a large OCTET STRING. The signature format is
 designed for easy parsing. Each format includes a counter and type
 codes that indirectly providing all of the information that is needed
 to parse the value during signature validation.
+ The signature value is a large OCTET STRING as described in Section 2
+ of this document. The signature format is designed for easy parsing.
+ The HSS, LMS, and LMOTS component of the signature value each format
+ include a counter and a type code that indirectly provide all of the
+ information that is needed to parse the value during signature
+ validation.
The signature value identifies the hash function used in the HSS/LMS
 tree. In [HASHSIG] only the SHA256 hash function [SHS] is
 supported, but it also establishes an IANA registry [IANALMS] to
 permit the registration of additional hash functions in the future.
+ tree. In [HASHSIG] uses only the SHA256 hash function [SHS], but it
+ establishes an IANA registry [IANALMS] to permit the registration of
+ additional hash functions in the future.
4. HSS/LMS Public Key Identifier
The AlgorithmIdentifier for an HSS/LMS public key uses the idalg
hsslmshashsig object identifier, and the parameters field MUST be
absent.
When this AlgorithmIdentifier appears in the SubjectPublicKeyInfo
field of an X.509 certificate [RFC5280], the certificate key usage
extension MAY contain digitalSignature, nonRepudiation, keyCertSign,
@@ 337,57 +336,56 @@
Note that the idalghsslmshashsig algorithm identifier is also
referred to as idalgmtshashsig. This synonym is based on the
terminology used in an early draft of the document that became
[HASHSIG].
The public key value is an OCTET STRING. Like the signature format,
it is designed for easy parsing. The value is the number of levels
in the public key, L, followed by the LMS public key.
 The HSS/LMS public key value can be summarized as:
+ The HSS/LMS public key value can be described as:
u32str(L)  lms_public_key
Note that the public key for the topmost LMS tree is the public key
of the HSS system. When L=1, the HSS system is a single tree.
5. Signeddata Conventions
As specified in [CMS], the digital signature is produced from the
message digest and the signer's private key. The signature is
computed over different values depending on whether signed attributes
are absent or present.
When signed attributes are absent, the HSS/LMS signature is computed
over the content. When signed attributes are present, a hash is
computed over the content using the same hash function that is used
in the HSS/LMS tree, and then a messagedigest attribute is
 constructed to contain the resulting hash value, and then the result
 of DER encoding the set of signed attributes (which MUST include a
 contenttype attribute and a messagedigest attribute, and then the
 HSS/LMS signature is computed over the DERencoded output. In
 summary:
+ constructed with the hash of the content, and then the HSS/LMS
+ signature is computed over the DERencoded set of signed attributes
+ (which MUST include a contenttype attribute and a messagedigest
+ attribute). In summary:
IF (signed attributes are absent)
THEN HSS_LMS_Sign(content)
ELSE messagedigest attribute = Hash(content);
HSS_LMS_Sign(DER(SignedAttributes))
When using [HASHSIG], the fields in the SignerInfo are used as
follows:
 digestAlgorithm MUST contain the oneway hash function used to in
 the HSS/LMS tree. In [HASHSIG], SHA256 is the only supported
 hash function, but other hash functions might be registered in
 the future. For convenience, the AlgorithmIdentifier for
 SHA256 from [PKIXASN1] is repeated here:
+ digestAlgorithm MUST contain the oneway hash function used in the
+ HSS/LMS tree. In [HASHSIG], SHA256 is the only supported hash
+ function, but other hash functions might be registered in the
+ future. For convenience, the AlgorithmIdentifier for SHA256
+ from [PKIXASN1] is repeated here:
mdasha256 DIGESTALGORITHM ::= {
IDENTIFIER idsha256
PARAMS TYPE NULL ARE preferredAbsent }
idsha256 OBJECT IDENTIFIER ::= { jointisoitut(2)
country(16) us(840) organization(1) gov(101) csor(3)
nistAlgorithms(4) hashalgs(2) 1 }
signatureAlgorithm MUST contain idalghsslmshashsig, and the
@@ 397,43 +395,45 @@
the signing operation as specified in [HASHSIG].
6. Security Considerations
Implementations MUST protect the private keys. Compromise of the
private keys may result in the ability to forge signatures. Along
with the private key, the implementation MUST keep track of which
leaf nodes in the tree have been used. Loss of integrity of this
tracking data can cause a onetime key to be used more than once. As
a result, when a private key and the tracking data are stored on non
 volatile media or stored in a virtual machine environment, care must
 be taken to preserve confidentiality and integrity.
+ volatile media or stored in a virtual machine environment, failed
+ writes, virtual machine snapshotting or cloning, and other
+ operational concerns must be considered to ensure confidentiality and
+ integrity.
When generating an LMS key pair, an implementation MUST generate each
key pair independently of all other key pairs in the HSS tree.
An implementation MUST ensure that a LMOTS private key is used to
generate a signature only one time, and ensure that it cannot be used
for any other purpose.
The generation of private keys relies on random numbers. The use of
inadequate pseudorandom number generators (PRNGs) to generate these
values can result in little or no security. An attacker may find it
much easier to reproduce the PRNG environment that produced the keys,
searching the resulting small set of possibilities, rather than brute
force searching the whole key space. The generation of quality
random numbers is difficult, and [RFC4086] offers important guidance
in this area.
The generation of hashbased signatures also depends on random
numbers. While the consequences of an inadequate pseudorandom
 number generator (PRNGs) to generate these values is much less severe
 than the generation of private keys, the guidance in [RFC4086]
+ number generator (PRNG) to generate these values is much less severe
+ than in the generation of private keys, the guidance in [RFC4086]
remains important.
When computing signatures, the same hash function SHOULD be used to
compute the message digest of the content and the signed attributes,
if they are present.
7. IANA Considerations
SMI Security for S/MIME Module Identifier (1.2.840.113549.1.9.16.0)
registry, change the reference for value 64 to point to this
@@ 615,24 +615,24 @@
SMimeCaps SMIMECAPS ::=
{ saHSSLMSHashSig.&smimeCaps, ... }
END
Acknowledgements
 Many thanks to Scott Fluhrer, Jonathan Hammell, Panos Kampanakis,
 John Mattsson, Jim Schaad, Sean Turner, Daniel Van Geest, Roman
 Danyliw, Dale Worley, and Joe Clarke for their careful review and
 comments.
+ Many thanks to Scott Fluhrer, Jonathan Hammell, Ben Kaduk, Panos
+ Kampanakis, Barry Leiba, John Mattsson, Jim Schaad, Sean Turner,
+ Daniel Van Geest, Roman Danyliw, Dale Worley, and Joe Clarke for
+ their careful review and comments.
Author's Address
Russ Housley
Vigil Security, LLC
516 Dranesville Road
Herndon, VA 20170
USA
EMail: housley@vigilsec.com