From: Tomas Mraz Date: Tue, 10 Aug 2021 07:18:19 +0000 (+0200) Subject: dsatest: Properly detect failure in generate/sign/verify X-Git-Tag: openssl-3.0.0~126 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12e055991e9d755c8a395f60abf97783795be626;p=thirdparty%2Fopenssl.git dsatest: Properly detect failure in generate/sign/verify Reviewed-by: Dmitry Belyavskiy Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/16268) --- diff --git a/test/dsatest.c b/test/dsatest.c index 533fba1cbc5..2d34ca42619 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: