Fix multiple wrong use of BN_check_prime
Reviewed-by: Paul Dale <ppzgs1@gmail.com> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/25811)
This commit is contained in:
parent
1273fae170
commit
b2b995ec2d
@ -145,10 +145,14 @@ opthelp:
|
||||
}
|
||||
|
||||
BN_print(bio_out, bn);
|
||||
r = BN_check_prime(bn, NULL, NULL);
|
||||
if (r < 0) {
|
||||
BIO_printf(bio_err, "Error checking prime\n");
|
||||
goto end;
|
||||
}
|
||||
BIO_printf(bio_out, " (%s) %s prime\n",
|
||||
argv[0],
|
||||
BN_check_prime(bn, NULL, NULL)
|
||||
? "is" : "is not");
|
||||
r == 1 ? "is" : "is not");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2703,7 +2703,7 @@ static int test_not_prime(int i)
|
||||
|
||||
for (trial = 0; trial <= 1; ++trial) {
|
||||
if (!TEST_true(BN_set_word(r, not_primes[i]))
|
||||
|| !TEST_false(BN_check_prime(r, ctx, NULL)))
|
||||
|| !TEST_int_eq(BN_check_prime(r, ctx, NULL), 0))
|
||||
goto err;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user