diff options
author | Tomas Mraz <tomas@openssl.org> | 2021-08-10 09:18:19 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-08-11 12:07:08 +0200 |
commit | 12e055991e9d755c8a395f60abf97783795be626 (patch) | |
tree | 3cf9a2bb345deea7a68e5edc35ff36aa03585aa6 /test/dsatest.c | |
parent | Set FFC_PARAM_FLAG_VALIDATE_LEGACY on params generated with FIPS 186-2 gen (diff) | |
download | openssl-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.c | 8 |
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: |