Skip to content
Stefan Berger edited this page Nov 19, 2018 · 51 revisions

Welcome to the libtpms wiki!

Build Status Coverity Scan Build Status

Libtpms provides TPM emulation for TPM 1.2 and TPM 2.0 without tying it to a specific storage backend or an interface for receiving TPM commands. One user of libtpms is swtpm.

Previously, work on TPM 2.0 support was going on in 'preview' branches. This code has been moved into the master branch.

Compile and install on Linux

# Install dependencies
sudo dnf builddep dist/libtpms.spec
./autogen.sh --with-openssl --prefix=/usr --with-tpm2
make -j4
make check
sudo make install

Build a 32bit version on x86_64 Linux (for testing)

CFLAGS="-m32" ./autogen.sh --with-openssl --prefix=/usr --with-tpm2 --libdir=/lib
make clean
make -j4
make check
sudo make install

Compile and install on Cygwin

./autogen.sh --with-openssl --prefix=/usr --with-tpm2
make -j4
make check
make install

Compile and install on OpenBSD

./autogen.sh --with-openssl --prefix=/usr --with-tpm2
gmake -j 4
gmake check
sudo gmake install

Compile and install on OS/X

LDFLAGS="-L/usr/local/opt/openssl/lib" CFLAGS="-I/usr/local/opt/openssl/include" CC=gcc ./autogen.sh --with-openssl --prefix=/Users/adminuser/ --with-tpm2
make -j4
make check
sudo make install

Build a package on Ubuntu

sudo apt-get -y install automake autoconf libtool gcc build-essential libssl-dev dh-exec pkg-config
./autogen.sh --with-openssl
make dist
dpkg-buildpackage -us -uc -j4
# Install the library and development packages
cd ..
sudo dpkg -i libtpms_0.x.y-z..._amd64.deb libtpms-dev_0.x.y-z..._amd64.deb