From 1b190539197f18ab5e3629caf4aa7397d47dfaad Mon Sep 17 00:00:00 2001 From: Noel Kuntze Date: Mon, 25 Mar 2024 11:22:30 -0600 Subject: [PATCH 1/2] uci: Upstream patch to adapt to option datatype abstraction This is a patch from the OpenWrt package sources necessary to adapt to changes from 2008 that abstracted the option datatype (added a list type). Signed-off-by: Noel Kuntze Reviewed-by: Philip Prindeville --- src/libcharon/plugins/uci/uci_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libcharon/plugins/uci/uci_parser.c b/src/libcharon/plugins/uci/uci_parser.c index 0689642d0..c34c897b0 100644 --- a/src/libcharon/plugins/uci/uci_parser.c +++ b/src/libcharon/plugins/uci/uci_parser.c @@ -76,7 +76,7 @@ METHOD(enumerator_t, section_enumerator_enumerate, bool, if (uci_lookup(this->ctx, &element, this->package, this->current->name, "name") == UCI_OK) { /* use "name" attribute as config name if available ... */ - *value = uci_to_option(element)->value; + *value = uci_to_option(element)->v.string; } else { /* ... or the section name becomes config name */ @@ -91,7 +91,7 @@ METHOD(enumerator_t, section_enumerator_enumerate, bool, if (value && uci_lookup(this->ctx, &element, this->package, this->current->name, this->keywords[i]) == UCI_OK) { - *value = uci_to_option(element)->value; + *value = uci_to_option(element)->v.string; } } From e5bc3a50f6d326fd51dea5febee74e1ed7fb1e5e Mon Sep 17 00:00:00 2001 From: Philip Prindeville Date: Wed, 27 Mar 2024 17:41:18 -0600 Subject: [PATCH 2/2] wolfssl: Avoid conflict with RNG when built without EdDSA or FIPS enabled There are definitions of RNG in and 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 --- src/libstrongswan/plugins/wolfssl/wolfssl_common.h | 3 --- src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/libstrongswan/plugins/wolfssl/wolfssl_common.h b/src/libstrongswan/plugins/wolfssl/wolfssl_common.h index 9c944e711..98a5593aa 100644 --- 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_ */ diff --git a/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c b/src/libstrongswan/plugins/wolfssl/wolfssl_plugin.c index d4b4989b0..fa4edeeef 100644 --- 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