softethervpn5: rearrange patches
authorKonstantin Demin <rockdrilla@gmail.com>
Mon, 22 Dec 2025 20:39:45 +0000 (23:39 +0300)
committerHannu Nyman <hannu.nyman@iki.fi>
Sun, 28 Dec 2025 08:09:36 +0000 (10:09 +0200)
Provide space for upstream/pending patches.

Signed-off-by: Konstantin Demin <rockdrilla@gmail.com>
net/softethervpn5/patches/001-Mayaqua-build-allow-disabling-OQS.patch [new file with mode: 0644]
net/softethervpn5/patches/001-iconv-cmake-fix.patch [deleted file]
net/softethervpn5/patches/002-pthread-include-fix.patch [deleted file]
net/softethervpn5/patches/003-Mayaqua-build-allow-disabling-OQS.patch [deleted file]
net/softethervpn5/patches/100-increase-cfg-save-intervall.patch [deleted file]
net/softethervpn5/patches/101-add-config-write-syslog.patch [deleted file]
net/softethervpn5/patches/201-iconv-cmake-fix.patch [new file with mode: 0644]
net/softethervpn5/patches/202-pthread-include-fix.patch [new file with mode: 0644]
net/softethervpn5/patches/203-increase-cfg-save-intervall.patch [new file with mode: 0644]
net/softethervpn5/patches/204-add-config-write-syslog.patch [new file with mode: 0644]

diff --git a/net/softethervpn5/patches/001-Mayaqua-build-allow-disabling-OQS.patch b/net/softethervpn5/patches/001-Mayaqua-build-allow-disabling-OQS.patch
new file mode 100644 (file)
index 0000000..9257849
--- /dev/null
@@ -0,0 +1,53 @@
+From 4bb366572d5ede4bcddd68ea5e20709e478327f5 Mon Sep 17 00:00:00 2001
+From: Dominique Martinet <dominique.martinet@atmark-techno.com>
+Date: Wed, 1 Oct 2025 17:41:57 +0900
+Subject: [PATCH] Mayaqua build: allow disabling OQS
+
+SoftEtherVPN version 5.02.5186 enable post-quantum algorithms, but these
+come at a large size increase (after strip, on x86_64, with default
+options as of master):
+- default options: 9.1M
+- new -DOQS_ENABLE=OFF: 762K
+
+Note it is also possible to disable all the algorithms individually by
+passing the (243!) options to cmake -DOQS_ENABLE_KEM_BIKE=OFF
+-DOQS_ENABLE_KEM_FRODOKEM=OFF -DOQS_ENABLE_KEM_NTRUPRIME=OFF ...,
+in which case the binary goes back to a reasonable size of 830K
+
+In the future, it might make sense to add a few settings picking
+"sensible" algorithms, e.g. allow everything for a server build or only
+allow the best algorithms for a lightweight client.
+
+See: #2148
+---
+ src/Mayaqua/CMakeLists.txt | 11 +++++++++--
+ 1 file changed, 9 insertions(+), 2 deletions(-)
+
+--- a/src/Mayaqua/CMakeLists.txt
++++ b/src/Mayaqua/CMakeLists.txt
+@@ -18,9 +18,14 @@ set_target_properties(mayaqua
+ find_package(OpenSSL REQUIRED)
+-if(OPENSSL_VERSION VERSION_LESS "3") # Disable oqsprovider when OpenSSL version < 3
+-  add_definitions(-DSKIP_OQS_PROVIDER)
++if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3")
++  set(OQS_ENABLE ON CACHE BOOL "By setting this to OFF, Open Quantum Safe algorithms will not be built in")
+ else()
++  # Disable oqsprovider when OpenSSL version < 3
++  set(OQS_ENABLE OFF)
++endif()
++
++if(OQS_ENABLE)
+   set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
+   set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.")
+   set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
+@@ -32,6 +37,8 @@ else()
+   target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
+   set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
+   target_link_libraries(mayaqua PRIVATE oqsprovider)
++else()
++  add_definitions(-DSKIP_OQS_PROVIDER)
+ endif()
+ include(CheckSymbolExists)
diff --git a/net/softethervpn5/patches/001-iconv-cmake-fix.patch b/net/softethervpn5/patches/001-iconv-cmake-fix.patch
deleted file mode 100644 (file)
index b4adc1a..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/src/Mayaqua/CMakeLists.txt
-+++ b/src/Mayaqua/CMakeLists.txt
-@@ -96,7 +96,7 @@ if(UNIX)
-   find_package(Threads REQUIRED)
-   # In some cases libiconv is not included in libc
--  find_library(LIB_ICONV iconv)
-+  find_library(LIB_ICONV iconv HINTS "${ICONV_LIB_PATH}")
-   find_library(LIB_M m)
-   find_library(LIB_RT rt)
diff --git a/net/softethervpn5/patches/002-pthread-include-fix.patch b/net/softethervpn5/patches/002-pthread-include-fix.patch
deleted file mode 100644 (file)
index 5c80d56..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/src/Mayaqua/Encrypt.h
-+++ b/src/Mayaqua/Encrypt.h
-@@ -9,7 +9,9 @@
- #define       ENCRYPT_H\r
\r
- #include "MayaType.h"\r
--\r
-+#ifdef linux\r
-+      #include <pthread.h>\r
-+#endif\r
- #include <openssl/opensslv.h>\r
\r
- // Constant\r
diff --git a/net/softethervpn5/patches/003-Mayaqua-build-allow-disabling-OQS.patch b/net/softethervpn5/patches/003-Mayaqua-build-allow-disabling-OQS.patch
deleted file mode 100644 (file)
index 9257849..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-From 4bb366572d5ede4bcddd68ea5e20709e478327f5 Mon Sep 17 00:00:00 2001
-From: Dominique Martinet <dominique.martinet@atmark-techno.com>
-Date: Wed, 1 Oct 2025 17:41:57 +0900
-Subject: [PATCH] Mayaqua build: allow disabling OQS
-
-SoftEtherVPN version 5.02.5186 enable post-quantum algorithms, but these
-come at a large size increase (after strip, on x86_64, with default
-options as of master):
-- default options: 9.1M
-- new -DOQS_ENABLE=OFF: 762K
-
-Note it is also possible to disable all the algorithms individually by
-passing the (243!) options to cmake -DOQS_ENABLE_KEM_BIKE=OFF
--DOQS_ENABLE_KEM_FRODOKEM=OFF -DOQS_ENABLE_KEM_NTRUPRIME=OFF ...,
-in which case the binary goes back to a reasonable size of 830K
-
-In the future, it might make sense to add a few settings picking
-"sensible" algorithms, e.g. allow everything for a server build or only
-allow the best algorithms for a lightweight client.
-
-See: #2148
----
- src/Mayaqua/CMakeLists.txt | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
-
---- a/src/Mayaqua/CMakeLists.txt
-+++ b/src/Mayaqua/CMakeLists.txt
-@@ -18,9 +18,14 @@ set_target_properties(mayaqua
- find_package(OpenSSL REQUIRED)
--if(OPENSSL_VERSION VERSION_LESS "3") # Disable oqsprovider when OpenSSL version < 3
--  add_definitions(-DSKIP_OQS_PROVIDER)
-+if(OPENSSL_VERSION VERSION_GREATER_EQUAL "3")
-+  set(OQS_ENABLE ON CACHE BOOL "By setting this to OFF, Open Quantum Safe algorithms will not be built in")
- else()
-+  # Disable oqsprovider when OpenSSL version < 3
-+  set(OQS_ENABLE OFF)
-+endif()
-+
-+if(OQS_ENABLE)
-   set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
-   set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.")
-   set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
-@@ -32,6 +37,8 @@ else()
-   target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
-   set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
-   target_link_libraries(mayaqua PRIVATE oqsprovider)
-+else()
-+  add_definitions(-DSKIP_OQS_PROVIDER)
- endif()
- include(CheckSymbolExists)
diff --git a/net/softethervpn5/patches/100-increase-cfg-save-intervall.patch b/net/softethervpn5/patches/100-increase-cfg-save-intervall.patch
deleted file mode 100644 (file)
index 0677a8f..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
---- a/src/Cedar/Server.h
-+++ b/src/Cedar/Server.h
-@@ -35,10 +35,10 @@ extern char *SERVER_CONFIG_FILE_NAME;
- #define       SERVER_CONTROL_TCP_TIMEOUT              (60 * 1000)\r
- #define       SERVER_FARM_CONTROL_INTERVAL    (10 * 1000)\r
\r
--#define       SERVER_FILE_SAVE_INTERVAL_DEFAULT       (5 * 60 * 1000)\r
--#define       SERVER_FILE_SAVE_INTERVAL_MIN           (5 * 1000)\r
--#define       SERVER_FILE_SAVE_INTERVAL_MAX           (3600 * 1000)\r
--#define       SERVER_FILE_SAVE_INTERVAL_USERMODE      (1 * 60 * 1000)\r
-+#define       SERVER_FILE_SAVE_INTERVAL_DEFAULT       (24 * 60 * 60 * 1000)\r
-+#define       SERVER_FILE_SAVE_INTERVAL_MIN           (5 * 60 * 1000)\r
-+#define       SERVER_FILE_SAVE_INTERVAL_MAX           (7 * 24 * 60 * 60 * 1000)\r
-+#define       SERVER_FILE_SAVE_INTERVAL_USERMODE      (5 * 60 * 1000)\r
\r
- #define       SERVER_LICENSE_VIOLATION_SPAN   (SERVER_FARM_CONTROL_INTERVAL * 2)\r
\r
diff --git a/net/softethervpn5/patches/101-add-config-write-syslog.patch b/net/softethervpn5/patches/101-add-config-write-syslog.patch
deleted file mode 100644 (file)
index 2cf45ae..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
---- a/src/Cedar/Server.c
-+++ b/src/Cedar/Server.c
-@@ -5,6 +5,7 @@
- // Server.c\r
- // VPN Server module\r
\r
-+#include <syslog.h>\r
- #include "Server.h"\r
\r
- #include "Admin.h"\r
-@@ -6593,6 +6594,10 @@ UINT SiWriteConfigurationFile(SERVER *s)
-       {\r
-               return 0;\r
-       }\r
-+      \r
-+      openlog("softethervpn-server", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON);\r
-+      syslog(LOG_NOTICE, "Writing vpn_server.config (AutoSaveConfigSpan set to < %d > seconds)", (s->AutoSaveConfigSpan / 1000));\r
-+      closelog();\r
\r
-       Lock(s->SaveCfgLock);\r
-       {\r
diff --git a/net/softethervpn5/patches/201-iconv-cmake-fix.patch b/net/softethervpn5/patches/201-iconv-cmake-fix.patch
new file mode 100644 (file)
index 0000000..1b6fc9a
--- /dev/null
@@ -0,0 +1,11 @@
+--- a/src/Mayaqua/CMakeLists.txt
++++ b/src/Mayaqua/CMakeLists.txt
+@@ -103,7 +103,7 @@ if(UNIX)
+   find_package(Threads REQUIRED)
+   # In some cases libiconv is not included in libc
+-  find_library(LIB_ICONV iconv)
++  find_library(LIB_ICONV iconv HINTS "${ICONV_LIB_PATH}")
+   find_library(LIB_M m)
+   find_library(LIB_RT rt)
diff --git a/net/softethervpn5/patches/202-pthread-include-fix.patch b/net/softethervpn5/patches/202-pthread-include-fix.patch
new file mode 100644 (file)
index 0000000..5c80d56
--- /dev/null
@@ -0,0 +1,13 @@
+--- a/src/Mayaqua/Encrypt.h
++++ b/src/Mayaqua/Encrypt.h
+@@ -9,7 +9,9 @@
+ #define       ENCRYPT_H\r
\r
+ #include "MayaType.h"\r
+-\r
++#ifdef linux\r
++      #include <pthread.h>\r
++#endif\r
+ #include <openssl/opensslv.h>\r
\r
+ // Constant\r
diff --git a/net/softethervpn5/patches/203-increase-cfg-save-intervall.patch b/net/softethervpn5/patches/203-increase-cfg-save-intervall.patch
new file mode 100644 (file)
index 0000000..0677a8f
--- /dev/null
@@ -0,0 +1,17 @@
+--- a/src/Cedar/Server.h
++++ b/src/Cedar/Server.h
+@@ -35,10 +35,10 @@ extern char *SERVER_CONFIG_FILE_NAME;
+ #define       SERVER_CONTROL_TCP_TIMEOUT              (60 * 1000)\r
+ #define       SERVER_FARM_CONTROL_INTERVAL    (10 * 1000)\r
\r
+-#define       SERVER_FILE_SAVE_INTERVAL_DEFAULT       (5 * 60 * 1000)\r
+-#define       SERVER_FILE_SAVE_INTERVAL_MIN           (5 * 1000)\r
+-#define       SERVER_FILE_SAVE_INTERVAL_MAX           (3600 * 1000)\r
+-#define       SERVER_FILE_SAVE_INTERVAL_USERMODE      (1 * 60 * 1000)\r
++#define       SERVER_FILE_SAVE_INTERVAL_DEFAULT       (24 * 60 * 60 * 1000)\r
++#define       SERVER_FILE_SAVE_INTERVAL_MIN           (5 * 60 * 1000)\r
++#define       SERVER_FILE_SAVE_INTERVAL_MAX           (7 * 24 * 60 * 60 * 1000)\r
++#define       SERVER_FILE_SAVE_INTERVAL_USERMODE      (5 * 60 * 1000)\r
\r
+ #define       SERVER_LICENSE_VIOLATION_SPAN   (SERVER_FARM_CONTROL_INTERVAL * 2)\r
\r
diff --git a/net/softethervpn5/patches/204-add-config-write-syslog.patch b/net/softethervpn5/patches/204-add-config-write-syslog.patch
new file mode 100644 (file)
index 0000000..2cf45ae
--- /dev/null
@@ -0,0 +1,21 @@
+--- a/src/Cedar/Server.c
++++ b/src/Cedar/Server.c
+@@ -5,6 +5,7 @@
+ // Server.c\r
+ // VPN Server module\r
\r
++#include <syslog.h>\r
+ #include "Server.h"\r
\r
+ #include "Admin.h"\r
+@@ -6593,6 +6594,10 @@ UINT SiWriteConfigurationFile(SERVER *s)
+       {\r
+               return 0;\r
+       }\r
++      \r
++      openlog("softethervpn-server", LOG_CONS | LOG_PID | LOG_NDELAY, LOG_DAEMON);\r
++      syslog(LOG_NOTICE, "Writing vpn_server.config (AutoSaveConfigSpan set to < %d > seconds)", (s->AutoSaveConfigSpan / 1000));\r
++      closelog();\r
\r
+       Lock(s->SaveCfgLock);\r
+       {\r