summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoann Congal <yoann.congal@smile.fr>2025-04-15 23:34:27 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-04-24 11:27:06 +0100
commit706085aaf72ff6d60e65c812e9d06388e3347d65 (patch)
treeb6b91c1dc557d2b4f4bbd5e9014b12717613e103
parent576c4fd9e0b571c3ee37f67f25a51fe68466eac3 (diff)
downloadpoky-706085aaf72ff6d60e65c812e9d06388e3347d65.tar.gz
rpm-sequoia-crypto-policy: Fix build failure on Debian 12+Strongswan
rpm-sequoia-crypto-policy tries to validate the configuration files using host tools. For the Strongswan policy, it uses "ipsec readwriteconf" which is not available on Debian 12 with Strongswan installed. To fix this, add and use an option to skip the problematic validation. (From OE-Core rev: d10ca0fe194b62b2f383be880a008cde2bd0fd4f) Signed-off-by: Yoann Congal <yoann.congal@smile.fr> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0001-libreswan-Allow-skipping-test_config-for-old-ipsec.patch29
-rw-r--r--meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb8
2 files changed, 35 insertions, 2 deletions
diff --git a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0001-libreswan-Allow-skipping-test_config-for-old-ipsec.patch b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0001-libreswan-Allow-skipping-test_config-for-old-ipsec.patch
new file mode 100644
index 0000000000..db3ea4b843
--- /dev/null
+++ b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0001-libreswan-Allow-skipping-test_config-for-old-ipsec.patch
@@ -0,0 +1,29 @@
1From f7a8e2c049c2c3e2bfcb801d7b65214c0a5bad77 Mon Sep 17 00:00:00 2001
2From: Yoann Congal <yoann.congal@smile.fr>
3Date: Tue, 15 Apr 2025 17:27:20 +0200
4Subject: [PATCH] libreswan: Allow skipping test_config for old ipsec
5
6In some case, /usr/sbin/ipsec does not handle the readwriteconf command.
7e.g. on Debian 12 with strongswan installed.
8As with the other OLD_* variables, add an OLD_LIBRESWAN environment
9variable to skip configuration testing on those systems.
10
11Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
12Upstream-Status: Backport [https://gitlab.com/redhat-crypto/fedora-crypto-policies/-/merge_requests/237]
13---
14 python/policygenerators/libreswan.py | 2 ++
15 1 file changed, 2 insertions(+)
16
17diff --git a/python/policygenerators/libreswan.py b/python/policygenerators/libreswan.py
18index a2b02f5..d81ec0c 100644
19--- a/python/policygenerators/libreswan.py
20+++ b/python/policygenerators/libreswan.py
21@@ -227,6 +227,8 @@ class LibreswanGenerator(ConfigGenerator):
22
23 @classmethod
24 def test_config(cls, config):
25+ if os.getenv('OLD_LIBRESWAN') == '1':
26+ return True
27 if not os.access('/usr/sbin/ipsec', os.X_OK):
28 return True
29
diff --git a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb
index 522e9a393d..4ccfc95c33 100644
--- a/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb
+++ b/meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb
@@ -8,7 +8,10 @@ LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
8# Python 3.11+ is needed to build fedora-crypto-policies 8# Python 3.11+ is needed to build fedora-crypto-policies
9inherit allarch python3native 9inherit allarch python3native
10 10
11SRC_URI = "git://gitlab.com/redhat-crypto/fedora-crypto-policies.git;protocol=https;branch=master" 11SRC_URI = " \
12 git://gitlab.com/redhat-crypto/fedora-crypto-policies.git;protocol=https;branch=master \
13 file://0001-libreswan-Allow-skipping-test_config-for-old-ipsec.patch \
14"
12 15
13SRCREV = "032b418a6db842f0eab330eb5909e4604e888728" 16SRCREV = "032b418a6db842f0eab330eb5909e4604e888728"
14UPSTREAM_CHECK_COMMITS = "1" 17UPSTREAM_CHECK_COMMITS = "1"
@@ -20,10 +23,11 @@ do_compile () {
20 # It speeds up the build and we only need DEFAULT/rpm-sequoia. 23 # It speeds up the build and we only need DEFAULT/rpm-sequoia.
21 rm -f $(ls -1 policies/*.pol | grep -v DEFAULT.pol) || echo nothing to delete 24 rm -f $(ls -1 policies/*.pol | grep -v DEFAULT.pol) || echo nothing to delete
22 25
23 # Don't validate openssh and gnutls policy variants. 26 # Don't validate openssh, gnutls and libreswan policy variants.
24 # Validation may fail and these variants are not needed. 27 # Validation may fail and these variants are not needed.
25 export OLD_OPENSSH=1 28 export OLD_OPENSSH=1
26 export OLD_GNUTLS=1 29 export OLD_GNUTLS=1
30 export OLD_LIBRESWAN=1
27 31
28 make ASCIIDOC=echo XSLTPROC=echo 32 make ASCIIDOC=echo XSLTPROC=echo
29} 33}