PR: 2058
authorDr. Stephen Henson <steve@openssl.org>
Wed, 30 Sep 2009 23:49:11 +0000 (23:49 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 30 Sep 2009 23:49:11 +0000 (23:49 +0000)
Submitted by: Julia Lawall <julia@diku.dk>
Approved by: steve@openssl.org

Correct EVP_DigestVerifyFinal error handling.

crypto/cms/cms_sd.c

index 83711d8af4c9250310ec53e506d4fd498b208fb5..77fbd1359679fd9504b9256e85e8d806fed8a2f7 100644 (file)
@@ -800,7 +800,7 @@ int CMS_SignerInfo_verify(CMS_SignerInfo *si)
                }
        r = EVP_DigestVerifyFinal(&mctx,
                        si->signature->data, si->signature->length);
-       if (!r)
+       if (r <= 0)
                CMSerr(CMS_F_CMS_SIGNERINFO_VERIFY, CMS_R_VERIFICATION_FAILURE);
        err:
        EVP_MD_CTX_cleanup(&mctx);