From b014ae3f8628dff9196b82929f231b3dbf160fa9 Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Tue, 2 Apr 2024 13:03:53 -0600 Subject: [PATCH] strongswan: Backport upstream fix for RNG definition conflict Signed-off-by: Philip Prindeville --- net/strongswan/Makefile | 2 +- .../patches/0003-undef-wolfssl-RNG.patch | 39 +++++++++++++++++++ .../patches/0905-undef-wolfssl-RNG.patch | 12 ------ 3 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 net/strongswan/patches/0003-undef-wolfssl-RNG.patch delete mode 100644 net/strongswan/patches/0905-undef-wolfssl-RNG.patch diff --git a/net/strongswan/Makefile b/net/strongswan/Makefile index b74095981045db..2ff7c8ee3c2f46 100644 --- a/net/strongswan/Makefile +++ b/net/strongswan/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=strongswan PKG_VERSION:=5.9.14 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=https://download.strongswan.org/ https://download2.strongswan.org/ diff --git a/net/strongswan/patches/0003-undef-wolfssl-RNG.patch b/net/strongswan/patches/0003-undef-wolfssl-RNG.patch new file mode 100644 index 00000000000000..8f28c0fe80b771 --- /dev/null +++ b/net/strongswan/patches/0003-undef-wolfssl-RNG.patch @@ -0,0 +1,39 @@ +commit 5226561a77efc94b53d708a855df267b11f53b83 +Author: Philip Prindeville +Date: Wed Mar 27 17:41:18 2024 -0600 + + wolfssl: avoid RNG redefinition + + There are definitions of RNG in and + that play havoc with the literal RNG being + used in the expansions of _PLUGIN_FEATURE_RNG() => __PLUGIN_FEATURE() + in when ##-concatenated to build the + enum FEATURE_RNG. + + must always be included before + , and RNG must be undefined before any plugins are + declared. + + Signed-off-by: Philip Prindeville + +--- a/src/libstrongswan/plugins/wolfssl/wolfssl_common.h ++++ b/src/libstrongswan/plugins/wolfssl/wolfssl_common.h +@@ -80,7 +80,4 @@ typedef union { + + #undef PARSE_ERROR + +-/* Eliminate macro conflicts */ +-#undef RNG +- + #endif /* WOLFSSL_PLUGIN_COMMON_H_ */ +--- a/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c ++++ b/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c +@@ -47,6 +47,8 @@ + + #include + ++#undef RNG ++ + #ifndef FIPS_MODE + #define FIPS_MODE 0 + #endif diff --git a/net/strongswan/patches/0905-undef-wolfssl-RNG.patch b/net/strongswan/patches/0905-undef-wolfssl-RNG.patch deleted file mode 100644 index dfca722c94e3e8..00000000000000 --- a/net/strongswan/patches/0905-undef-wolfssl-RNG.patch +++ /dev/null @@ -1,12 +0,0 @@ ---- a/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c -+++ b/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c -@@ -50,6 +50,9 @@ - #ifndef FIPS_MODE - #define FIPS_MODE 0 - #endif -+#ifdef RNG -+#undef RNG -+#endif - - typedef struct private_wolfssl_plugin_t private_wolfssl_plugin_t; -