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 8919c15..93d6747 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 5aea7f8..0839ed6 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 b62d1bf..a5a186c 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 77fbd13..f448a35 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);