Make TPM 1.2 test setup take ownership & define space for the EK cert (#6)

This commit is contained in:
Tom D 2019-04-03 16:07:03 -07:00 committed by GitHub
parent 790d3ba149
commit 509d8074f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,7 @@ setup_build_base () {
mkdir -pv "${BUILD_BASE}"
fi
sudo apt-get -y install libssl-dev build-essential make trousers libtool autoconf
sudo apt-get -y install libssl-dev build-essential make trousers libtool autoconf tpm-tools
}
fetch_simulator () {
@ -82,12 +82,15 @@ run_simulator () {
}
setup_tpm () {
echo "Initializing the TPM..."
${SIMULATOR_SRC}/libtpm/utils/tpminit
echo "Starting the TPM..."
${SIMULATOR_SRC}/libtpm/utils/tpmbios -v
echo "Creating a fake EK..."
${SIMULATOR_SRC}/libtpm/utils/createek || true
${SIMULATOR_SRC}/libtpm/utils/tpmbios -cs
echo "Allocating NVRAM..."
${SIMULATOR_SRC}/libtpm/utils/nv_definespace -in ffffffff -sz 0
${SIMULATOR_SRC}/libtpm/utils/nv_definespace -in 1000f000 -sz 3200
${SIMULATOR_SRC}/libtpm/utils/tpminit
${SIMULATOR_SRC}/libtpm/utils/tpmbios -cs
}
run_tcsd () {
@ -96,7 +99,10 @@ run_tcsd () {
TCSD_PID=$!
echo "${TCSD_PID}" > "${BUILD_BASE}/tcsd_pid"
disown
sleep 2
sleep 1
tpm_createek
tpm_takeownership -yz
sleep 1
}
setup_build_base
@ -105,4 +111,3 @@ build_simulator
run_simulator
setup_tpm
run_tcsd