diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-02-02 14:19:54 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-02-02 14:19:54 +0000 |
commit | 4a9d335bb442a59ecd87c09812a8f6cc88065ff7 (patch) | |
tree | 2c327be9ef7d959d3938d10c9302f33640fefe8f /crypto/cms | |
parent | 162f1e08f8ed4828d5af072590e7c1aeb08783d5 (diff) |
tolerate broken CMS/PKCS7 implementations using signature OID instead of digest
Diffstat (limited to 'crypto/cms')
-rw-r--r-- | crypto/cms/cms_lib.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/cms/cms_lib.c b/crypto/cms/cms_lib.c index 8e6c1d29a5..cc00526d3e 100644 --- a/crypto/cms/cms_lib.c +++ b/crypto/cms/cms_lib.c @@ -415,7 +415,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; |