Set CMS EnvelopedData version correctly.
[oweals/openssl.git] / crypto / cms / cms_dd.c
index ec7689d0011fcce86e393b84cad68e0e28a1b1a0..8919c15be1268fde5e61a889d615284bafa04d74 100644 (file)
@@ -58,7 +58,6 @@
 #include <openssl/err.h>
 #include <openssl/cms.h>
 #include "cms_lcl.h"
-#include "asn1_locl.h"
 
 DECLARE_ASN1_ITEM(CMS_DigestedData)
 
@@ -98,8 +97,6 @@ CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md)
 BIO *cms_DigestedData_init_bio(CMS_ContentInfo *cms)
        {
        CMS_DigestedData *dd;
-       if (OBJ_obj2nid(cms->contentType) != NID_pkcs7_digest)
-               return NULL;
        dd = cms->d.digestedData;
        return cms_DigestAlgorithm_init_bio(dd->digestAlgorithm);
        }
@@ -123,7 +120,7 @@ int cms_DigestedData_do_final(CMS_ContentInfo *cms, BIO *chain, int verify)
 
        if (verify)
                {
-               if (mdlen != dd->digest->length)
+               if (mdlen != (unsigned int)dd->digest->length)
                        {
                        CMSerr(CMS_F_CMS_DIGESTEDDATA_DO_FINAL,
                                CMS_R_MESSAGEDIGEST_WRONG_LENGTH);