github.com/jlmucb/cloudproxy@v0.0.0-20170830161738-b5aa0b619bc4/Doc/tpmd.md (about)

     1  Installing and Using a TPM Emulator
     2  ===================================
     3  
     4  Instead of using a hardware TPM for testing, you can use a software TPM either
     5  through the Linux kernel (and a specialized driver) or through a system daemon
     6  accessed through a Unix domain socket. This document describes how to build and
     7  run the tpm daemon and access it through a socket.
     8  
     9  Getting the Source
    10  ------------------
    11  
    12  The TPM Emulator was written by Mario Strasser at ETH Zurich and was originally
    13  available at [BerliOS](http://tpm-emulator.berlios.de). However, that page no longer
    14  responds, though it can be reached on the [Internet
    15  Archive](https://web.archive.org/web/20140419212644/http://tpm-emulator.berlios.de/).
    16  A version of the source exists [on
    17  Github](https://github.com/PeterHuewe/tpm-emulator) and is also present in the
    18  [ChromeOS public
    19  repository](https://chromium.googlesource.com/chromiumos/third_party/tpm-emulator/).
    20  
    21  Building the Source
    22  -------------------
    23  
    24  The tpm-emulator source uses CMake, so it can be built in multiple ways. We only
    25  need `tpmd`, the daemon version of the tpm. So, we can cd into the tpm-emulator
    26  directory and do something like the following:
    27  
    28  	mkdir build
    29  	cd build
    30  	cmake ..
    31  	make tpmd
    32  
    33  The `tpmd` program will then be available in `build/tpmd/unix/tpmd`.
    34  
    35  Running the Emulator
    36  --------------------
    37  
    38  The `tpmd` emulator stores its data in a file and uses a Unix domain socket for
    39  communication. The latest version of the go-tpm library supports domain
    40  socket-based communication. So, you can start the emulator as
    41  
    42  	tpmd -s /path/to/storage/file -u /path/to/tpm/socket [clear|save|deactivated]
    43  
    44  The `tpmd` program must be started in `clear` mode the first time, then in
    45  `save` mode after. It can be treated as a TPM in those modes (e.g., you can take
    46  ownership with `tpm-take-ownership` from the go-tpm project). The path to the
    47  TPM can be given as part of a domain config.