update cms code to use X509_ALGOR_set_md instead of internal function
This commit is contained in:
parent
ce25c7207b
commit
31d66c2a98
@ -82,7 +82,7 @@ CMS_ContentInfo *cms_DigestedData_create(const EVP_MD *md)
|
|||||||
dd->version = 0;
|
dd->version = 0;
|
||||||
dd->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data);
|
dd->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data);
|
||||||
|
|
||||||
cms_DigestAlgorithm_set(dd->digestAlgorithm, md);
|
X509_ALGOR_set_md(dd->digestAlgorithm, md);
|
||||||
|
|
||||||
return cms;
|
return cms;
|
||||||
|
|
||||||
|
@ -443,7 +443,6 @@ int cms_SignerIdentifier_cert_cmp(CMS_SignerIdentifier *sid, X509 *cert);
|
|||||||
CMS_ContentInfo *cms_CompressedData_create(int comp_nid);
|
CMS_ContentInfo *cms_CompressedData_create(int comp_nid);
|
||||||
BIO *cms_CompressedData_init_bio(CMS_ContentInfo *cms);
|
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);
|
BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm);
|
||||||
int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
|
int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
|
||||||
X509_ALGOR *mdalg);
|
X509_ALGOR *mdalg);
|
||||||
|
@ -341,21 +341,6 @@ int CMS_set_detached(CMS_ContentInfo *cms, int detached)
|
|||||||
return 0;
|
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 */
|
/* Create a digest BIO from an X509_ALGOR structure */
|
||||||
|
|
||||||
BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm)
|
BIO *cms_DigestAlgorithm_init_bio(X509_ALGOR *digestAlgorithm)
|
||||||
|
@ -360,7 +360,7 @@ CMS_SignerInfo *CMS_add1_signer(CMS_ContentInfo *cms,
|
|||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
cms_DigestAlgorithm_set(si->digestAlgorithm, md);
|
X509_ALGOR_set_md(si->digestAlgorithm, md);
|
||||||
|
|
||||||
/* See if digest is present in digestAlgorithms */
|
/* See if digest is present in digestAlgorithms */
|
||||||
for (i = 0; i < sk_X509_ALGOR_num(sd->digestAlgorithms); i++)
|
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();
|
alg = X509_ALGOR_new();
|
||||||
if (!alg)
|
if (!alg)
|
||||||
goto merr;
|
goto merr;
|
||||||
cms_DigestAlgorithm_set(alg, md);
|
X509_ALGOR_set_md(alg, md);
|
||||||
if (!sk_X509_ALGOR_push(sd->digestAlgorithms, alg))
|
if (!sk_X509_ALGOR_push(sd->digestAlgorithms, alg))
|
||||||
{
|
{
|
||||||
X509_ALGOR_free(alg);
|
X509_ALGOR_free(alg);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user