summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYi Zhao <yi.zhao@windriver.com>2022-06-29 14:53:05 +0800
committerArmin Kuster <akuster808@gmail.com>2022-07-04 09:25:31 -0400
commit1cd38eed74a1e1700f83b65193e421e67bbf9aaa (patch)
tree0b34f9f49095360a8d9e6f26d5f4ab8a6da5bfde
parente4c5f5b3593c4dc058053e92b28306bf7e765d75 (diff)
downloadmeta-openembedded-1cd38eed74a1e1700f83b65193e421e67bbf9aaa.tar.gz
strongswan: upgrade 5.9.5 -> 5.9.6
* Drop backport patch 0001-openssl-Don-t-unload-providers.patch * Backport a patch to fix the build error: src/libstrongswan/utils/enum.c: In function 'enum_flags_to_string': src/libstrongswan/utils/enum.c:100:9: error: format not a string literal and no format arguments [-Werror=format-security] 100 | if (snprintf(buf, len, e->names[0]) >= len) | ^~ Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> (cherry picked from commit 689e8422b836d804d9ab102cb3de0a4f6e1f24c8) Signed-off-by: Armin Kuster <akuster808@gmail.com>
-rw-r--r--meta-networking/recipes-support/strongswan/files/0001-enum-Fix-compiler-warning.patch31
-rw-r--r--meta-networking/recipes-support/strongswan/files/0001-openssl-Don-t-unload-providers.patch92
-rw-r--r--meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb (renamed from meta-networking/recipes-support/strongswan/strongswan_5.9.5.bb)4
3 files changed, 33 insertions, 94 deletions
diff --git a/meta-networking/recipes-support/strongswan/files/0001-enum-Fix-compiler-warning.patch b/meta-networking/recipes-support/strongswan/files/0001-enum-Fix-compiler-warning.patch
new file mode 100644
index 0000000000..e730fe1cd0
--- /dev/null
+++ b/meta-networking/recipes-support/strongswan/files/0001-enum-Fix-compiler-warning.patch
@@ -0,0 +1,31 @@
1From d23c0ea81e630af3cfda89aeeb52146c0c84c960 Mon Sep 17 00:00:00 2001
2From: Tobias Brunner <tobias@strongswan.org>
3Date: Mon, 2 May 2022 09:31:49 +0200
4Subject: [PATCH] enum: Fix compiler warning
5
6Closes strongswan/strongswan#1025
7
8Upstream-Status: Backport
9[https://github.com/strongswan/strongswan/commit/d23c0ea81e630af3cfda89aeeb52146c0c84c960]
10
11Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
12---
13 src/libstrongswan/utils/enum.c | 2 +-
14 1 file changed, 1 insertion(+), 1 deletion(-)
15
16diff --git a/src/libstrongswan/utils/enum.c b/src/libstrongswan/utils/enum.c
17index 79da450f0c..1e77489f6f 100644
18--- a/src/libstrongswan/utils/enum.c
19+++ b/src/libstrongswan/utils/enum.c
20@@ -97,7 +97,7 @@ char *enum_flags_to_string(enum_name_t *e, u_int val, char *buf, size_t len)
21 return buf;
22 }
23
24- if (snprintf(buf, len, e->names[0]) >= len)
25+ if (snprintf(buf, len, "%s", e->names[0]) >= len)
26 {
27 return NULL;
28 }
29--
302.25.1
31
diff --git a/meta-networking/recipes-support/strongswan/files/0001-openssl-Don-t-unload-providers.patch b/meta-networking/recipes-support/strongswan/files/0001-openssl-Don-t-unload-providers.patch
deleted file mode 100644
index 7da48cd2cf..0000000000
--- a/meta-networking/recipes-support/strongswan/files/0001-openssl-Don-t-unload-providers.patch
+++ /dev/null
@@ -1,92 +0,0 @@
1From 3eecd40cec6415fc033f8d9141ab652047e71524 Mon Sep 17 00:00:00 2001
2From: Tobias Brunner <tobias@strongswan.org>
3Date: Wed, 23 Feb 2022 17:29:02 +0100
4Subject: [PATCH] openssl: Don't unload providers
5
6There is a conflict between atexit() handlers registered by OpenSSL and
7some executables (e.g. swanctl or pki) to deinitialize libstrongswan.
8Because plugins are usually loaded after atexit() has been called, the
9handler registered by OpenSSL will run before our handler. So when the
10latter destroys the plugins it's a bad idea to try to access any OpenSSL
11objects as they might already be invalid.
12
13Fixes: f556fce16b60 ("openssl: Load "legacy" provider in OpenSSL 3 for algorithms like MD4, DES etc.")
14Closes strongswan/strongswan#921
15
16Upstream-Status: Backport
17[https://github.com/strongswan/strongswan/commit/3eecd40cec6415fc033f8d9141ab652047e71524]
18
19Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
20---
21 .../plugins/openssl/openssl_plugin.c | 27 +++----------------
22 1 file changed, 3 insertions(+), 24 deletions(-)
23
24diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c
25index 6b4923649..1491d5cf8 100644
26--- a/src/libstrongswan/plugins/openssl/openssl_plugin.c
27+++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c
28@@ -16,7 +16,6 @@
29
30 #include <library.h>
31 #include <utils/debug.h>
32-#include <collections/array.h>
33 #include <threading/thread.h>
34 #include <threading/mutex.h>
35 #include <threading/thread_value.h>
36@@ -74,13 +73,6 @@ struct private_openssl_plugin_t {
37 * public functions
38 */
39 openssl_plugin_t public;
40-
41-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
42- /**
43- * Loaded providers
44- */
45- array_t *providers;
46-#endif
47 };
48
49 /**
50@@ -887,15 +879,6 @@ METHOD(plugin_t, get_features, int,
51 METHOD(plugin_t, destroy, void,
52 private_openssl_plugin_t *this)
53 {
54-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
55- OSSL_PROVIDER *provider;
56- while (array_remove(this->providers, ARRAY_TAIL, &provider))
57- {
58- OSSL_PROVIDER_unload(provider);
59- }
60- array_destroy(this->providers);
61-#endif /* OPENSSL_VERSION_NUMBER */
62-
63 /* OpenSSL 1.1.0 cleans up itself at exit and while OPENSSL_cleanup() exists we
64 * can't call it as we couldn't re-initialize the library (as required by the
65 * unit tests and the Android app) */
66@@ -1009,20 +992,16 @@ plugin_t *openssl_plugin_create()
67 DBG1(DBG_LIB, "unable to load OpenSSL FIPS provider");
68 return NULL;
69 }
70- array_insert_create(&this->providers, ARRAY_TAIL, fips);
71 /* explicitly load the base provider containing encoding functions */
72- array_insert_create(&this->providers, ARRAY_TAIL,
73- OSSL_PROVIDER_load(NULL, "base"));
74+ OSSL_PROVIDER_load(NULL, "base");
75 }
76 else if (lib->settings->get_bool(lib->settings, "%s.plugins.openssl.load_legacy",
77 TRUE, lib->ns))
78 {
79 /* load the legacy provider for algorithms like MD4, DES, BF etc. */
80- array_insert_create(&this->providers, ARRAY_TAIL,
81- OSSL_PROVIDER_load(NULL, "legacy"));
82+ OSSL_PROVIDER_load(NULL, "legacy");
83 /* explicitly load the default provider, as mentioned by crypto(7) */
84- array_insert_create(&this->providers, ARRAY_TAIL,
85- OSSL_PROVIDER_load(NULL, "default"));
86+ OSSL_PROVIDER_load(NULL, "default");
87 }
88 ossl_provider_names_t data = {};
89 OSSL_PROVIDER_do_all(NULL, concat_ossl_providers, &data);
90--
912.25.1
92
diff --git a/meta-networking/recipes-support/strongswan/strongswan_5.9.5.bb b/meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb
index cfb7b41fa4..1b82dceac2 100644
--- a/meta-networking/recipes-support/strongswan/strongswan_5.9.5.bb
+++ b/meta-networking/recipes-support/strongswan/strongswan_5.9.6.bb
@@ -9,10 +9,10 @@ DEPENDS = "flex-native flex bison-native"
9DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}" 9DEPENDS:append = "${@bb.utils.contains('DISTRO_FEATURES', 'tpm2', ' tpm2-tss', '', d)}"
10 10
11SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \ 11SRC_URI = "http://download.strongswan.org/strongswan-${PV}.tar.bz2 \
12 file://0001-openssl-Don-t-unload-providers.patch \ 12 file://0001-enum-Fix-compiler-warning.patch \
13 " 13 "
14 14
15SRC_URI[sha256sum] = "983e4ef4a4c6c9d69f5fe6707c7fe0b2b9a9291943bbf4e008faab6bf91c0bdd" 15SRC_URI[sha256sum] = "91d0978ac448912759b85452d8ff0d578aafd4507aaf4f1c1719f9d0c7318ab7"
16 16
17UPSTREAM_CHECK_REGEX = "strongswan-(?P<pver>\d+(\.\d+)+)\.tar" 17UPSTREAM_CHECK_REGEX = "strongswan-(?P<pver>\d+(\.\d+)+)\.tar"
18 18