The symbol OPENSSL_VERSION_NUMBER is not defined when pppd is
compiled without OpenSSL support, so it evaluates to zero.
This results in the following linker error:
crypto.c:241: undefined reference to `ERR_free_strings'
Signed-off-by: Tomas Paukrt <tomaspaukrt@email.cz>
#ifdef PPP_WITH_OPENSSL
#include <openssl/opensslv.h>
#include <openssl/err.h>
-#endif
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
#include <openssl/provider.h>
OSSL_PROVIDER *provider;
} g_crypto_ctx;
#endif
+#endif
PPP_MD_CTX *PPP_MD_CTX_new()
{
{
int retval = 0;
+#ifdef PPP_WITH_OPENSSL
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
g_crypto_ctx.legacy = OSSL_PROVIDER_load(NULL, "legacy");
if (g_crypto_ctx.legacy == NULL)
PPP_crypto_error("Could not load default provider");
goto done;
}
+#endif
#endif
retval = 1;
int PPP_crypto_deinit()
{
+#ifdef PPP_WITH_OPENSSL
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
if (g_crypto_ctx.legacy) {
OSSL_PROVIDER_unload(g_crypto_ctx.legacy);
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_free_strings();
+#endif
#endif
return 1;
}