Skip to content

Instantly share code, notes, and snippets.

@op-ct
Created January 15, 2018 23:18
Show Gist options
  • Select an option

  • Save op-ct/3145703b16d8bb26905ecdf9d31d8a31 to your computer and use it in GitHub Desktop.

Select an option

Save op-ct/3145703b16d8bb26905ecdf9d31d8a31 to your computer and use it in GitHub Desktop.
TPM2 Vagrantfile
config.vm.provision "shell", inline: <<-SHELL
export TPM2_SIM_VERSION=${TPM2_SIM_VERSION:-1119}
export TPM2_TOOLS_VERSION=${TPM2_TOOLS_VERSION:-3.0.2}
export TPM2_TSS_VERSION=${TPM2_TSS_VERSION:-1.3.0}
export TPM2_ABRMD_VERSION=${TPM2_ABRMD_VERSION:-1.2.0}
export TPM2_SIM_CMD_PORT=${TPM2_SIM_CMD_PORT:-2321}
export TPM2_SIM_PLATFORM_PORT=${TPM2_SIM_PLATFORM_PORT:-2322}
yum clean all
yum install -y git make autoconf autoconf-archive automake libtool gcc \
gcc-c++ glibc-headers pkgconfig openssl-devel curl-devel \
epel-release
rm -rf /var/cache/yum
curl -sSfL https://sourceforge.net/projects/ibmswtpm2/files/ibmtpm${TPM2_SIM_VERSION}.tar.gz/download > ibmtpm.tgz && \
mkdir ibmtpm && \
cd ibmtpm && \
tar -zxf ../ibmtpm.tgz && \
cd src && \
make && \
mv tpm_server /usr/local/bin/ && \
cd && \
rm -rf /ibmtpm /ibmtpm.tgz
git clone https://github.com/intel/tpm2-tss.git -b ${TPM2_TSS_VERSION} && \
cd tpm2-tss && \
./bootstrap && \
./configure --libdir=/usr/lib64 --mandir=/usr/local/share/man && \
make && \
make install && \
cd && \
###rm -rf /tpm2-tss
ldconfig
git clone https://github.com/intel/tpm2-tools.git -b ${TPM2_TOOLS_VERSION} && \
cd tpm2-tools && \
./bootstrap && \
./configure --disable-hardening --with-tcti-socket --with-tcti-device --prefix=/ --mandir=/usr/local/share/man && \
make && \
make install && \
cd && \
###rm -rf /tpm2-tools
export TPM2TOOLS_TCTI_NAME=socket
SHELL
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment