From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Fri, 05 Jun 2026 10:51:56 +0200 Received: from metis.whiteo.stw.pengutronix.de ([2a0a:edc0:2:b01:1d::104]) by lore.white.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVQHU-002Ywc-08 for lore@lore.pengutronix.de; Fri, 05 Jun 2026 10:51:56 +0200 Received: from [127.0.0.1] (helo=metis.whiteo.stw.pengutronix.de) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1wVQHT-0004zA-If; Fri, 05 Jun 2026 10:51:55 +0200 Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1wVQH8-0004iN-Ha; Fri, 05 Jun 2026 10:51:34 +0200 Received: from dude05.red.stw.pengutronix.de ([2a0a:edc0:0:1101:1d::54]) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wVQH8-001DHf-1b; Fri, 05 Jun 2026 10:51:34 +0200 Received: from mol by dude05.red.stw.pengutronix.de with local (Exim 4.98.2) (envelope-from ) id 1wVQH8-0000000GWM0-1rEs; Fri, 05 Jun 2026 10:51:34 +0200 From: Michael Olbrich To: ptxdist@pengutronix.de Date: Fri, 5 Jun 2026 10:51:34 +0200 Message-ID: <20260605085134.3937609-1-m.olbrich@pengutronix.de> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260423-code-signing-provider-v2-3-be62a422e84a@pengutronix.de> References: <20260423-code-signing-provider-v2-3-be62a422e84a@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: Re: [ptxdist] [APPLIED] code-signing: enable provider support X-BeenThere: ptxdist@pengutronix.de X-Mailman-Version: 2.1.29 Precedence: list List-Id: PTXdist Development Mailing List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: ptxdist@pengutronix.de Sender: "ptxdist" X-SA-Exim-Connect-IP: 127.0.0.1 X-SA-Exim-Mail-From: ptxdist-bounces@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false Thanks, applied as c6bbbfce1e98328dad30113153e86a3b8ce792f2. Michael [sent from post-receive hook] On Fri, 05 Jun 2026 10:51:34 +0200, Sascha Hauer wrote: > openssl engines have long been deprecated. Add support for provider to > the ptxdist code signing infrastructure. > > We add a custom openssl-pkcs11.cnf to specify > pkcs11-module-block-operations = digest. The reason is that softhsm2 > itself uses openssl for digesting. Without this option softhsm would end > up calling itself via openssl resulting in a deadlock. Now that we have > a custom config already we also use it to specify the path to the pkcs11 > module. > > Signed-off-by: Sascha Hauer > Message-Id: <20260423-code-signing-provider-v2-3-be62a422e84a@pengutronix.de> > Signed-off-by: Michael Olbrich > > diff --git a/platforms/code-signing.in b/platforms/code-signing.in > index 81f9ef6f3c9e..a20982f202ca 100644 > --- a/platforms/code-signing.in > +++ b/platforms/code-signing.in > @@ -4,6 +4,7 @@ menuconfig CODE_SIGNING > bool > select VIRTUAL > select HOST_LIBP11 > + select HOST_PKCS11_PROVIDER > prompt "Code signing " > help > This option enables the ptxdist signing infrastructure. > diff --git a/rules/host-softhsm.in b/rules/host-softhsm.in > index 160f4b598d57..dfa1e3c8e0e6 100644 > --- a/rules/host-softhsm.in > +++ b/rules/host-softhsm.in > @@ -4,6 +4,7 @@ config HOST_SOFTHSM > tristate > select HOST_P11_KIT > select HOST_OPENSSL > + select HOST_PKCS11_PROVIDER > select HOST_SQLITE > default y if ALLYES > help > diff --git a/rules/host-softhsm.make b/rules/host-softhsm.make > index 67d9c5ab8f96..613a42b42478 100644 > --- a/rules/host-softhsm.make > +++ b/rules/host-softhsm.make > @@ -30,4 +30,31 @@ HOST_SOFTHSM_CONF_OPT := \ > HOST_SOFTHSM_CPPFLAGS := \ > -DDEBUG_LOG_STDERR=1 > > +# ---------------------------------------------------------------------------- > +# Install > +# ---------------------------------------------------------------------------- > + > +$(STATEDIR)/host-softhsm.install: > + @$(call targetinfo) > + @$(call world/install, HOST_SOFTHSM) > + @{ \ > + echo 'openssl_conf = openssl_init'; \ > + echo ''; \ > + echo '[openssl_init]'; \ > + echo 'providers = provider_sect'; \ > + echo ''; \ > + echo '[provider_sect]'; \ > + echo 'default = default_sect'; \ > + echo 'pkcs11 = pkcs11_sect'; \ > + echo ''; \ > + echo '[default_sect]'; \ > + echo 'activate = 1'; \ > + echo ''; \ > + echo '[pkcs11_sect]'; \ > + echo "module = $(PTXDIST_SYSROOT_HOST)/usr/lib/ossl-modules/pkcs11.so"; \ > + echo 'activate = 1'; \ > + echo 'pkcs11-module-block-operations = digest'; \ > + } > $(PTXDIST_SYSROOT_HOST)/usr/ssl/openssl-pkcs11.cnf > + @$(call touch) > + > # vim: syntax=make > diff --git a/rules/pre/010-code-signing.make b/rules/pre/010-code-signing.make > index 6141a7b19b50..238f37934062 100644 > --- a/rules/pre/010-code-signing.make > +++ b/rules/pre/010-code-signing.make > @@ -8,7 +8,7 @@ > > CODE_SIGNING_ENV = \ > SO_PATH=$(PTXDIST_SYSROOT_HOST)/usr/lib/engines-3/pkcs11.so \ > - OPENSSL_CONF="$(PTXDIST_SYSROOT_HOST)/usr/ssl/openssl.cnf" \ > + OPENSSL_CONF="$(PTXDIST_SYSROOT_HOST)/usr/ssl/openssl-pkcs11.cnf" \ > OPENSSL_ENGINES="$(PTXDIST_SYSROOT_HOST)/usr/lib/engines-3" > > # > diff --git a/rules/pre/020-code-signing-softhsm.make b/rules/pre/020-code-signing-softhsm.make > index 62e3ab3311a1..3f1307ca9601 100644 > --- a/rules/pre/020-code-signing-softhsm.make > +++ b/rules/pre/020-code-signing-softhsm.make > @@ -9,7 +9,8 @@ > ifdef PTXCONF_HOST_SOFTHSM > SOFTHSM_CODE_SIGNING_ENV = \ > SOFTHSM2_CONF="$(PTXDIST_SYSROOT_HOST)/etc/softhsm2.conf" \ > - PKCS11_MODULE_PATH=$(PTXDIST_SYSROOT_HOST)/usr/lib/softhsm/libsofthsm2.so > + PKCS11_MODULE_PATH=$(PTXDIST_SYSROOT_HOST)/usr/lib/softhsm/libsofthsm2.so \ > + PKCS11_PROVIDER_MODULE=$(PTXDIST_SYSROOT_HOST)/usr/lib/softhsm/libsofthsm2.so > > CODE_SIGNING_ENV += \ > $(SOFTHSM_CODE_SIGNING_ENV)