Lines Matching refs:mctx
365 si->mctx = EVP_MD_CTX_new(); in CMS_add1_signer()
368 if (si->mctx == NULL) { in CMS_add1_signer()
510 } else if (EVP_DigestSignInit_ex(si->mctx, &si->pctx, in CMS_add1_signer()
519 EVP_MD_CTX_set_flags(si->mctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX); in CMS_add1_signer()
593 return si->mctx; in CMS_SignerInfo_get0_md_ctx()
718 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in cms_SignerInfo_content_sign() local
723 if (mctx == NULL) { in cms_SignerInfo_content_sign()
733 if (!ossl_cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) in cms_SignerInfo_content_sign()
746 if (!EVP_DigestFinal_ex(mctx, computed_md, &mdlen)) in cms_SignerInfo_content_sign()
767 if (!EVP_DigestFinal_ex(mctx, computed_md, &mdlen)) in cms_SignerInfo_content_sign()
790 if (!EVP_SignFinal_ex(mctx, sig, &siglen, si->pkey, in cms_SignerInfo_content_sign()
803 EVP_MD_CTX_free(mctx); in cms_SignerInfo_content_sign()
830 EVP_MD_CTX *mctx = si->mctx; in CMS_SignerInfo_sign() local
853 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_sign()
854 if (EVP_DigestSignInit_ex(mctx, &pctx, md_name, in CMS_SignerInfo_sign()
859 EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX); in CMS_SignerInfo_sign()
867 if (EVP_DigestSignUpdate(mctx, abuf, alen) <= 0) in CMS_SignerInfo_sign()
869 if (EVP_DigestSignFinal(mctx, NULL, &siglen) <= 0) in CMS_SignerInfo_sign()
875 if (EVP_DigestSignFinal(mctx, abuf, &siglen) <= 0) in CMS_SignerInfo_sign()
878 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_sign()
886 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_sign()
892 EVP_MD_CTX *mctx = NULL; in CMS_SignerInfo_verify() local
926 if (si->mctx == NULL && (si->mctx = EVP_MD_CTX_new()) == NULL) { in CMS_SignerInfo_verify()
930 mctx = si->mctx; in CMS_SignerInfo_verify()
935 if (EVP_DigestVerifyInit_ex(mctx, &si->pctx, EVP_MD_get0_name(md), libctx, in CMS_SignerInfo_verify()
940 EVP_MD_CTX_set_flags(mctx, EVP_MD_CTX_FLAG_KEEP_PKEY_CTX); in CMS_SignerInfo_verify()
949 r = EVP_DigestVerifyUpdate(mctx, abuf, alen); in CMS_SignerInfo_verify()
955 r = EVP_DigestVerifyFinal(mctx, in CMS_SignerInfo_verify()
961 EVP_MD_CTX_reset(mctx); in CMS_SignerInfo_verify()
1000 EVP_MD_CTX *mctx = EVP_MD_CTX_new(); in CMS_SignerInfo_verify_content() local
1006 if (mctx == NULL) { in CMS_SignerInfo_verify_content()
1021 if (!ossl_cms_DigestAlgorithm_find_ctx(mctx, chain, si->digestAlgorithm)) in CMS_SignerInfo_verify_content()
1024 if (EVP_DigestFinal_ex(mctx, mval, &mlen) <= 0) { in CMS_SignerInfo_verify_content()
1043 const EVP_MD *md = EVP_MD_CTX_get0_md(mctx); in CMS_SignerInfo_verify_content()
1071 EVP_MD_CTX_free(mctx); in CMS_SignerInfo_verify_content()