tpm2-tss icon indicating copy to clipboard operation
tpm2-tss copied to clipboard

FreeBSD: dlopen in the integration tests does not work after upgrade from FreeBSD 14.0 to 14.1

Open JuergenReppSIT opened this issue 4 months ago • 0 comments

If the integration tests are configured for the swtpm or mssim TCTI, errors are produced by the device TCTI file, which should not be loaded. The integration tests did work on FreeBSD 14.0. As a workaround I have created a PR (https://github.com/tpm2-software/tpm2-tss/pull/2906) with a a commit where the configure option --enable-nodl (https://github.com/tpm2-software/tpm2-tss/pull/2906/commits/78abea0d04d2b91a70b7bdf7f58beda2f882b0ec) is used and fixed a nodl problem (https://github.com/tpm2-software/tpm2-tss/pull/2906/commits/5911e664b047c237aaf6417bc6887ce2819eb41d) The integration tests are statically linked with all activated TCTIs. Aftwards the used TCTI is loaded with dlopen. The handle returned by dlopen is used to determine the TCTI init function. In FreeBSD 14.1 init function from the first TCTI in the list lib_LTLIBRARIES is used. In 14.0 the init function from the loaded so file was used.

ERROR: test/integration/fapi-provisioning-cert-error
====================================================

Trying to start simulator mssim
Starting simulator on port 50582
successfully started daemon: tpm_server with PID: 19857
/tmp/cirrus-ci-build
simulator PID: 19857
root     tpm_server 19857 4   tcp4   *:50582               *:*
root     tpm_server 19857 6   tcp4   *:50583               *:*
Simulator with PID 19857 bound to port 50582 and  50583 successfully.
TPM20TEST_TCTI=mssim:host=127.0.0.1,port=50582
Execute the test script
ERROR:tcti:src/tss2-tcti/tcti-device.c:454:Tss2_Tcti_Device_Init() Failed to open specified TCTI device file host=127.0.0.1,port=50582: No such file or directory 
ERROR:tcti:src/tss2-tcti/tctildr-dl.c:149:tcti_from_file() Could not initialize TCTI file: mssim 
ERROR:tcti:src/tss2-tcti/tctildr.c:478:tctildr_init_context_data() Failed to instantiate TCTI 
ERROR:test:test/integration/test-common.c:447:test_esys_setup() Error loading TCTI: mssim:host=127.0.0.1,port=50582 
Script returned 99

JuergenReppSIT avatar Oct 21 '24 13:10 JuergenReppSIT