qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v6 8/8] tpm: Added support for TPM emulator


From: Stefan Berger
Subject: Re: [Qemu-devel] [PATCH v6 8/8] tpm: Added support for TPM emulator
Date: Tue, 18 Jul 2017 11:05:30 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 07/18/2017 04:49 AM, Amarnath Valluri wrote:
This change introduces a new TPM backend driver that can communicate with
swtpm(software TPM emulator) using unix domain socket interface.

Swtpm uses two unix sockets, one for plain TPM commands and responses, and one
for out-of-band control messages.

The swtpm and associated tools can be found here:
     https://github.com/stefanberger/swtpm

The swtpm's control channel protocol specification can be found here:
     https://github.com/stefanberger/swtpm/wiki/Control-Channel-Specification

Usage:
     # setup TPM state directory
     mkdir /tmp/mytpm
     chown -R tss:root /tmp/mytpm
     /usr/bin/swtpm_setup --tpm-state /tmp/mytpm --createek

     # Ask qemu to use TPM emulator with given tpm state directory
     qemu-system-x86_64 \
         [...] \
         -tpmdev emulator,id=tpm0,tpmstatedir=/tmp/mytpm,logfile=/tmp/swtpm.log 
\
         -device tpm-tis,tpmdev=tpm0 \
         [...]


In this description ',spawn,path=/usr/bin/swtpm' is missing. I had to pass the path even with swtpm being in PATH on the command line but not for the execv(). In case it didn't find the executable I had to eliminate g_strfreev(argv) since it also wants to free the array itself, so it wouldn't end up in a crash.

   Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]