]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Fix a logic flaw in test_mod_exp_zero
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 16 Dec 2022 18:30:29 +0000 (19:30 +0100)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Wed, 21 Dec 2022 15:36:14 +0000 (16:36 +0100)
Due to the logic flaw, possible test failures
in this test case might be ignored.

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/19929)

(cherry picked from commit 42061268ee8f9ae0555d522870740fc91b744f4f)

test/exptest.c

index cde4d6bc4548d96f714dc4dbfdaed0b5092f87f5..a327773ec433d8ef0a52e382a31d2213695cbccc 100644 (file)
@@ -49,7 +49,7 @@ static int test_mod_exp_zero(void)
     BIGNUM *r = NULL;
     BN_ULONG one_word = 1;
     BN_CTX *ctx = BN_CTX_new();
-    int ret = 1, failed = 0;
+    int ret = 0, failed = 0;
 
     if (!TEST_ptr(m = BN_new())
         || !TEST_ptr(a = BN_new())