summaryrefslogtreecommitdiffstats
path: root/crypto/cms
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2010-02-02 14:26:32 +0000
committerDr. Stephen Henson <steve@openssl.org>2010-02-02 14:26:32 +0000
commit45acdd6f6dde19b4f6a2c5162c1019aff6670916 (patch)
tree0083ef9232cb43048c87bd4825b2dbdf09ed881b /crypto/cms
parent8b354e776bd67de9a0585c9cd00645a8e10c6f89 (diff)
tolerate broken CMS/PKCS7 implementations using signature OID instead of digest
Diffstat (limited to 'crypto/cms')
-rw-r--r--crypto/cms/cms_lib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c
index 6c0d5c097c..d00fe0f87b 100644
--- a/crypto/cms/cms_lib.c
+++ b/crypto/cms/cms_lib.c
@@ -406,7 +406,11 @@ int cms_DigestAlgorithm_find_ctx(EVP_MD_CTX *mctx, BIO *chain,
return 0;
}
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)
{
EVP_MD_CTX_copy_ex(mctx, mtmp);
return 1;