[openssl] openssl-3.0 update
tomas at openssl.org
tomas at openssl.org
Tue Nov 16 16:31:44 UTC 2021
The branch openssl-3.0 has been updated
via ee3928f23175b4e7248b8e48d46a0bbe84ebb7da (commit)
from c8d3926eb7bcbce6ec85fd3218d64fa8bc7c0861 (commit)
- Log -----------------------------------------------------------------
commit ee3928f23175b4e7248b8e48d46a0bbe84ebb7da
Author: Peiwei Hu <jlu.hpw at foxmail.com>
Date: Sun Nov 14 22:42:35 2021 +0800
EVP_DigestVerifyFinal: fix test function and invocation
Signed-off-by: Peiwei Hu <jlu.hpw at foxmail.com>
Reviewed-by: Matt Caswell <matt at openssl.org>
Reviewed-by: Paul Dale <pauli at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17029)
(cherry picked from commit e2e5e72d5aec4d8d633cc5e9930f762da7973ab6)
-----------------------------------------------------------------------
Summary of changes:
demos/signature/EVP_Signature_demo.c | 2 +-
test/evp_extra_test.c | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/demos/signature/EVP_Signature_demo.c b/demos/signature/EVP_Signature_demo.c
index d7f26f164b..123c95c26a 100644
--- a/demos/signature/EVP_Signature_demo.c
+++ b/demos/signature/EVP_Signature_demo.c
@@ -188,7 +188,7 @@ static int demo_verify(OSSL_LIB_CTX *libctx, const char *sig_name,
fprintf(stderr, "EVP_DigestVerifyUpdate(hamlet_2) failed.\n");
goto cleanup;
}
- if (!EVP_DigestVerifyFinal(verify_context, sig_value, sig_len)) {
+ if (EVP_DigestVerifyFinal(verify_context, sig_value, sig_len) <= 0) {
fprintf(stderr, "EVP_DigestVerifyFinal failed.\n");
goto cleanup;
}
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 830639b8ab..7b3c4aee2c 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -1273,11 +1273,11 @@ static int test_EVP_DigestSignInit(int tst)
sizeof(kMsg))))
goto out;
}
- if (!TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
+ if (!TEST_int_gt(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len), 0))
goto out;
/* Multiple calls to EVP_DigestVerifyFinal should work */
- if (!TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
+ if (!TEST_int_gt(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len), 0))
goto out;
} else {
/*
@@ -1323,15 +1323,15 @@ static int test_EVP_DigestVerifyInit(void)
if (!TEST_true(EVP_DigestVerifyInit(md_ctx, NULL, EVP_sha256(), NULL, pkey))
|| !TEST_true(EVP_DigestVerifyUpdate(md_ctx, kMsg, sizeof(kMsg)))
- || !TEST_true(EVP_DigestVerifyFinal(md_ctx, kSignature,
- sizeof(kSignature))))
+ || !TEST_int_gt(EVP_DigestVerifyFinal(md_ctx, kSignature,
+ sizeof(kSignature)), 0))
goto out;
/* test with reinitialization */
if (!TEST_true(EVP_DigestVerifyInit(md_ctx, NULL, NULL, NULL, NULL))
|| !TEST_true(EVP_DigestVerifyUpdate(md_ctx, kMsg, sizeof(kMsg)))
- || !TEST_true(EVP_DigestVerifyFinal(md_ctx, kSignature,
- sizeof(kSignature))))
+ || !TEST_int_gt(EVP_DigestVerifyFinal(md_ctx, kSignature,
+ sizeof(kSignature)), 0))
goto out;
ret = 1;
@@ -1786,7 +1786,7 @@ static int test_EVP_SM2_verify(void)
if (!TEST_true(EVP_DigestVerifyUpdate(mctx, msg, strlen(msg))))
goto done;
- if (!TEST_true(EVP_DigestVerifyFinal(mctx, signature, sizeof(signature))))
+ if (!TEST_int_gt(EVP_DigestVerifyFinal(mctx, signature, sizeof(signature)), 0))
goto done;
rc = 1;
@@ -1896,7 +1896,7 @@ static int test_EVP_SM2(void)
if (!TEST_true(EVP_DigestVerifyUpdate(md_ctx_verify, kMsg, sizeof(kMsg))))
goto done;
- if (!TEST_true(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len)))
+ if (!TEST_int_gt(EVP_DigestVerifyFinal(md_ctx_verify, sig, sig_len), 0))
goto done;
/* now check encryption/decryption */
More information about the openssl-commits
mailing list