Skip to contentSkip to conversation

rpm-sequoia-crypto-policy: New recipe

PATCH Superseded Zoltán Böszörményi 1 participant 5 messages Feb 10, 2025

v11 of 12 Superseded Latest is v12 →

lore
Share & tools
lore
#0 lore raw

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

This ships a crypto policy file for rpm-sequoia.

---
 meta/conf/distro/include/maintainers.inc      |  1 +
 ...1-Make-xsltproc-settable-as-XSLTPROC.patch | 43 ++++++++++++
 ...002-Don-t-use-hardcoded-python3-path.patch | 41 +++++++++++
 ...policy-validation-when-building-them.patch | 68 +++++++++++++++++++
 ...e-crypto-policy-list-with-a-make-var.patch | 41 +++++++++++
 .../rpm-sequoia-crypto-policy_git.bb          | 36 ++++++++++
 6 files changed, 230 insertions(+)
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0001-Make-xsltproc-settable-as-XSLTPROC.patch
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0002-Don-t-use-hardcoded-python3-path.patch
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0003-Allow-skipping-policy-validation-when-building-them.patch
 create mode 100644 meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0004-Allow-passing-the-crypto-policy-list-with-a-make-var.patch
 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/0001-Make-xsltproc-settable-as-XSLTPROC.patch new file +43 -0

43 lines not on this page · raw message

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0002-Don-t-use-hardcoded-python3-path.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0003-Allow-skipping-policy-validation-when-building-them.patch new file +68 -0

68 lines not on this page · raw message

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy/0004-Allow-passing-the-crypto-policy-list-with-a-make-var.patch new file +41 -0

41 lines not on this page · raw message

meta/recipes-devtools/rpm-sequoia/rpm-sequoia-crypto-policy_git.bb new file +36 -0
new file mode 100644
index 0000000000..23433e6797
@@ -0,0 +1,36 @@
+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 = "coreutils-native openssl-native make-native"
+
+inherit allarch python3native
+
+SRC_URI = " \
+	git://gitlab.com/redhat-crypto/fedora-crypto-policies.git;protocol=https;branch=master \
+	file://0001-Make-xsltproc-settable-as-XSLTPROC.patch \
+	file://0002-Don-t-use-hardcoded-python3-path.patch \
+	file://0003-Allow-skipping-policy-validation-when-building-them.patch \
+	file://0004-Allow-passing-the-crypto-policy-list-with-a-make-var.patch \
+"
+
+SRCREV = "445ecc87af202c8fc9249b453f41c3ac4553ffbd"
+UPSTREAM_CHECK_COMMITS = "1"
+
+S = "${UNPACKDIR}/git"
+
+do_compile () {
+	make ASCIIDOC=echo XSLTPROC=echo NOVALIDATE=1 POLICY=DEFAULT
+}
+
+do_install () {
+	install -d -m755 ${D}${datadir}/crypto-policies/back-ends
+	install -m644 ${S}/output/DEFAULT/rpm-sequoia.txt ${D}${datadir}/crypto-policies/back-ends/rpm-sequoia.config
+}
+
+FILES:${PN} = "${datadir}/crypto-policies/back-ends/*"
+
+BBCLASSEXTEND = "native"
Signature · 1 line
2.48.1
#1 lore raw

PATCH v11 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 v11 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 v11 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 v11 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