[PATCH GnuPG 0/9] Fix TPM support tests

James Bottomley James.Bottomley at HansenPartnership.com
Thu Jun 15 21:01:53 CEST 2023

On Thu, 2023-06-15 at 16:22 +0200, Maxime Ripard wrote:
> Hi,
> This is a series meant to fix the various issues currently found when
> running the TPM tests.
> See:
> https://dev.gnupg.org/T6052
> https://bugzilla.redhat.com/show_bug.cgi?id=2089075
> It looks like it's not being run on a regular basis and thus the
> tests have been broken in various small ways that probably crept in
> over the years.

I can try to help, although, to be honest, I had no idea there were any
TPM tests ...

> This series fixes some of the issues, but the tests still do not run
> properly with the following error:
> Making check in tpm2dtests
> make[2]: Entering directory '/var/home/max/gnupg2/gnupg-
> 2.4.2/tests/tpm2dtests'
> PATH="../gpgscm:/var/home/max/.cache/cabal//bin:/var/home/max/.local/
> share/cargo/bin:/var/home/max/.local/bin:/var/home/max/.local/share/f
> latpak/exports/bin:/var/lib/flatpak/exports/bin:/usr/local/sbin:/usr/
> local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
> abs_top_srcdir="/var/home/max/gnupg2/gnupg-2.4.2"
> objdir="/var/home/max/gnupg2/gnupg-2.4.2" TSS2_LOG=all+DEBUG
> TSS2_LOGFILE=tss2.log TPMSERVER="" SWTPM="/bin/swtpm" SWTPM_IOCTL=""
> GNUPG_BUILD_ROOT="/var/home/max/gnupg2/gnupg-2.4.2"
> GNUPG_IN_TEST_SUITE=fact GPGSCM_PATH="/var/home/max/gnupg2/gnupg-
> 2.4.2/tests/gpgscm" TPM2TOOLS_TCTI="swtpm:host=localhost,port=2321"
> /var/home/max/gnupg2/gnupg-2.4.2/tests/gpgscm/gpgscm \
>   /var/home/max/gnupg2/gnupg-2.4.2/tests/tpm2dtests/run-tests.scm  

But now I try to run it with make -C tests/tpm2dtests, it fails with:

make: Entering directory '/home/jejb/git/gnupg/tests/tpm2dtests'
sdk-linux_x86/tools" abs_top_srcdir="/home/jejb/git/gnupg"
objdir="/home/jejb/git/gnupg" TPMSERVER="/usr/lib/ibmtss/tpm_server"
SWTPM="" SWTPM_IOCTL="" GNUPG_BUILD_ROOT="/home/jejb/git/gnupg/tests"
/home/jejb/git/gnupg/tests/gpgscm/gpgscm \
/home/jejb/git/gnupg/tests/tpm2dtests/run-tests.scm:30: not enough
arguments, missing: (path . args)

> PASS: tests/tpm2dtests/setup.scm 
> creating TPM  rsa2048  key 
> keytotpm failed: Secret key is available.

My best guess for this would be a TPM communications failure.  I only
ever tested this on a real TPM or a VM with an emulated TPM device and
using the IBM tss.  I didn't actually ever test on a socsim connection
(although there's no reason at all why it shouldn't work).



More information about the Gnupg-devel mailing list