From 9fc7a67411e03663ac2f49d6fb0e0b738cb08ef6 Mon Sep 17 00:00:00 2001 From: Boris Glimcher <36732377+glimchb@users.noreply.github.com> Date: Sun, 14 Jul 2024 02:05:36 -0400 Subject: [PATCH] docs: add unixio option to swtpm Signed-off-by: Boris Glimcher <36732377+glimchb@users.noreply.github.com> --- doc/swtpm.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/doc/swtpm.md b/doc/swtpm.md index 5538f34..3ee51b8 100644 --- a/doc/swtpm.md +++ b/doc/swtpm.md @@ -13,7 +13,7 @@ For QEMU, check [this page](./qemu_tpm_setup.md) sudo apt-get install swtpm tpm2-tools -y ``` -## Run SWTPM Emulation +## Run SWTPM Emulation TCP use TCP to connect to this emulation @@ -28,14 +28,35 @@ swtpm socket --tpm2 \ --flags not-need-init,startup-clear ``` -## Testing TPM2 - Set Transmission Interface (TCTI) swtpm socket, so tpm2-tools use it instead of the default char device interface. ```bash export TPM2TOOLS_TCTI="swtpm:host=localhost,port=2321" ``` +## Run SWTPM Emulation Unix socket + +use unix socket to connect to this emulation + +```bash +mkdir /tmp/emulated_tpm +swtpm socket --tpm2 \ + --server type=unixio,path=/tpm/emulated_tpm/swtpm.sock \ + --ctrl type=tcp,port=2322 \ + --tpmstate dir=/tmp/emulated_tpm \ + --log file="swtpm.log" \ + --log level=20 \ + --flags not-need-init,startup-clear +``` + +Set Transmission Interface (TCTI) swtpm socket, so tpm2-tools use it instead of the default char device interface. + +```bash +export TPM2TOOLS_TCTI="swtpm:path=/tpm/emulated_tpm/swtpm.sock" +``` + +## Testing TPM2 + keys ```bash