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