Skip to content

Commit

Permalink
strongswan: Backport upstream fix for RNG definition conflict
Browse files Browse the repository at this point in the history
Signed-off-by: Philip Prindeville <[email protected]>
  • Loading branch information
pprindeville committed Apr 4, 2024
1 parent 428e9da commit b014ae3
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 13 deletions.
2 changes: 1 addition & 1 deletion net/strongswan/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
39 changes: 39 additions & 0 deletions net/strongswan/patches/0003-undef-wolfssl-RNG.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
commit 5226561a77efc94b53d708a855df267b11f53b83
Author: Philip Prindeville <[email protected]>
Date: Wed Mar 27 17:41:18 2024 -0600

wolfssl: avoid RNG redefinition

There are definitions of RNG in <wolfcrypt/settings.h> and
<wolfcrypt/random.h> that play havoc with the literal RNG being
used in the expansions of _PLUGIN_FEATURE_RNG() => __PLUGIN_FEATURE()
in <plugins/plugin_feature.h> when ##-concatenated to build the
enum FEATURE_RNG.

<plugins/plugin_feature.h> must always be included before
<woldssl/ssl.h>, and RNG must be undefined before any plugins are
declared.

Signed-off-by: Philip Prindeville <[email protected]>

--- 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 <wolfssl/ssl.h>

+#undef RNG
+
#ifndef FIPS_MODE
#define FIPS_MODE 0
#endif
12 changes: 0 additions & 12 deletions net/strongswan/patches/0905-undef-wolfssl-RNG.patch

This file was deleted.

0 comments on commit b014ae3

Please sign in to comment.