update cms code to use X509_ALGOR_set_md instead of internal function
authorDr. Stephen Henson <steve@openssl.org>
Thu, 11 Mar 2010 13:29:39 +0000 (13:29 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Thu, 11 Mar 2010 13:29:39 +0000 (13:29 +0000)
crypto/cms/cms_dd.c
crypto/cms/cms_lcl.h
crypto/cms/cms_lib.c
crypto/cms/cms_sd.c

index 8919c15be1268fde5e61a889d615284bafa04d74..93d6747ae80026f8d1850f065070c6c623b56ce6 100644 (file)
@@ -82,7 +82,7 @@ CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md)
        dd->version = 0;
        dd->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data);
 
-       cms_DigestAlgorithm_set(dd->digestAlgorithm, md);
+       X509_ALGOR_set_md(dd->digestAlgorithm, md);
 
        return cms;
 
index 5aea7f837f7937254eda669295475628132fb6a5..0839ed67300d16c0a9f84d9d011f0c3386acae93 100644 (file)
@@ -443,7 +443,6 @@ int cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert);
 CMS_ContentInfo *cms_CompressedData_create(int comp_nid);
 BIO *cms_CompressedData_init_bio(CMS_ContentInfo *cms);
 
-void cms_DigestAlgorithm_set(X509_ALGOR *alg, const EVP_MD *md);
 BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm);
 int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
                                        X509_ALGOR *mdalg);
index b62d1bfac02b750f59021e74de3d5c2fa81ad772..a5a186c5ac85c265c7e34b0ecf66c2dfd1dff575 100644 (file)
@@ -341,21 +341,6 @@ int CMS_set_detached(CMS_ContentInfo *cms, int detached)
        return 0;
        }
 
-/* Set up an X509_ALGOR DigestAlgorithmIdentifier from an EVP_MD */
-
-void cms_DigestAlgorithm_set(X509_ALGOR *alg, const EVP_MD *md)
-       {
-       int param_type;
-
-       if (md->flags & EVP_MD_FLAG_DIGALGID_ABSENT)
-               param_type = V_ASN1_UNDEF;
-       else
-               param_type = V_ASN1_NULL;
-
-       X509_ALGOR_set0(alg, OBJ_nid2obj(EVP_MD_type(md)), param_type, NULL);
-
-       }
-
 /* Create a digest BIO from an X509_ALGOR structure */
 
 BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm)
index 77fbd1359679fd9504b9256e85e8d806fed8a2f7..f448a350660462512608241884432f0ef26351cb 100644 (file)
@@ -360,7 +360,7 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
                goto err;
                }
 
-       cms_DigestAlgorithm_set(si->digestAlgorithm, md);
+       X509_ALGOR_set_md(si->digestAlgorithm, md);
 
        /* See if digest is present in digestAlgorithms */
        for (i = 0; i < sk_X509_ALGOR_num(sd->digestAlgorithms); i++)
@@ -377,7 +377,7 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
                alg = X509_ALGOR_new();
                if (!alg)
                        goto merr;
-               cms_DigestAlgorithm_set(alg, md);
+               X509_ALGOR_set_md(alg, md);
                if (!sk_X509_ALGOR_push(sd->digestAlgorithms, alg))
                        {
                        X509_ALGOR_free(alg);