diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2010-02-02 14:30:39 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2010-02-02 14:30:39 +0000 |
commit | 2712a2f6256a69e914b174e1915b029b1f4b9554 (patch) | |
tree | c61b00bfb7c56027a177756df608567585f4c675 /crypto/cms | |
parent | 17ebc10ffa3515bb4d67b28a8164d0f48b686f10 (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 714b1d9b1c..b62d1bfac0 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) return EVP_MD_CTX_copy_ex(mctx, mtmp); chain = BIO_next(chain); } |