]> git.ipfire.org Git - thirdparty/strongswan.git/commitdiff
wolfssl: Avoid conflict with RNG when built without EdDSA or FIPS enabled
authorPhilip Prindeville <philipp@redfish-solutions.com>
Wed, 27 Mar 2024 23:41:18 +0000 (17:41 -0600)
committerTobias Brunner <tobias@strongswan.org>
Wed, 3 Apr 2024 06:48:46 +0000 (08:48 +0200)
There are definitions of RNG in <wolfssl/wolfcrypt/settings.h> and
<wolfssl/wolfcrypt/random.h> that play havoc with the literal RNG being
used in the expansions of PLUGIN_*(RNG, ...) when ##-concatenated to
build the enum value FEATURE_RNG.

The #undef in wolfssl_cmmon.h only had an effect if wolfSSL was built
with EdDSA or FIPS enabled, otherwise, the headers that define RNG were
not pulled in before it.

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
src/libstrongswan/plugins/wolfssl/wolfssl_common.h
src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c

index 9c944e71195f3d0b95ccf045ee618f6a7e5ded10..98a5593aab51651d070f4d657ecb4a38e66adfcf 100644 (file)
@@ -80,7 +80,4 @@ typedef union {
 
 #undef PARSE_ERROR
 
-/* Eliminate macro conflicts */
-#undef RNG
-
 #endif /* WOLFSSL_PLUGIN_COMMON_H_ */
index d4b4989b09794998ccc415a5382d7bae15f3b759..fa4edeeef9963e3d948d1b25f6f5f8717968f475 100644 (file)
@@ -47,6 +47,8 @@
 
 #include <wolfssl/ssl.h>
 
+#undef RNG
+
 #ifndef FIPS_MODE
 #define FIPS_MODE 0
 #endif