softethervpn5: revert to 5.01.9674

This commit is contained in:
hellcatjack 2022-12-03 20:45:48 +08:00
parent a7efe92e95
commit cdaad87dd6
9 changed files with 59 additions and 74 deletions

View File

@ -3,15 +3,15 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=softethervpn5
PKG_VERSION:=5.02.5180
PKG_RELEASE:=$(AUTORELEASE)
PKG_VERSION:=5.01.9674
PKG_RELEASE:=1
PKG_LICENSE:=GPL-2.0
PKG_LICENSE_FILES:=COPYING
PKG_SOURCE_URL:=https://github.com/SoftEtherVPN/SoftEtherVPN/releases/download/$(PKG_VERSION)/
PKG_SOURCE:=SoftEtherVPN-$(PKG_VERSION).tar.xz
PKG_HASH:=b5649a8ea3cc6477325e09e2248ef708d434ee3b2251eb8764bcfc15fb1de456
PKG_SOURCE:=softether-vpn-src-$(PKG_VERSION).tar.gz
PKG_HASH:=c4dc53f4912605a25c18357b0a0bf6dc059286ca901cb981abdf1a22d1649ddc
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/SoftEtherVPN-$(PKG_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/SoftEtherVPN-$(PKG_VERSION)
@ -41,7 +41,7 @@ endef
define Package/softethervpn5-libs
$(call Package/softethervpn5/Default)
DEPENDS:=+libsodium +libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
DEPENDS:=+libpthread +librt +libreadline +libopenssl +libncurses +kmod-tun +zlib $(ICONV_DEPENDS)
TITLE+= libs
HIDDEN:=1
endef
@ -91,7 +91,6 @@ define Host/Prepare
$(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Mayaqua/CMakeLists.txt
$(SED) 's,SHARED,STATIC,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
$(SED) 's,readline,libreadline.a,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
$(SED) 's,libsodium REQUIRED,libsodium,g' $(HOST_BUILD_DIR)/src/Cedar/CMakeLists.txt
endef
define Host/Compile
@ -100,29 +99,23 @@ endef
define Host/Install
$(INSTALL_DIR) $(STAGING_DIR_HOSTPKG)/bin/
$(INSTALL_BIN) $(HOST_BUILD_DIR)/src/hamcorebuilder/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
endef
# disable SSE detection, disables BLAKE2 lib
define Build/Prepare
$(call Build/Prepare/Default)
$(SED) 's,cmake_host_system_information,#cmake_host_system_information,g' $(PKG_BUILD_DIR)/src/Cedar/CMakeLists.txt
$(INSTALL_BIN) $(HOST_BUILD_DIR)/tmp/hamcorebuilder $(STAGING_DIR_HOSTPKG)/bin/
endef
define Build/Compile
$(call Build/Compile/Default,vpnserver vpnbridge vpnclient vpncmd hamcore-archive-build)
endef
define Build/Install
endef
define Package/softethervpn5-libs/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libcedar.so $(1)/usr/lib/
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libmayaqua.so $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/build/libcedar.so $(1)/usr/lib/
$(CP) $(PKG_BUILD_DIR)/build/libmayaqua.so $(1)/usr/lib/
$(INSTALL_DIR) $(1)/usr/libexec/softethervpn
$(CP) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpncmd/hamcore.se2 $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpncmd/vpncmd $(1)/usr/libexec/softethervpn/
$(INSTALL_DIR) $(1)/usr/bin
if [ -f $(PKG_INSTALL_DIR)/usr/bin/list_cpu_features ]; then \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/list_cpu_features $(1)/usr/bin/ ; fi
$(CP) $(PKG_BUILD_DIR)/build/hamcore.se2 $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpncmd $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) files/launcher.sh $(1)/usr/libexec/softethervpn/
$(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/lang.config
$(INSTALL_DIR) $(1)/usr/bin
@ -131,7 +124,7 @@ endef
define Package/softethervpn5-server/install
$(INSTALL_DIR) $(1)/usr/libexec/softethervpn
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnserver/vpnserver $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnserver $(1)/usr/libexec/softethervpn/
$(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_server.config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/vpnserver.init $(1)/etc/init.d/softethervpnserver
@ -139,7 +132,7 @@ endef
define Package/softethervpn5-bridge/install
$(INSTALL_DIR) $(1)/usr/libexec/softethervpn
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnbridge/vpnbridge $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnbridge $(1)/usr/libexec/softethervpn/
$(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_bridge.config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/vpnbridge.init $(1)/etc/init.d/softethervpnbridge
@ -147,7 +140,7 @@ endef
define Package/softethervpn5-client/install
$(INSTALL_DIR) $(1)/usr/libexec/softethervpn
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/libexec/softether/vpnclient/vpnclient $(1)/usr/libexec/softethervpn/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/build/vpnclient $(1)/usr/libexec/softethervpn/
$(INSTALL_DATA) files/dummy $(1)/usr/libexec/softethervpn/vpn_client.config
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/vpnclient.init $(1)/etc/init.d/softethervpnclient

View File

@ -0,0 +1,11 @@
--- a/src/Mayaqua/Mayaqua.h
+++ b/src/Mayaqua/Mayaqua.h
@@ -184,7 +184,7 @@ int PASCAL WinMain(HINSTANCE hInst, HINS
#include <ifaddrs.h>
#endif // MAYAQUA_SUPPORTS_GETIFADDRS
-#ifdef UNIX_LINUX
+#if 0
typedef void *iconv_t;
iconv_t iconv_open (__const char *__tocode, __const char *__fromcode);
size_t iconv (iconv_t __cd, char **__restrict __inbuf,

View File

@ -1,7 +1,7 @@
--- a/src/Mayaqua/CMakeLists.txt
+++ b/src/Mayaqua/CMakeLists.txt
@@ -55,7 +55,7 @@ if(UNIX)
find_package(Threads REQUIRED)
@@ -59,7 +59,7 @@ if(UNIX)
find_package(ZLIB REQUIRED)
# In some cases libiconv is not included in libc
- find_library(LIB_ICONV iconv)

View File

@ -1,13 +0,0 @@
--- a/src/Mayaqua/Encrypt.h
+++ b/src/Mayaqua/Encrypt.h
@@ -9,7 +9,9 @@
#define ENCRYPT_H
#include "MayaType.h"
-
+#ifdef linux
+ #include <pthread.h>
+#endif
#include <openssl/opensslv.h>
// Constant

View File

@ -1,30 +0,0 @@
From ee3bf7f5079bcad51cc89197b6a9e34da746fc7e Mon Sep 17 00:00:00 2001
From: Rosen Penev <rosenp@gmail.com>
Date: Sat, 7 Aug 2021 20:05:04 -0700
Subject: [PATCH] fix compilation without OpenSSL engines
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
src/Mayaqua/Encrypt.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/src/Mayaqua/Encrypt.c
+++ b/src/Mayaqua/Encrypt.c
@@ -3128,6 +3128,7 @@ bool IsEncryptedK(BUF *b, bool private_k
K *OpensslEngineToK(char *key_file_name, char *engine_name)
{
+#ifndef OPENSSL_NO_ENGINE
K *k;
#if OPENSSL_API_COMPAT < 0x10100000L
ENGINE_load_dynamic();
@@ -3140,6 +3141,9 @@ K *OpensslEngineToK(char *key_file_name,
k->pkey = pkey;
k->private_key = true;
return k;
+#else
+ return NULL;
+#endif
}
// Convert the BUF to a K

View File

@ -1,6 +1,6 @@
--- a/src/Cedar/Server.h
+++ b/src/Cedar/Server.h
@@ -35,10 +35,10 @@ extern char *SERVER_CONFIG_FILE_NAME;
@@ -32,10 +32,10 @@ extern char *SERVER_CONFIG_FILE_NAME;
#define SERVER_CONTROL_TCP_TIMEOUT (60 * 1000)
#define SERVER_FARM_CONTROL_INTERVAL (10 * 1000)

View File

@ -1,14 +1,15 @@
--- a/src/Cedar/Server.c
+++ b/src/Cedar/Server.c
@@ -5,6 +5,7 @@
@@ -4,7 +4,7 @@
// Server.c
// VPN Server module
-
+#include <syslog.h>
#include "Server.h"
#include "CedarPch.h"
#include "Admin.h"
@@ -6561,6 +6562,10 @@ UINT SiWriteConfigurationFile(SERVER *s)
static SERVER *server = NULL;
@@ -6492,6 +6492,10 @@ UINT SiWriteConfigurationFile(SERVER *s)
{
return 0;
}

View File

@ -0,0 +1,10 @@
--- a/src/Cedar/Server.c 2020-04-30 16:48:22.000000000 +0800
+++ b/src/Cedar/Server.c 2022-08-12 15:08:36.000000000 +0800
@@ -10624,6 +10624,7 @@
//
bool SiIsEnterpriseFunctionsRestrictedOnOpenSource(CEDAR *c)
{
+ return false;
char region[128];
bool ret = false;
// Validate arguments

View File

@ -0,0 +1,13 @@
--- a/src/Cedar/Proto_OpenVPN.c 2020-04-30 16:48:22.000000000 +0800
+++ b/src/Cedar/Proto_OpenVPN.c 2022-08-12 15:12:00.000000000 +0800
@@ -2436,8 +2436,8 @@
if (r->Exists)
{
Format(l3_options, sizeof(l3_options),
- ",route %r %r vpn_gateway",
- &r->Network, &r->SubnetMask);
+ ",route %r %r %r",
+ &r->Network, &r->SubnetMask, &r->Gateway);
StrCat(option_str, sizeof(option_str), l3_options);
}