Signer Info Algorithm Protection AttributeSoaring Hawk ConsultingPO Box 675Gold BarWA98251ietf@augustcellars.comA new attribute is defined that allows for protection of the digest and signature algorithm structures in an authenticated data or a signer info structure. Using the attribute includes the algorithm defintion information in the integrity protection process.In the current definition of there are some fields that are not protected in the process of doing either a signature validation or an authentication validation. In this document a new signed or authenticated attribute is defined which permits these fields to be validated.Taking the SignerInfo structure from CMS, lets look at each of the fields for and discuss what is and is not protected by the signature. The ASN.1 is included here for convience. (The analysis of AuthenticedData is similar.) is not protected by the signature. Many implementations of CMS today actually ignore the value of this field. If the structure decodes then this is considered sufficient to continue processing. Using most decoders on the market the value of this field does not control how the decoding is actually processed. can be protected by the use of either signing certificate authenticated attribute. SigningCertificateV2 is defined in . SigningCertificate is defined in . In addition to allowing for the protection of the signer identifier, the specific certificate is protected by including a hash of the certificate to be used for validation. the digest algorithm used has been implicitly protected by the fact that CMS has only defined one digest algorithm for each hash value length. (The algorithm RIPEM-160 was never standardized). If newer digest algorithms are defined where there are multiple algorthms for a given hash length, or where parameters are defined for a specific algorithm, this implicit protection will no longer exist. are directly protected by the signature when they are present. The DER encoding of this value is what is actually hashed for the signature computation. has been protected by implication in the past. For RSA v 1.5 signatures, the fact that the RSA algorithm was known from the public key and the digest algorithm used is included in the formatted value over which the RSA computation is done. For DSA signature, the fact that a DSA public key was sufficient to know that SHA-1 was the digest algorithm as it was the only acceptable digest algorithm. With the advent of newer signature algorithms, especially those such as RSA-PSS which have parameters, this implicit protection of the signature algorithm is no longer possible. is not directly protected by any other value unless a counter signature is present. However this represents the crytographically computed value to protected the rest of the signature information. is not protected by the signature value. It is also explicitly designed not to be protected by the signature value.As can be seen above, the digestAlgorithm and signatureAlgorithm fields have been indirectly rather than explicity protected in the past. With new algorithms that have been or are being defined this will no longer be the case. This document defines and describes a new attribute that will explicitly protect these fields along with the macAlgorithm field of the AuthenticatedData structure.The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in .The following defines the algorithm protection attribute:The algorithm-protection attribute has the ASN.1 type AlgorithmProtection:The following object identifier identifies the algorithm-protection attribute:The algorithm-protection attribute uses the following ASN.1 type: The fields are defined as follows: contains a copy of the SignerInfo.digestAlgorithm field or the AuthenticatedData.digestAlgorithm field including any parameters associated with it. contains a copy of the signature algorithm identifier and any parameters associated with it. This field is only populated if the attribute is placed in a SignerInfo structure. contains a copy of the message authentication code and any parameters associated with it. This field is only populated if the attribute is placed in an authenticated data structure.Exactly one of signatureAlgorithm and macAlgorithm SHALL be present.An algorithm protection MUST have a single attribute value, even though the syntax is defined as a SET OF AttributeValue. There MUST not be zero or multiple instances of AttributeValue present.The authentication protection attribute MUST be a signed attribute or an authenticated attribute; it MUST NOT be an unsigned attribute, an unauthenticated attribute or an unprotected attribute.The SignedAttributes and AuthAttributes syntax are each defined as a SET of Attributes. The SignedAttributes in a signerInfo MUST include only one instance of the algorithm protection attribute. Similarly, the AuthAttributes in an AuthenticatedData MUST include only one instance of the algorithm protection attribute.The exact verification process depends on the structure being dealt with.When doing comparisions of the fields, a field whos value is a default value and one which is explicitly provided MUST compare as equivalent. It is not required that a field which is absent in one case and present in another case be compared as equivelent. (This mean that an algorithm identifier with absent parameters and one with NULL parameters need not compare as equivalent.)If a CMS validator supports this attribute, the following additional verification steps MUST be performed:1. The SignerInfo.digestAlgorithm field MUST be compared to the digestAlgorithm field in the attribute. If the fields are not same (modulo encoding) then signature validation MUST fail.2. The SignerInfo.signatureAlgorithm field MUST be compared to the signatureAlgorithm field in the attribute. If the fields are not the same (modulo encoding) then the signature validation MUST fail.If a CMS validator supports this attribute, the following additional verification steps MUST be performed:1. The AuthenticatedData.digestAlgorithm field MUST be compared to the digestAlgorithm field in the attribute. If the fields are not same (modulo encoding) then signature validation MUST fail.2. The AuthenticatedData.macAlgorithm field MUST be compared to the macAlgorithm field in the attribute. If the fields are not the same (modulo encoding) then the signature validation MUST fail.This document is designed to address the security issue of algorithm substitutions of the algorithms used by the validator. At this time there is no known method to exploit this type of attack. If the attack could be successful, then either a weaker algorithm could be substituted for a stronger algorithm or the parameters can be modified by an attacker to change the state of the hashing algorithm used. (One example would be changing the initial parmeter value for The attributes defined in this document are to be placed in locations that are protected by the signature. This attribute does not provide any additional security if placed in an un-signed or un-authenticated location.Enhanced Security Services for S/MIMEKey words for use in RFCs to Indicate Requirement LevelsInternet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) ProfileCryptographic Message Syntax (CMS)Enhanced Security Services (ESS) Update: Adding CertID Algorithm Agility