]> www.infradead.org Git - users/dwmw2/openconnect.git/commitdiff
Verify that TPMv2 startup tools are present in order to enable auth-swtpm tests
authorDaniel Lenski <dlenski@gmail.com>
Mon, 2 Aug 2021 20:41:29 +0000 (13:41 -0700)
committerDaniel Lenski <dlenski@gmail.com>
Mon, 2 Aug 2021 22:03:24 +0000 (15:03 -0700)
Autoconf source now verifies that either 'tpm2_startup' or 'tsstartup' is
found before enabling this test.

See discussion at https://gitlab.com/openconnect/openconnect/-/issues/287#note_640185660.

I also added tpm2-tools (package providing 'tpm2_startup') to the Fedora
build image, in https://gitlab.com/openconnect/build-images/-/commit/35ee4ffb88ba319014c321dc8999e48fce81f130.

Signed-off-by: Daniel Lenski <dlenski@gmail.com>
configure.ac

index 562c5c38966ff9447420a8303e30635e96295562..fef5217d5bed45aec4dc5e8d945efe2502c3e4f6 100644 (file)
@@ -715,8 +715,12 @@ AM_CONDITIONAL(OPENCONNECT_TSS2_IBM, [ test "$tss2lib" = "ibmtss" -o "$tss2lib"
 
 AC_PATH_PROG(SWTPM, swtpm)
 SWTPM_IOCTL=""
+TPM2_STARTUP=""
+TSSTARTUP=""
 if test "$SWTPM" != ""; then
     AC_PATH_PROG(SWTPM_IOCTL, swtpm_ioctl)
+    AC_PATH_PROG(TPM2_STARTUP, tpm2_startup)
+    AC_PATH_PROG(TSSTARTUP, tsstartup)
 fi
 
 # The Intel/TCG TSS can only *create* keys
@@ -733,7 +737,7 @@ if test "$test_hwtpm" = "yes" -a "$TPM2TSS_GENKEY$CREATE_TPM2_KEY" = ""; then
 fi
 
 AM_CONDITIONAL(TEST_HWTPM, [ test "$test_hwtpm" = "yes" ])
-AM_CONDITIONAL(TEST_SWTPM, [ test "$SWTPM_IOCTL" != "" ])
+AM_CONDITIONAL(TEST_SWTPM, [ test "$SWTPM_IOCTL" != "" -a \( "$TPM2_STARTUP" != "" -o "$TSSTARTUP" != "" \) ])
 AM_CONDITIONAL(TEST_TPM2_CREATE, [ test "$TPM2TSS_GENKEY" != "" ])
 AM_CONDITIONAL(TEST_TPM2_IMPORT, [ test "$CREATE_TPM2_KEY" != "" ])