2021-06-17 18:27:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# get tpm simulator code
|
2021-06-22 22:47:18 +00:00
|
|
|
IBMTPM_VERSION=1661
|
2021-06-17 18:27:21 +00:00
|
|
|
wget --no-check-certificate https://downloads.sourceforge.net/project/ibmswtpm2/ibmtpm$IBMTPM_VERSION.tar.gz
|
|
|
|
|
|
|
|
res="$?"
|
|
|
|
|
|
|
|
if [[ "$res" -ne 0 ]]; then
|
|
|
|
echo "wget failed"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# unpackage and build the source
|
|
|
|
mkdir ibmtpm
|
|
|
|
pushd ibmtpm
|
|
|
|
tar xf ../ibmtpm$IBMTPM_VERSION.tar.gz
|
|
|
|
pushd src
|
2021-06-22 22:47:18 +00:00
|
|
|
# fixup for openssl 3
|
2022-02-24 17:03:56 +00:00
|
|
|
sed -i -e "s|OPENSSL_VERSION_NUMBER >= 0x10200000L|OPENSSL_VERSION_NUMBER > 0x30000010L|" TpmToOsslMath.h
|
2021-06-22 22:47:18 +00:00
|
|
|
sed -i -e "s|CCFLAGS = -Wall|CCFLAGS = -Wall -Wno-error=deprecated-declarations|" makefile
|
2021-06-17 18:27:21 +00:00
|
|
|
make
|
|
|
|
|
|
|
|
res="$?"
|
|
|
|
|
|
|
|
if [[ "$res" -ne 0 ]]; then
|
|
|
|
echo "make of ibmtpm failed"
|
|
|
|
popd
|
|
|
|
popd
|
|
|
|
rm -rf ibmtpm ibmtpm$IBMTPM_VERSION.tar.gz
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
(./tpm_server)&
|
|
|
|
popd
|
|
|
|
popd
|
|
|
|
|
|
|
|
sleep 10
|
|
|
|
|
|
|
|
export TPM_INTERFACE_TYPE=socsim
|
|
|
|
|
2022-02-24 17:27:31 +00:00
|
|
|
# use the tss2 tests from the sources
|
|
|
|
pushd ./source/utils
|
2021-06-17 18:27:21 +00:00
|
|
|
# fix python calls to use rhel name for python3
|
|
|
|
sed -i -e 's/^PREFIX=\.\//PREFIX=tss/g' reg.sh
|
|
|
|
# fix paths in rootcerts.txt
|
|
|
|
c=`pwd`
|
|
|
|
sed -i -e "s|/gsa/yktgsa/home/k/g/kgold/tpm2/utils|${c}|g" certificates/rootcerts.txt
|
|
|
|
# run the tests
|
2022-02-24 15:39:03 +00:00
|
|
|
TPM_TSS_NODEPRECATEDALGS=1 ./reg.sh -a
|
2021-06-17 18:27:21 +00:00
|
|
|
res="$?"
|
|
|
|
popd
|
|
|
|
|
|
|
|
# clean up
|
|
|
|
pkill tpm_server
|
2022-02-24 17:27:31 +00:00
|
|
|
rm -rf ibmtpm tss
|
2021-06-17 18:27:21 +00:00
|
|
|
|
|
|
|
exit $res
|