Skip to content

Commit 05ff9d3

Browse files
mayankfzMayank Singh
andauthored
Bug 57529496: upgrade strongswan in parity with Fedora and build with enable-systemd (#13865)
Signed-off-by: Mayank Singh <mayansingh@microsoft.com> Co-authored-by: Mayank Singh <mayansingh@microsoft.com>
1 parent a4141a6 commit 05ff9d3

12 files changed

Lines changed: 1801 additions & 96 deletions

LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

LICENSES-AND-NOTICES/SPECS/data/licenses.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2051,6 +2051,7 @@
20512051
"star",
20522052
"startup-notification",
20532053
"stress-ng",
2054+
"strongswan",
20542055
"stunnel",
20552056
"subscription-manager",
20562057
"subunit",
@@ -3083,7 +3084,6 @@
30833084
"sqlite",
30843085
"sshpass",
30853086
"strace",
3086-
"strongswan",
30873087
"subversion",
30883088
"sudo",
30893089
"swig",
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
From 7c38995d360d4abf2d919fd08428f5cb2c1b015e Mon Sep 17 00:00:00 2001
2-
From: Pawel <pawelwi@microsoft.com>
3-
Date: Mon, 5 Oct 2020 06:34:43 -0700
1+
From 115eca353c55587ff6dacdadf22075904adf92d6 Mon Sep 17 00:00:00 2001
2+
From: Mayank Singh <mayansingh@microsoft.com>
3+
Date: Thu, 22 May 2025 11:27:30 +0000
44
Subject: [PATCH] Extending timeout for test cases with multiple read/writes.
55

66
---
77
src/libstrongswan/tests/suites/test_settings.c | 1 +
88
1 file changed, 1 insertion(+)
99

1010
diff --git a/src/libstrongswan/tests/suites/test_settings.c b/src/libstrongswan/tests/suites/test_settings.c
11-
index e060960..df3b4ef 100644
11+
index 8ef026b..a7b2b98 100644
1212
--- a/src/libstrongswan/tests/suites/test_settings.c
1313
+++ b/src/libstrongswan/tests/suites/test_settings.c
14-
@@ -1731,6 +1731,7 @@ Suite *settings_suite_create()
14+
@@ -1743,6 +1743,7 @@ Suite *settings_suite_create()
1515
suite_add_tcase(s, tc);
1616

1717
tc = tcase_create("valid/invalid data");
@@ -20,5 +20,5 @@ index e060960..df3b4ef 100644
2020
tcase_add_test(tc, test_valid);
2121
tcase_add_test(tc, test_invalid);
2222
--
23-
2.17.1
23+
2.45.3
2424

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff -Naur strongswan-5.6.0-orig/src/libstrongswan/utils/utils/memory.h strongswan-5.6.0/src/libstrongswan/utils/utils/memory.h
2+
--- strongswan-5.6.0-orig/src/libstrongswan/utils/utils/memory.h 2017-08-14 02:48:41.000000000 -0400
3+
+++ strongswan-5.6.0/src/libstrongswan/utils/utils/memory.h 2017-09-12 01:15:29.690527667 -0400
4+
@@ -14,6 +14,8 @@
5+
* for more details.
6+
*/
7+
8+
+#include <stdint.h> /* for uintptr_t */
9+
+
10+
/**
11+
* @defgroup memory_i memory
12+
* @{ @ingroup utils_i
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/configure.ac b/configure.ac
2+
index f9e6e55c2..247d055d8 100644
3+
--- a/configure.ac
4+
+++ b/configure.ac
5+
@@ -1480,7 +1480,6 @@ else
6+
fi
7+
# disable some warnings, whether explicitly enabled above or by default
8+
# these are not compatible with our custom printf specifiers
9+
-WARN_CFLAGS="$WARN_CFLAGS -Wno-format"
10+
WARN_CFLAGS="$WARN_CFLAGS -Wno-format-security"
11+
# we generally use comments, but GCC doesn't seem to recognize many of them
12+
WARN_CFLAGS="$WARN_CFLAGS -Wno-implicit-fallthrough"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
From cf7fb47788dfb83bb5d8bd0bffdb582e381a2f0a Mon Sep 17 00:00:00 2001
2+
From: Thomas Egerer <thomas.egerer@secunet.com>
3+
Date: Fri, 6 Sep 2024 13:29:40 +0200
4+
Subject: [PATCH] array: Don't use realloc() with zero size in array_compress()
5+
6+
The behavior of realloc(3) with zero size was apparently implementation
7+
defined. While glibc documents the behavior as equivalent to free(3),
8+
that might not apply to other C libraries. With C17, this behavior has
9+
been deprecated, and with C23, the behavior is now undefined. It's also
10+
why valgrind warns about this use.
11+
12+
Hence, when array_compress() would call realloc() with a zero size, we
13+
now call free() explicitly and set the pointer to NULL.
14+
15+
Signed-off-by: Thomas Egerer <thomas.egerer@secunet.com>
16+
---
17+
src/libstrongswan/collections/array.c | 12 +++++++++++-
18+
1 file changed, 11 insertions(+), 1 deletion(-)
19+
20+
diff --git a/src/libstrongswan/collections/array.c b/src/libstrongswan/collections/array.c
21+
index 8acc8051d53..8b6c6d7397e 100644
22+
--- a/src/libstrongswan/collections/array.c
23+
+++ b/src/libstrongswan/collections/array.c
24+
@@ -197,7 +197,17 @@ void array_compress(array_t *array)
25+
}
26+
if (tail)
27+
{
28+
- array->data = realloc(array->data, get_size(array, array->count));
29+
+ size_t size = get_size(array, array->count);
30+
+
31+
+ if (size)
32+
+ {
33+
+ array->data = realloc(array->data, size);
34+
+ }
35+
+ else
36+
+ {
37+
+ free(array->data);
38+
+ array->data = NULL;
39+
+ }
40+
array->tail = 0;
41+
}
42+
}
43+
---
44+
45+
From f1f0bd9de60e2697a712e72b7ae9f79763a0901d Mon Sep 17 00:00:00 2001
46+
From: Tobias Brunner <tobias@strongswan.org>
47+
Date: Thu, 9 Jan 2025 16:05:39 +0100
48+
Subject: [PATCH] ctr: Remove parameter-less constructor prototype
49+
50+
Useless and causes a compiler warning/error:
51+
52+
error: a function declaration without a prototype is deprecated in all versions of C and is treated as a zero-parameter prototype in C23, conflicting with a subsequent declaration [-Werror,-Wdeprecated-non-prototype]
53+
---
54+
src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.h | 5 -----
55+
1 file changed, 5 deletions(-)
56+
57+
diff --git a/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.h b/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.h
58+
index e9421a1be9f..3814465e48b 100644
59+
--- a/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.h
60+
+++ b/src/libstrongswan/plugins/ctr/ctr_ipsec_crypter.h
61+
@@ -37,11 +37,6 @@ struct ctr_ipsec_crypter_t {
62+
crypter_t crypter;
63+
};
64+
65+
-/**
66+
- * Create a ctr_ipsec_crypter instance.
67+
- */
68+
-ctr_ipsec_crypter_t *ctr_ipsec_crypter_create();
69+
-
70+
/**
71+
* Create a ctr_ipsec_crypter instance.
72+
*
73+
---
74+
75+
From 227d7ef9a24b8c62d6965c1c1690252bde7c698d Mon Sep 17 00:00:00 2001
76+
From: Tobias Brunner <tobias@strongswan.org>
77+
Date: Fri, 10 Jan 2025 15:43:11 +0100
78+
Subject: [PATCH] tnc-imv: Add missing argument to IMV recommendations
79+
constructor
80+
81+
This avoids the following warning/error:
82+
83+
tnc_imv_manager.c:244:39: error: passing arguments to 'tnc_imv_recommendations_create' without a prototype is deprecated in all versions of C and is not supported in C23 [-Werror,-Wdeprecated-non-prototype]
84+
244 | return tnc_imv_recommendations_create(this->imvs);
85+
| ^
86+
---
87+
src/libtnccs/plugins/tnc_imv/tnc_imv_recommendations.h | 7 +++++--
88+
1 file changed, 5 insertions(+), 2 deletions(-)
89+
90+
diff --git a/src/libtnccs/plugins/tnc_imv/tnc_imv_recommendations.h b/src/libtnccs/plugins/tnc_imv/tnc_imv_recommendations.h
91+
index f7178876cfd..60272978ad3 100644
92+
--- a/src/libtnccs/plugins/tnc_imv/tnc_imv_recommendations.h
93+
+++ b/src/libtnccs/plugins/tnc_imv/tnc_imv_recommendations.h
94+
@@ -27,8 +27,11 @@
95+
#include <collections/linked_list.h>
96+
97+
/**
98+
- * Create an IMV empty recommendations instance
99+
+ * Create an empty IMV recommendations instance
100+
+ *
101+
+ * @param imv_list list of IMVs that could provide recommendations
102+
+ * @return created instance
103+
*/
104+
-recommendations_t *tnc_imv_recommendations_create();
105+
+recommendations_t *tnc_imv_recommendations_create(linked_list_t *imv_list);
106+
107+
#endif /** TNC_IMV_RECOMMENDATIONS_H_ @}*/
108+
---
109+

0 commit comments

Comments
 (0)