]> git.proxmox.com Git - swtpm.git/commitdiff
swtpm_setup: Use swtpm_ioctl to re-init the TPM 1.2 for activation
authorStefan Berger <stefanb@linux.vnet.ibm.com>
Wed, 3 Jul 2019 01:18:51 +0000 (21:18 -0400)
committerStefan Berger <stefanb@us.ibm.com>
Wed, 3 Jul 2019 15:19:23 +0000 (11:19 -0400)
Since we can only read the file descriptor for the passphrase once,
we cannot stop the TPM 1.2 and then restart it but we have to use
'swtpm_ioctl -i' to re-init it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
src/swtpm_setup/swtpm_setup.sh.in

index 85e96b34b5735de4b39007aede1c7132a5293c0b..c80dd2aa4d16c25fd73b3b29901cd31c9fd87428 100755 (executable)
@@ -873,11 +873,9 @@ init_tpm()
                logit "Successfully gave up ownership of the TPM."
 
                # TPM is now disabled and deactivated; enable and activate it
-               stop_tpm 1
-               start_tpm "$SWTPM" "$tpm_state_path"
-
+               output="$($SWTPM_IOCTL --tcp :$((TPM_PORT+1)) -i 2>&1)"
                if [ $? -ne 0 ]; then
-                       logerr "Could not re-start TPM."
+                       logerr "Could not re-init TPM."
                        return 1
                fi