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

Correct EVP_DigestVerifyFinal error handling.

crypto/cms/cms_sd.c

index e862872..e3192b9 100644 (file)
@@ -799,7 +799,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);