diff mbox series

[meta-security,v2] tpm2-tss-engine: add .so symmlink to engines package

Message ID 20250320202031.50796-2-adrian.freihofer@siemens.com
State New
Headers show
Series [meta-security,v2] tpm2-tss-engine: add .so symmlink to engines package | expand

Commit Message

AdrianF March 20, 2025, 8:20 p.m. UTC
From: Adrian Freihofer <adrian.freihofer@siemens.com>

Without the symlink, the engine is not found by openssl:

openssl engine -t -c tpm2tss
20F0C5BDFFFF0000:error:12800067:DSO support routines:dlfcn_load:could
    not load the shared library:/usr/src/debug/openssl/3.2.4/crypto/dso/dso_dlfcn.c:118:
    filename(/usr/lib/engines-3/tpm2tss.so): /usr/lib/engines-3/tpm2tss.so:
    cannot open shared object file: No such file or directory
...

With sym-link it works (also without extra configuration for openssl)

cd /usr/lib/engines-3/
ln -s libtpm2tss.so tpm2tss.so
openssl engine -t -c tpm2tss
(tpm2tss) TPM2-TSS engine for OpenSSL
    [RSA, RAND]
        [ available ]

For exmample also the Fedora package has the symlink.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
V1 -> V2:
- Just realized that my first test did not show the sanity check
  failure. I added the INSANE_SKIP line to the patch.

 .../recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.2.0.bb | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.2.0.bb b/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.2.0.bb
index 30865d2..af9dec8 100644
--- a/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.2.0.bb
+++ b/meta-tpm/recipes-tpm2/tpm2-tss-engine/tpm2-tss-engine_1.2.0.bb
@@ -29,7 +29,11 @@  do_configure:prepend() {
 
 PACKAGES += "${PN}-engines ${PN}-engines-staticdev ${PN}-bash-completion"
 
-FILES:${PN}-dev = "${libdir}/engines-3/tpm2tss.so ${includedir}/*"
-FILES:${PN}-engines = "${libdir}/engines-3/lib*.so*"
+FILES:${PN}-dev = "${includedir}/*"
+FILES:${PN}-engines = "${libdir}/engines-3/*.so*"
 FILES:${PN}-engines-staticdev = "${libdir}/engines-3/libtpm2tss.a"
 FILES:${PN}-bash-completion += "${datadir}/bash-completion/completions"
+
+# The tpm2tss.so symlink is in the main package because OpenSSL
+# searches for the shared object via the symlink.
+INSANE_SKIP:${PN}-engines += "dev-so"