2019-01-07 20:28:53 +00:00
|
|
|
#!/bin/bash
|
2021-11-16 21:51:42 +00:00
|
|
|
#########################################################################################
|
2022-02-17 19:50:10 +00:00
|
|
|
# Script to setup the TPM 2.0 Provisioner for System Tests
|
|
|
|
# Initial setup only use resetTpm2Emulator to reset PCR values in subsequent tests
|
2021-11-16 21:51:42 +00:00
|
|
|
#########################################################################################
|
2019-01-07 20:28:53 +00:00
|
|
|
set -e
|
2022-01-26 15:04:07 +00:00
|
|
|
pushd / > /dev/null
|
2021-11-16 21:51:42 +00:00
|
|
|
echo "Setting up TPM emulator for the TPM2 Provisioner"
|
2022-02-04 22:02:50 +00:00
|
|
|
|
2022-02-17 19:50:10 +00:00
|
|
|
source /HIRS/.ci/setup/container/tpm2_common.sh
|
2021-11-16 21:51:42 +00:00
|
|
|
|
|
|
|
#Wait for the ACA to spin up, if it hasnt already
|
2022-01-26 15:24:29 +00:00
|
|
|
waitForAca
|
2021-11-16 21:51:42 +00:00
|
|
|
|
2019-01-15 17:46:06 +00:00
|
|
|
# Install packages
|
2022-01-26 15:24:29 +00:00
|
|
|
installProvisioner
|
2019-01-15 17:46:06 +00:00
|
|
|
|
2022-01-26 17:08:29 +00:00
|
|
|
# set location of tcg artifacts
|
2022-02-17 21:05:19 +00:00
|
|
|
setTcgProperties
|
2022-01-26 17:08:29 +00:00
|
|
|
#echo "Contents of /etc/hirs is $(ls -al /etc/hirs)";
|
2022-01-26 15:04:07 +00:00
|
|
|
|
2019-12-23 10:28:26 +00:00
|
|
|
# Install TPM 2.0 Emulator
|
2022-01-26 15:24:29 +00:00
|
|
|
initTpm2Emulator
|
2019-01-15 17:46:06 +00:00
|
|
|
|
2019-02-04 19:26:54 +00:00
|
|
|
# Update the hirs-site.config file
|
2022-01-26 15:24:29 +00:00
|
|
|
updateHirsSiteConfigFile
|
2019-01-15 17:46:06 +00:00
|
|
|
|
2019-12-23 10:28:26 +00:00
|
|
|
echo "TPM 2.0 Emulator NV RAM list"
|
2019-07-19 09:50:26 +00:00
|
|
|
tpm2_nvlist
|
|
|
|
|
2019-01-15 17:46:06 +00:00
|
|
|
echo ""
|
2019-12-23 10:28:26 +00:00
|
|
|
echo "===========HIRS ACA TPM 2.0 Provisioner Setup Complete!==========="
|
2021-11-16 21:51:42 +00:00
|
|
|
|
2022-02-17 17:02:49 +00:00
|
|
|
popd > /dev/null
|
|
|
|
|
2022-02-17 19:50:10 +00:00
|
|
|
#tpm2_pcrlist -g sha256
|