From df0f1541e7abf453de2337df967bcc1bd362124a Mon Sep 17 00:00:00 2001 From: John Regan Date: Thu, 5 May 2022 14:25:49 +0200 Subject: bn: use nchecks in both openssl-3 and openssl-1 branches --- src/openssl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index c23988e..198e6a6 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -3920,10 +3920,10 @@ static int bn_generatePrime(lua_State *L) { static int bn_isPrime(lua_State *L) { BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS); + int nchecks = luaL_optinteger(L, 2, BN_prime_checks); #if OPENSSL_PREREQ(3,0,0) int res = BN_check_prime(bn, getctx(L), NULL); #else - int nchecks = luaL_optinteger(L, 2, BN_prime_checks); int res = BN_is_prime_ex(bn, nchecks, getctx(L), NULL); #endif -- cgit v1.2.3-59-g8ed1b