From 377dda29ea0b5d28ff59c23be2a2a380fd6630ba Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Sun, 4 Sep 2022 16:03:16 -0400 Subject: Support OpenSSL built without OPENSSL_ENGINE --- 3rd_party/libsrp6a-sha512/Makefile.am | 2 +- 3rd_party/libsrp6a-sha512/t_math.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/3rd_party/libsrp6a-sha512/Makefile.am b/3rd_party/libsrp6a-sha512/Makefile.am index 8c6e2f5..d304585 100644 --- a/3rd_party/libsrp6a-sha512/Makefile.am +++ b/3rd_party/libsrp6a-sha512/Makefile.am @@ -9,7 +9,7 @@ include_HEADERS = srp.h srp_aux.h cstr.h AM_CFLAGS = -DHAVE_CONFIG_H if HAVE_OPENSSL -AM_CFLAGS += -DOPENSSL=1 -DOPENSSL_ENGINE=1 $(openssl_CFLAGS) +AM_CFLAGS += -DOPENSSL=1 $(openssl_CFLAGS) else if HAVE_GCRYPT AM_CFLAGS += -DGCRYPT=1 $(libgcrypt_CFLAGS) diff --git a/3rd_party/libsrp6a-sha512/t_math.c b/3rd_party/libsrp6a-sha512/t_math.c index 88ae12f..e655daa 100644 --- a/3rd_party/libsrp6a-sha512/t_math.c +++ b/3rd_party/libsrp6a-sha512/t_math.c @@ -39,7 +39,8 @@ typedef BIGNUM * BigInteger; typedef BN_CTX * BigIntegerCtx; typedef BN_MONT_CTX * BigIntegerModAccel; #include -# ifdef OPENSSL_ENGINE +# ifndef OPENSSL_NO_ENGINE +# define OPENSSL_ENGINE # include "openssl/engine.h" static ENGINE * default_engine = NULL; # endif /* OPENSSL_ENGINE */ @@ -951,7 +952,7 @@ BigIntegerModAccelFree(accel) BigIntegerResult BigIntegerInitialize() { -#if OPENSSL_VERSION_NUMBER >= 0x00907000 +#if OPENSSL_VERSION_NUMBER >= 0x00907000 && defined(OPENSSL_ENGINE) ENGINE_load_builtin_engines(); #endif return BIG_INTEGER_SUCCESS; -- cgit v1.1-32-gdbae