Skip to contentSkip to conversation

rpm-sequoia-crypto-policy: New recipe

PATCH Superseded Zoltán Böszörményi 3 participants 12 messages Feb 6, 2025 1 message not in the archive

v8 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

PATCH v8 1/5 rpm-sequoia-crypto-policy: New recipe

This ships a crypto policy file for rpm-sequoia.

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 .../rpm-sequoia-crypto-policy_git.bb          | 27 +++++++++++++++++++
 2 files changed, 28 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb
meta/conf/distro/include/maintainers.inc +1 -0
index bec55a7c1c..648c8fceb8 100644
@@ -744,6 +744,7 @@ RECIPE_MAINTAINER:pn-rpcbind = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-rng-tools = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-rpcsvc-proto = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-rpm = "Robert Yang <[email protected]>"
+RECIPE_MAINTAINER:pn-rpm-sequoia-crypto-policy = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-rsync = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-rt-tests = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER:pn-ruby = "Ross Burton <[email protected]>"
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb new file +27 -0
new file mode 100644
index 0000000000..47ca7ca6a4
@@ -0,0 +1,27 @@
+SUMMARY = "Crypto policy for rpm-sequoia"
+HOMEPAGE = "https://gitlab.com/redhat-crypto/fedora-crypto-policies/"
+
+LICENSE = "LGPL-2.1-or-later"
+
+LIC_FILES_CHKSUM = "file://COPYING.LESSER;md5=a6f89e2100d9b6cdffcea4f398e37343"
+
+DEPENDS = "openssl-native asciidoc-native libxslt-native make-native"
+
+SRC_URI = "git://gitlab.com/redhat-crypto/fedora-crypto-policies.git;protocol=https;branch=master"
+
+# Commit ID for crypto-policies 20250124-1.git4d262e7.fc41
+SRCREV = "4d262e79be1cd15c84cad55ad88c53a2d7712e85"
+PV = "20250124"
+
+S = "${UNPACKDIR}/git"
+
+do_compile () {
+	make
+}
+
+do_install () {
+	mkdir -p ${D}${datadir}/crypto-policies/back-ends
+	install -m644 ${S}/output/DEFAULT/rpm-sequoia.txt ${D}${datadir}/crypto-policies/back-ends/rpm-sequoia.config
+}
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.48.1
#1 lore raw

PATCH v8 2/5 rpm-sequoia: New recipe for version 1.7.0

rpm 4.20 removed the built-in code to handle signed packages and uses rpm-sequoia as a more feature complete library.

Runtime-depend on rpm-sequoia-crypto-policy.

---
 meta/conf/distro/include/maintainers.inc      |   1 +
 .../rpm-sequoia/rpm-sequoia-crates.inc        | 486 ++++++++++++++++++
 .../rpm-sequoia/rpm-sequoia_1.7.0.bb          |  60 +++
 3 files changed, 547 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb
meta/conf/distro/include/maintainers.inc +1 -0
index 648c8fceb8..24c8a850ec 100644
@@ -744,6 +744,7 @@ RECIPE_MAINTAINER:pn-rpcbind = "Hongxu Jia <[email protected]>"
 RECIPE_MAINTAINER:pn-rng-tools = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER:pn-rpcsvc-proto = "Khem Raj <[email protected]>"
 RECIPE_MAINTAINER:pn-rpm = "Robert Yang <[email protected]>"
+RECIPE_MAINTAINER:pn-rpm-sequoia = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-rpm-sequoia-crypto-policy = "Zoltán Böszörményi <[email protected]>"
 RECIPE_MAINTAINER:pn-rsync = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER:pn-rt-tests = "Unassigned <[email protected]>"
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crates.inc new file +486 -0

486 lines not on this page · raw message

meta/recipes-devtools/rpm-sequoia/rpm-sequoia_1.7.0.bb new file +60 -0

60 lines not on this page · raw message

Signature · 1 line
2.48.1
#2 lore raw

PATCH v8 3/5 rpm: Set SEQUOIA_CRYPTO_POLICY in wrapped tools

In reply to Zoltán Böszörményi

Point to the crypto policy file so RPM signing may work.

---
 meta/recipes-devtools/rpm/rpm_4.20.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/rpm/rpm_4.20.0.bb +1 -0
index 6c995ff50c..d296c20d78 100644
@@ -100,6 +100,7 @@ WRAPPER_TOOLS = " \
 do_install:append:class-native() {
         for tool in ${WRAPPER_TOOLS}; do
                 test -x ${D}$tool && create_wrapper ${D}$tool \
+                        SEQUOIA_CRYPTO_POLICY=${STAGING_DATADIR_NATIVE}/crypto-policies/back-ends/rpm-sequoia.config \
                         RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
                         RPM_ETCCONFIGDIR=${STAGING_DIR_NATIVE} \
                         MAGIC=${STAGING_DIR_NATIVE}${datadir_native}/misc/magic.mgc \
Signature · 1 line
2.48.1
#3 lore raw

PATCH v8 4/5 dnf: Set SEQUOIA_CRYPTO_POLICY in wrapped tools

In reply to Zoltán Böszörményi

Point to the crypto policy file so dnf can work with signed packages.

---
 meta/recipes-devtools/dnf/dnf_4.22.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/dnf/dnf_4.22.0.bb +1 -0
index f9d6ea1fa6..e5ac3c9824 100644
@@ -69,6 +69,7 @@ do_install:append() {
 # Direct dnf-native to read rpm configuration from our sysroot, not the one it was compiled in
 do_install:append:class-native() {
         create_wrapper ${D}/${bindir}/dnf \
+                SEQUOIA_CRYPTO_POLICY=${STAGING_DATADIR_NATIVE}/crypto-policies/back-ends/rpm-sequoia.config \
                 RPM_CONFIGDIR=${STAGING_LIBDIR_NATIVE}/rpm \
                 RPM_NO_CHROOT_FOR_SCRIPTS=1
 }
Signature · 1 line
2.48.1
#4 lore raw

PATCH v8 5/5 oeqa/selftest/cases/signing.py: Re-enable self-test

In reply to Zoltán Böszörményi

With all the pieces in place, the self test can be re-enabled.

---
 meta/lib/oeqa/selftest/cases/signing.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/lib/oeqa/selftest/cases/signing.py +2 -1
index 51d1c3fa64..4df45ba032 100644
@@ -71,7 +71,6 @@ class Signing(OESelftestTestCase):
         """
         import oe.packagedata
 
-        self.skipTest('This test requires rpm-sequoia support in rpm')
         self.setup_gpg()
 
         package_classes = get_bb_var('PACKAGE_CLASSES')
@@ -84,6 +83,8 @@ class Signing(OESelftestTestCase):
         feature += 'RPM_GPG_PASSPHRASE = "test123"\n'
         feature += 'RPM_GPG_NAME = "testuser"\n'
         feature += 'GPG_PATH = "%s"\n' % self.gpg_dir
+        feature += 'PACKAGECONFIG:append:pn-rpm-native = " sequoia"\n'
+        feature += 'PACKAGECONFIG:append:pn-rpm = " sequoia"\n'
 
         self.write_config(feature)
 
Signature · 1 line
2.48.1
#5 lore raw
In reply to Zoltán Böszörményi
Quoted 4 lines · Zoltán Böszörményi

This ships a crypto policy file for rpm-sequoia.

---

Hi Zoltán,

Thanks for the patch update.

I believe there is a regression introduced by this version of your series, several builds are failing with:

ERROR: rpm-sequoia-crypto-policy-native-20250124-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/temp/run.do_compile.537997' failed with exit code 2 Log data follows:

| DEBUG: Executing shell function do_compile
| asciidoc -v -d manpage -b docbook crypto-policies.7.txt
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/asciidoc.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/sources-unpack/git/crypto-policies.7.txt
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/docbook45.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/source/source-highlight-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/code/code-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/latex/latex-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/graphviz/graphviz-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/music/music-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/lang-en.conf
| asciidoc: writing: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/sources-unpack/git/crypto-policies.7.xml
| xsltproc --nonet -o crypto-policies.7 /usr/share/asciidoc/docbook-xsl/manpage.xsl crypto-policies.7.xml
| warning: failed to load external entity "/usr/share/asciidoc/docbook-xsl/manpage.xsl"
| cannot parse /usr/share/asciidoc/docbook-xsl/manpage.xsl
| make: *** [Makefile:137: crypto-policies.7] Error 4
| WARNING: exit code 2 from a shell command.

https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/870/steps/14/logs/stdio

Might this be a missing dependency ?

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#6 lore raw

2025. 02. 06. 11:16 keltezéssel, Mathieu Dubois-Briand írta:

Quoted 32 lines · Zoltán Böszörményi
Quoted 4 lines

This ships a crypto policy file for rpm-sequoia.

---

Hi Zoltán,

Thanks for the patch update.

I believe there is a regression introduced by this version of your series, several builds are failing with:

ERROR: rpm-sequoia-crypto-policy-native-20250124-r0 do_compile: Execution of '/srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/temp/run.do_compile.537997' failed with exit code 2 Log data follows:

| DEBUG: Executing shell function do_compile
| asciidoc -v -d manpage -b docbook crypto-policies.7.txt
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/asciidoc.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/sources-unpack/git/crypto-policies.7.txt
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/docbook45.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/source/source-highlight-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/code/code-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/latex/latex-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/graphviz/graphviz-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/filters/music/music-filter.conf
| asciidoc: reading: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/recipe-sysroot-native/usr/lib/python3.13/site-packages/asciidoc/resources/lang-en.conf
| asciidoc: writing: /srv/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rpm-sequoia-crypto-policy-native/20250124/sources-unpack/git/crypto-policies.7.xml
| xsltproc --nonet -o crypto-policies.7 /usr/share/asciidoc/docbook-xsl/manpage.xsl crypto-policies.7.xml
| warning: failed to load external entity "/usr/share/asciidoc/docbook-xsl/manpage.xsl"
| cannot parse /usr/share/asciidoc/docbook-xsl/manpage.xsl
| make: *** [Makefile:137: crypto-policies.7] Error 4
| WARNING: exit code 2 from a shell command.
Quoted 3 lines

https://autobuilder.yoctoproject.org/valkyrie/#/builders/48/builds/870/steps/14/logs/stdio

Might this be a missing dependency ?

Sigh.

That's what you get when your regular dev laptop is also the buildbox, with a lot of things already installed.

I will try to patch and reduce the dependencies instead, as there's no need for building the documentation for the crypto policies.

#7 lore raw
Quoted 2 lines · Böszörményi Zoltán

I will try to patch and reduce the dependencies instead, as there's no need for building the documentation for the crypto policies.

This would work too. Those aren't trivial dependencies to fulfill, and they're unnecessary for us at the same time.

Alex

A message that is not in the archive (sent off-list or not yet received): [email protected]

#9 lore raw
Quoted 2 lines

This would work too. Those aren't trivial dependencies to fulfill, and they're unnecessary for us at the same time.

If you're making a patch, don't just patch out the documentation lines in Makefile. Make it conditional to a variable, so we can set that in the recipe, and offer the patch upstream.

Alex

#10 lore raw

2025. 02. 06. 11:53 keltezéssel, Alexander Kanavin írta:

Quoted 5 lines
Quoted 2 lines

This would work too. Those aren't trivial dependencies to fulfill, and they're unnecessary for us at the same time.

If you're making a patch, don't just patch out the documentation lines in Makefile. Make it conditional to a variable, so we can set that in the recipe, and offer the patch upstream.

I patched the Makefile in a way that's already in its mindset. asciidoc can already be overridden, I just made the same with xlstproc. The PR against the upstream sources was created, it's referenced in the patches in the recipe.

I just sent the v9 series with the two patches, hopefully it will work now.

#11 lore raw
Quoted 6 lines · Böszörményi Zoltán

I patched the Makefile in a way that's already in its mindset. asciidoc can already be overridden, I just made the same with xlstproc. The PR against the upstream sources was created, it's referenced in the patches in the recipe.

I just sent the v9 series with the two patches, hopefully it will work now.

Thanks, if there are no further autobuilder fails, then the patchset is fine.

Alex

#12 lore raw
In reply to Zoltán Böszörményi

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb line 14

Quoted 5 lines · Zoltán Böszörményi
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb new file +5 -0
+SRC_URI = "git://gitlab.com/redhat-crypto/fedora-crypto-policies.git;protocol=https;branch=master"
+
+# Commit ID for crypto-policies 20250124-1.git4d262e7.fc41
+SRCREV = "4d262e79be1cd15c84cad55ad88c53a2d7712e85"
+PV = "20250124"

Do not set PV at all here. Git repo doesn't contain these tags, or any useful tags actually.
Set UPSTREAM_CHECK_COMMITS instead so we just update to latest commit from time to time.

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb line 20

Quoted 3 lines
meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb new file +3 -0
+do_compile () {
+       make
+}

To fix an error reported below, use MANPAGEXSL=.. prefix to make invocation that points to this file in the sysroot, check the upstream Makefile.

Alex