summaryrefslogtreecommitdiffstats
path: root/test/dsatest.c
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2021-08-10 09:18:19 +0200
committerTomas Mraz <tomas@openssl.org>2021-08-11 12:07:08 +0200
commit12e055991e9d755c8a395f60abf97783795be626 (patch)
tree3cf9a2bb345deea7a68e5edc35ff36aa03585aa6 /test/dsatest.c
parentSet FFC_PARAM_FLAG_VALIDATE_LEGACY on params generated with FIPS 186-2 gen (diff)
downloadopenssl-12e055991e9d755c8a395f60abf97783795be626.tar.xz
openssl-12e055991e9d755c8a395f60abf97783795be626.zip
dsatest: Properly detect failure in generate/sign/verify
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/16268)
Diffstat (limited to 'test/dsatest.c')
-rw-r--r--test/dsatest.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/test/dsatest.c b/test/dsatest.c
index 533fba1cbc..2d34ca4261 100644
--- a/test/dsatest.c
+++ b/test/dsatest.c
@@ -108,9 +108,11 @@ static int dsa_test(void)
if (!TEST_int_eq(i, j) || !TEST_mem_eq(buf, i, out_g, i))
goto end;
- DSA_generate_key(dsa);
- DSA_sign(0, str1, 20, sig, &siglen, dsa);
- if (TEST_true(DSA_verify(0, str1, 20, sig, siglen, dsa)))
+ if (!TEST_true(DSA_generate_key(dsa)))
+ goto end;
+ if (!TEST_true(DSA_sign(0, str1, 20, sig, &siglen, dsa)))
+ goto end;
+ if (TEST_int_gt(DSA_verify(0, str1, 20, sig, siglen, dsa), 0))
ret = 1;
end: