Subject: Re: [smime] Fwd: Last Call: <draft-schaad-smime-algorithm-attribute-03.txt> (SignerInfo Algorithm Protection Attribute) to Proposed Standard

From: "Denis Pinkas"<[email-masked]>
Date: Fri, 17 Dec 2010 09:23:11 +0100

I have a few comments about draft-schaad-smime-algorithm-attribute-03.txt:

1) The key question is what should contain the field signatureAlgorithm ?

SignatureAlgorithmIdentifier is defined in section 10.1.2 from RFC 5652:

10.1.2.  SignatureAlgorithmIdentifier

   The SignatureAlgorithmIdentifier type identifies a signature
   algorithm, and it can also identify a message digest algorithm.
   Examples include RSA, DSA, DSA with SHA-1, ECDSA, and ECDSA with
   SHA-256.  A signature algorithm supports signature generation and
   verification operations.  The signature generation operation uses the
   message digest and the signer's private key to generate a signature
   value.  The signature verification operation uses the message digest
   and the signer's public key to determine whether or not a signature
   value is valid.  Context determines which operation is intended.

      SignatureAlgorithmIdentifier ::= AlgorithmIdentifier

Some examples are questionable: is RSA really a "signature algorithm" ?
sha-1withRSA is really a signature mechanism, since it cannot be used for encryption.

If "real signature algorithms" were being used in the OID, then half of the problems mentioned in the draft would disappear.
This case should be mentioned in the draft.
 
The draft should also recommend the use of signature algorithms using both a hash function and an asymetric algorithm.

2) We come from a point where, 20 years ago, the same certificate was used for three purposes: 
authentication, non repudiation and encipherment. RSA was the single algorithm used in practice.
Since then, there are many situations where different certificates are used for each purpose.

We now should recommend to use "real signature algorithms", which mean an OID specifying 
a combination of a hash function and an asymetric cryptographic algorithm.

If a certificate is being used, then an OID specifying the algorithm in the certificate should be OID 
specifying a combination of a hash function and an asymetric cryptographic algorithm.

When certificates are being used, when the ESSCertID is being used, and when "real signature algorithms" are being used
then the new proposed protection attribute is not needed.

The current draft does not mention this possibility.

3) There is another draft under discussion in the PKIX WG called: draft-ietf-pkix-ocspagility-09.

Although the field "certIdentifier" below is misnamed, the idea is to say that for Elliptic Curves we need two parameters 
instead of one. This is what the proposed draft is attempting to say:
     PreferredSignatureAlgorithm ::= SEQUENCE {        sigIdentifier   AlgorithmIdentifier,        certIdentifier  AlgorithmIdentifier OPTIONAL        }

   The syntax of AlgorithmIdentifier is defined in section 4.1.1.2 of   RFC 5280 [RFC5280]

   sigIdentifier specifies the signature algorithm the client prefers,   e.g. algorithm=ecdsa-with-sha256. Parameters are absent for most   common signature algorithms.

   certIdentifier specifies the subject public key algorithm identifier   the client prefers in the server's certificate used to validate the   OCSP response. e.g. algorithm=id-ecPublicKey and parameters=   secp256r1.

   certIdentifier is OPTIONAL and provides means to specify parameters   necessary to distinguish among different usages of a particular   algorithm, e.g. it may be used by the client to specify what curve it   supports for a given elliptic curve algorithm.
Note the this draft provides a correct example for a signature algorithm identifier: ecdsa-with-sha256
The draft proposed by Jim should consider the case of OIDs for Elliptic Curves 

4) The draft is missing a risk analysis or examples for real possibilities of substitution. 

For the above reasons, I believe that a new draft should be issued.

Denis

---------- 
>From : smime-bounces 
To : smime 
Date : 2010-12-06, 23:43:50
Subject : [smime] Fwd: Last Call: (SignerInfo Algorithm Protection Attribute) to Proposed Standard

-------- Original Message --------
Subject: Last Call: <draft-schaad-smime-algorithm-attribute-03.txt> 
(Signer Info Algorithm Protection Attribute) to Proposed Standard
Date: Mon, 06 Dec 2010 14:35:04 -0800
From: The IESG <[email-masked]>
To: IETF-Announce <[email-masked]>

The IESG has received a request from an individual submitter to consider
the following document:
- 'Signer Info Algorithm Protection Attribute'
   <draft-schaad-smime-algorithm-attribute-03.txt> as a Proposed Standard

The IESG plans to make a decision in the next few weeks, and solicits
final comments on this action. Please send substantive comments to the
[email-masked] mailing lists by 2011-01-03. Exceptionally, comments may be
sent to [email-masked] instead. In either case, please retain the
beginning of the Subject line to allow automated sorting.

The file can be obtained via
http://datatracker.ietf.org/doc/draft-schaad-smime-algorithm-attribute/

IESG discussion can be tracked via
http://datatracker.ietf.org/doc/draft-schaad-smime-algorithm-attribute/

No IPR declarations have been submitted directly on this I-D.
_______________________________________________
IETF-Announce mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/ietf-announce

_______________________________________________
smime mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/smime

---

From: "Jim Schaad" <[email-masked]>
Date: Tue, 21 Dec 2010 20:07:12 -0800

Comments are inline.

From: [email-masked] [mailto:[email-masked]] On Behalf Of
Denis Pinkas
Sent: Friday, December 17, 2010 12:23 AM
To: ietf; smime; pkix
Subject: Re: [pkix] [smime] Fwd: Last Call:
<draft-schaad-smime-algorithm-attribute-03.txt> (SignerInfo Algorithm
Protection Attribute) to Proposed Standard

sha-1withRSA is really a signature mechanism, since it cannot be used for
encryption.

If "real signature algorithms" were being used in the OID, then half of the
problems mentioned in the draft would disappear.

The draft should also recommend the use of signature algorithms using both a
hash function and an asymetric algorithm.

[JLS] While I agree that perhaps draft should recommend the use a signature
algorithms (which are fully defined), I don't understand how this can
actually protect against the problems that are outlined.  If an attacker can
successfully substitute the signature identifier of ECDSA with SHA-256 for
ECDSA with SHA-1, and come up with a case where the signature actually
validates then there is no protection in the current specification.
Actually the case of using rsaEncryption does provide additional protection
since the internals of the v1.5 signature validation process checks that the
digest algorithm encoded inside of the signature value matches the digest
algorithm used to create the digest so in this case the fact that a full
signature algorithm identifier is not used there is additional protection.

In looking at the text from RFC5652 I believe that there is an errata that
could be issued.  The text "DSA with SHA-1" should have been "DSA with
SHA-256".  It is generally accepted that DSA, when not qualified requires
the SHA-1 algorithm and thus is a fully specified signature algorithm.  I
would argue that the same is true for ECDSA.  Thus of the listed set, only
RSA can be considered not to be a fully specified signature algorithm, but
it has internal specification of the hash algorithm.

If new signature algorithms are created with random values as part of the
input, then there would be no protection as the random value would not be
protected.  A number of changes to hash functions has been suggested where
this might be the case.

2) We come from a point where, 20 years ago, the same certificate was used
for three purposes: 
authentication, non repudiation and encipherment. RSA was the single
algorithm used in practice.

Since then, there are many situations where different certificates are used
for each purpose.

We now should recommend to use "real signature algorithms", which mean an
OID specifying 
a combination of a hash function and an asymetric cryptographic algorithm.

If a certificate is being used, then an OID specifying the algorithm in the
certificate should be OID 
specifying a combination of a hash function and an asymetric cryptographic
algorithm.

When certificates are being used, when the ESSCertID is being used, and when
"real signature algorithms" are being used
then the new proposed protection attribute is not needed.

[JLS] The view you are espousing here, that certificates should be
restricted in the algorithm that they can be used for, is not one that is
broadly accepted in either the S/MIME or PKIX communities.  Since that is
the case I don't think that this would address the problems outlined.  I do
however agree that this can be mentioned as one way of addressing part of
the problem statement.

3) There is another draft under discussion in the PKIX WG called:
draft-ietf-pkix-ocspagility-09.

Although the field "certIdentifier" below is misnamed, the idea is to say
that for Elliptic Curves we need two parameters 
instead of one. This is what the proposed draft is attempting to say:

     PreferredSignatureAlgorithm ::= SEQUENCE {
        sigIdentifier   AlgorithmIdentifier,
        certIdentifier  AlgorithmIdentifier OPTIONAL
        }
 
   The syntax of AlgorithmIdentifier is defined in section 4.1.1.2 of
   RFC 5280 [RFC5280]
 
   sigIdentifier specifies the signature algorithm the client prefers,
   e.g. algorithm=ecdsa-with-sha256. Parameters are absent for most
   common signature algorithms.
 
   certIdentifier specifies the subject public key algorithm identifier
   the client prefers in the server's certificate used to validate the
   OCSP response. e.g. algorithm=id-ecPublicKey and parameters=
   secp256r1.
 
   certIdentifier is OPTIONAL and provides means to specify parameters
   necessary to distinguish among different usages of a particular
   algorithm, e.g. it may be used by the client to specify what curve it
   supports for a given elliptic curve algorithm.

Note the this draft provides a correct example for a signature algorithm
identifier: ecdsa-with-sha256

The draft proposed by Jim should consider the case of OIDs for Elliptic
Curves 

[JLS]  I need more guidance from you on what you think you need.  The curve
would be protected by the certificate itself.  The signature algorithm would
be protected by the proposed attribute.

4) The draft is missing a risk analysis or examples for real possibilities
of substitution. 

[JLS] I am currently looking at this in more detail.

Jim

Denis

---------- 

To : smime 

Subject : [smime] Fwd: Last Call: (SignerInfo Algorithm Protection
Attribute) to Proposed Standard

-------- Original Message --------
Subject: Last Call: <draft-schaad-smime-algorithm-attribute-03.txt> 
(Signer Info Algorithm Protection Attribute) to Proposed Standard
Date: Mon, 06 Dec 2010 14:35:04 -0800
From: The IESG <[email-masked] <mailto:[email-masked]>
To: IETF-Announce <[email-masked] <mailto:[email-masked]>

The IESG plans to make a decision in the next few weeks, and solicits
final comments on this action. Please send substantive comments to the
[email-masked] <mailto:[email-masked]>  mailing lists by 2011-01-03.
Exceptionally, comments may be
sent to [email-masked] <mailto:[email-masked]>  instead. In either case,
please retain the
beginning of the Subject line to allow automated sorting.

[email-masked] <mailto:[email-masked]> 

_______________________________________________
smime mailing list
[email-masked] <mailto:[email-masked]> 
https://www.ietf.org/mailman/listinfo/smime

---

From: Martin Rex <[email-masked]>
Date: Tue, 28 Dec 2010 19:56:47 +0100 (MET)

> sha-1withRSA is really a signature mechanism, since it cannot be used

Call it "evolutionary heritage" (from PKCS#7 1.5 -> SMIME/CMS)

From
       http://tools.ietf.org/html/rfc2315#section-9.2
to
       http://tools.ietf.org/html/rfc2630#section-5.3

there was a semantical change in the SignerInfo ASN.1 structure
for SignedData in that the element "digestEncryptionAlgorithm"
was respecified as "SignatureAlgorithmIdentifier".

So for historical reasons, RSA-based signatures use the
original DigestEncryptionAlgorithm sematics and the AlgId
RSA / rsaEncryption (1.2.840.113549.1.1.1)

while all other public key signature schemes use the newer CMS semantics
"SignatureAlgorithmIdentifier" and a signature AlgId that includes
a specific hash algorithm.  I notice that rfc2630 section 5.3 lists "DSS"
as an example value for SignatureAlgorithmIdentifier, but e.g. our
implementation of PKCS7 uses id_dsa_with_sha1 (1.2.840.10040.4.3)
--the only DSA-related OID defined in rfc2630.

http://tools.ietf.org/html/rfc2630#section-12.2.1

_not_ id_dsa (1.2.840.10040.4.1) which AFAIK is used for DSA _keys_
in X.509 certs and defined elsewhere.

-Martin