<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/meta-openembedded.git/meta-oe/classes/signing.bbclass, branch master-next</title>
<subtitle>Mirror of git.openembedded.org/meta-openembedded</subtitle>
<id>https://git.enea.com/cgit/linux/meta-openembedded.git/atom?h=master-next</id>
<link rel='self' href='https://git.enea.com/cgit/linux/meta-openembedded.git/atom?h=master-next'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/'/>
<updated>2026-03-05T06:26:02+00:00</updated>
<entry>
<title>signing.bbclass: add signing_create_uri_pem helper function</title>
<updated>2026-03-05T06:26:02+00:00</updated>
<author>
<name>Fabian Pflug</name>
<email>f.pflug@pengutronix.de</email>
</author>
<published>2026-03-04T15:31:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=8b9b789542bdc76fbeb73f150ab75e4f9f7d2086'/>
<id>urn:sha1:8b9b789542bdc76fbeb73f150ab75e4f9f7d2086</id>
<content type='text'>
The PKCS#11 provider has a mechanism [1] to support older applications
which have not yet migrated to the OSSL_STORE API [2]. It works by
encoding the 'pkcs11:' URI into a PEM file and passing that to an
application as a file. From the application's perspective it loads the
private key from a file, but OpenSSL will transparently use select the
provider to access it via PKCS#11 instead.

Instead of upstream's Python-based tool [3] (which would pull in
asn1crypto as a dependency), we just generate the ASN.1 for the PEM
using OpenSSL's 'asn1parse -genconf'.

It has been tested with RAUC, U-Boot's mkimage (for signed FITs) and
NXP's CST.

[1] https://github.com/latchset/pkcs11-provider/blob/main/docs/provider-pkcs11.7.md#use-in-older-applications-uris-in-pem-files
[2] https://docs.openssl.org/master/man7/ossl_store/
[3] https://github.com/latchset/pkcs11-provider/blob/main/tools/uri2pem.py

Signed-off-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Fabian Pflug &lt;f.pflug@pengutronix.de&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: add support for OpenSSL PKCS#11 provider</title>
<updated>2026-03-05T06:26:02+00:00</updated>
<author>
<name>Fabian Pflug</name>
<email>f.pflug@pengutronix.de</email>
</author>
<published>2026-03-04T15:31:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=f75a2ab194ee2ea0dd7572669fa3b052f2da36f9'/>
<id>urn:sha1:f75a2ab194ee2ea0dd7572669fa3b052f2da36f9</id>
<content type='text'>
OpenSSL 4.0 will drop support for engines and use providers instead.

To access SoftHSM and other PKCS#11 modules via the provider API, we
rely on https://github.com/latchset/pkcs11-provider, which is already
available as via pkcs11-provider recipe.

We enable this provider by using a specific OpenSSL config when signing.
This means that recipes inheriting this class can decide whether they
want to use the engine or provider to access the key.

SoftHSM seems to produce broken keys when calling the C_CopyObject, so
disable caching in the provider for now.

Signed-off-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Fabian Pflug &lt;f.pflug@pengutronix.de&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: remove trailing white space</title>
<updated>2026-03-05T06:26:02+00:00</updated>
<author>
<name>Jan Luebbe</name>
<email>jlu@pengutronix.de</email>
</author>
<published>2026-03-04T15:31:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=40a1825c95333fbf114c41966d68339e12cf208a'/>
<id>urn:sha1:40a1825c95333fbf114c41966d68339e12cf208a</id>
<content type='text'>
Signed-off-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: create env with 0x600</title>
<updated>2025-08-20T14:35:07+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-08-20T10:11:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=c092b3adc58b8b2fec3fbec93dce0fb62b60507c'/>
<id>urn:sha1:c092b3adc58b8b2fec3fbec93dce0fb62b60507c</id>
<content type='text'>
The env file holds the PKCS#11 uris, which include the pin to access
the database - in plaintext. Directly create the file (after it has
been remove) with the proper 'user RW only' permissions, to give only
the build-user access to this somewhat "security sensitive" file.

Note that the softhsm/sqlite3.db* is already 0x600.

Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: make PEM loading compatible with OpenSC 0.26.0</title>
<updated>2025-07-02T16:48:26+00:00</updated>
<author>
<name>Enrico Jörns</name>
<email>ejo@pengutronix.de</email>
</author>
<published>2025-07-02T06:09:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=2d1d128a41abb698874e2d0b8e59cb5ae0416937'/>
<id>urn:sha1:2d1d128a41abb698874e2d0b8e59cb5ae0416937</id>
<content type='text'>
With https://github.com/OpenSC/OpenSC/pull/3174 which is part of 0.26.0,
OpenSC does not support reading the (DER-converted) object data from
stdin anymore.

However, OpenSC/pkcs11-tool also supports reading PEM files directly.
This we can use for simply replacing and simplifying the stdin piping in
signing_import_cert_from_pem().

Only for password-protected files we still have to use OpenSSL for
conversion, since OpenSC/pkcs11-tool currently doesn't have a mechanism
for providing passwords.
For these cases, we store the converted PEM into a simple temporary
file. This handling is sufficient, since SoftHSM import should be used
for example keys only and SoftHSM also doesn't protect the keys in any
way. Keys which actually need to be protected are stored in HSMs and
accessed via their PKCS#11 URIs.

Signed-off-by: Enrico Jörns &lt;ejo@pengutronix.de&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: remove signing_import_cert_chain_from_pem</title>
<updated>2025-06-28T18:04:25+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-06-27T12:18:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=a1dd1906048d6a83061515ae00871e8f804297da'/>
<id>urn:sha1:a1dd1906048d6a83061515ae00871e8f804297da</id>
<content type='text'>
With the now available set|get|has_ca functions to establish a CA link
between roles during their import, the
signing_import_cert_chain_from_pem can now be removed.  As it had the
shortcoming of dynamically creating roles, which are harder to handle
then the manually/specifically setup CA roles.

This effectively reverts:
a825b853634 signing.bbclass: add certificate ca-chain handling

Reviewed-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: add signing_extract_cert helpers</title>
<updated>2025-06-28T18:04:25+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-06-27T12:18:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=d1b6f528a56084f156bcdb9baa61c08beb2db0ae'/>
<id>urn:sha1:d1b6f528a56084f156bcdb9baa61c08beb2db0ae</id>
<content type='text'>
Add extract-cert wrapping helper functions, to easily extract
certificates again that had been previously imported into the softhsm.

Reviewed-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: add signing_get_intermediate_certs</title>
<updated>2025-06-28T18:04:24+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-06-27T12:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=b6915f63998e17655c6d4cb094ba8880fed7fb9f'/>
<id>urn:sha1:b6915f63998e17655c6d4cb094ba8880fed7fb9f</id>
<content type='text'>
Add a method that returns a list of intermediary CA roles.

When using a complex PKI structure with for example "openssl cms",
these roles can then be iterated over adding in turn a '-certificate'.
Pseudo-code example:
  for intermediate in $(signing_get_intermediate_certs 'FooBaa'); do
     signing_extract_cert_pem $intermediate $intermediate.pem
     CMD+=" --certificate=$intermediate.pem"
  done

The typical use-case would be adding these intermediate certificates
to the CMS structure so that the relying party can build the chain
from the signing leaf certificate to the locally stored trusted CA
certificate.

Reviewed-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: add get_root_cert</title>
<updated>2025-06-28T18:04:24+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-06-27T12:18:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=f642526db57a0cd22879f23c046471ff7c1effb1'/>
<id>urn:sha1:f642526db57a0cd22879f23c046471ff7c1effb1</id>
<content type='text'>
Add a helper method to retrieve the root CA certificate for a given
role, by walking the chain that has been setup with
signing_import_set_ca up to the last element - which is the root.

Reviewed-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
<entry>
<title>signing.bbclass: add set|get|has_ca functions</title>
<updated>2025-06-28T18:04:24+00:00</updated>
<author>
<name>Johannes Schneider</name>
<email>johannes.schneider@leica-geosystems.com</email>
</author>
<published>2025-06-27T12:18:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/meta-openembedded.git/commit/?id=5b315e2fc4884d9644b13474934ae006b530720e'/>
<id>urn:sha1:5b315e2fc4884d9644b13474934ae006b530720e</id>
<content type='text'>
Add a mechanism to establish a (metadata) link between roles and signer
certificates, in the form of a new 'ca' variable.  It must point from one
role or cert to the signer certificate to preserve the leaf-&gt;intermediary-&gt;
root certificate relation.

With this additional mechanism, it would be now possible to import a
complex PKI tree of certificates and then later during usage of one
role, reconstruct the certificate chain from the leaf, through
multiple intermediary, and up to the root certificate.

Reviewed-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Signed-off-by: Johannes Schneider &lt;johannes.schneider@leica-geosystems.com&gt;
Signed-off-by: Khem Raj &lt;raj.khem@gmail.com&gt;
</content>
</entry>
</feed>
