[isar-cip-core][PATCH v2 3/3] swupdate.cfg.tmpl: Add digest-provider option for signature verification

[email protected] Wed, 22 Jul 2026 17:17:53 +0530
Newsgroups org.cip-project.lists.cip-dev
Message-ID <[email protected]>
From: Shivanand Kunijadar <[email protected]>

This option is introduced from v2025.12 onwards in the SWUpdate package.
It sets the crypto backend (mbedTLS) that the SWUpdate uses to verify
signed updates and compute digests when multiple provides are available.

Add this option by default (forky/sid), and keep the variable as empty for other
Debian versions as it is not needed.

Signed-off-by: Shivanand Kunijadar <[email protected]>
---
 .../files/{swupdate.cfg => swupdate.cfg.tmpl}        |  3 ++-
 recipes-core/swupdate-config/swupdate-config_0.2.bb  | 12 +++++++++---
 2 files changed, 11 insertions(+), 4 deletions(-)
 rename recipes-core/swupdate-config/files/{swupdate.cfg => swupdate.cfg.tmpl} (72%)

diff --git a/recipes-core/swupdate-config/files/swupdate.cfg b/recipes-core/swupdate-config/files/swupdate.cfg.tmpl
similarity index 72%
rename from recipes-core/swupdate-config/files/swupdate.cfg
rename to recipes-core/swupdate-config/files/swupdate.cfg.tmpl
index 3e2b45c..5faa713 100644
--- a/recipes-core/swupdate-config/files/swupdate.cfg
+++ b/recipes-core/swupdate-config/files/swupdate.cfg.tmpl
@@ -1,5 +1,6 @@
 globals :
 {
     bootloader = "ebg";
-    public-key-file = "/usr/share/swupdate-signing/swupdate-sign.crt"
+    public-key-file = "/usr/share/swupdate-signing/swupdate-sign.crt";
+    ${SWUPDATE_DIGEST_PROVIDER}
 };
diff --git a/recipes-core/swupdate-config/swupdate-config_0.2.bb b/recipes-core/swupdate-config/swupdate-config_0.2.bb
index b48e3d1..99e7a16 100644
--- a/recipes-core/swupdate-config/swupdate-config_0.2.bb
+++ b/recipes-core/swupdate-config/swupdate-config_0.2.bb
@@ -19,12 +19,18 @@ DEBIAN_PROVIDES := "${PN}"
 
 PN .= "-${MACHINE}"
 
-SRC_URI = "file://swupdate.cfg \
+SRC_URI = "file://swupdate.cfg.tmpl \
            file://hwrevision.tmpl"
 
+SWUPDATE_DIGEST_PROVIDER = "digest-provider = "pkcs#7mbedtls";"
+SWUPDATE_DIGEST_PROVIDER:trixie = ""
+SWUPDATE_DIGEST_PROVIDER:bookworm = ""
+SWUPDATE_DIGEST_PROVIDER:bullseye = ""
+SWUPDATE_DIGEST_PROVIDER:buster = ""
+
 MACHINE_HW_VERSION ??= "cip-core-1.0"
-TEMPLATE_FILES += "hwrevision.tmpl"
-TEMPLATE_VARS += "MACHINE MACHINE_HW_VERSION"
+TEMPLATE_FILES += "hwrevision.tmpl swupdate.cfg.tmpl"
+TEMPLATE_VARS += "MACHINE MACHINE_HW_VERSION SWUPDATE_DIGEST_PROVIDER"
 
 do_install[cleandirs] = "${D}/etc/"
 do_install() {
-- 
2.39.5