openwrt/package/network/services/ppp/patches/101-pppd-crypto-fix-build-without-openssl.patch
Shiji Yang 3e668c6d02 ppp: update to 2.5.1
ChangeLog:
https://github.com/ppp-project/ppp/blob/ppp-2.5.1/ChangeLog

Suppressed patches:
010-use_target_for_configure.patch [1]
510-pptp_compile_fix.patch [2]
520-u_int_bsd_fix.patch [3]

Upstreamed patches:
330-retain_foreign_default_routes.patch [4]
521-remove_unused_openssl_dep.patch [5]

[1] e48a9b5de4
[2] Merged into "500-add-pptp-plugin.patch"
[3] 797cdae57c
[4] 9856f47063
[5] 59342ab622

Signed-off-by: Shiji Yang <yangshiji66@qq.com>
Link: https://github.com/openwrt/openwrt/pull/16605
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-12 15:53:06 +02:00

46 lines
1.0 KiB
Diff

From: Shiji Yang <yangshiji66@outlook.com>
Date: Fri, 4 Oct 2024 12:19:42 +0000
Subject: [PATCH] pppd/crypto: fix build without openssl
Compile openssl relevant code only when PPP_WITH_OPENSSL is defined.
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
pppd/crypto.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/pppd/crypto.c
+++ b/pppd/crypto.c
@@ -199,6 +199,7 @@ int PPP_crypto_init()
{
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)
@@ -214,6 +215,7 @@ int PPP_crypto_init()
goto done;
}
#endif
+#endif
retval = 1;
@@ -224,6 +226,7 @@ done:
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);
@@ -239,6 +242,7 @@ int PPP_crypto_deinit()
#if OPENSSL_VERSION_NUMBER < 0x10100000L
ERR_free_strings();
#endif
+#endif
return 1;
}