tolerate broken CMS/PKCS7 implementations using signature OID instead of digest
This commit is contained in:
parent
17ebc10ffa
commit
2712a2f625
@ -406,7 +406,11 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
BIO_get_md_ctx(chain, &mtmp);
|
BIO_get_md_ctx(chain, &mtmp);
|
||||||
if (EVP_MD_CTX_type(mtmp) == nid)
|
if (EVP_MD_CTX_type(mtmp) == nid
|
||||||
|
/* Workaround for broken implementations that use signature
|
||||||
|
* algorithm OID instead of digest.
|
||||||
|
*/
|
||||||
|
|| EVP_MD_pkey_type(EVP_MD_CTX_md(mtmp)) == nid)
|
||||||
return EVP_MD_CTX_copy_ex(mctx, mtmp);
|
return EVP_MD_CTX_copy_ex(mctx, mtmp);
|
||||||
chain = BIO_next(chain);
|
chain = BIO_next(chain);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user