From 03ffa376011ff5ddf346657c4bb377dde9ecb584 Mon Sep 17 00:00:00 2001 From: John Regan Date: Wed, 4 May 2022 23:05:24 +0200 Subject: openssl 3.0.0: use new BN_check_prime --- src/openssl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/openssl.c b/src/openssl.c index 92e91ea..c23988e 100644 --- a/src/openssl.c +++ b/src/openssl.c @@ -3920,8 +3920,12 @@ static int bn_generatePrime(lua_State *L) { static int bn_isPrime(lua_State *L) { BIGNUM *bn = checksimple(L, 1, BIGNUM_CLASS); +#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 if (res == -1) return auxL_error(L, auxL_EOPENSSL, "bignum:isPrime"); -- cgit v1.2.3-59-g8ed1b