libtpms/tests/tpm2_pcr_read.sh
Stefan Berger 61cb823169 tpm2: Start supporting RSA 3072 keys
Start supporting RSA 3072 keys.

NVMarshal.c: We now accept state that was written by libtpms when RSA keys
sizes were 2048 or are 3072, basically less-or-equal than 3072.

Also increase the NVRAM memory size by ~45 kb to accommodate the worst
case where the USER NVRAM is full of 65 2048 bit persisted keys whose 65
OBJECTs are now expanding and need to again fit into the NVRAM. We have
to add exactly 45760 bytes to accomodate this case. See swtpm test
case test_tpm2_save_load_state_2. 65 * 704 = 45760.

NOTE: BETTER TO NOT BACKPORT!!! MAY NEGATIVELY AFFECT UPGRADE PATH!

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-05-04 08:01:26 -04:00

37 lines
553 B
Bash
Executable File

#!/usr/bin/env bash
# For the license, see the LICENSE file in the root directory.
ROOT=${abs_top_builddir:-$(pwd)/..}
TESTDIR=${abs_top_testdir:-$(dirname "$0")}
DIR=${PWD}
WORKDIR=$(mktemp -d)
. ${TESTDIR}/common
function cleanup()
{
rm -rf ${WORKDIR}
}
trap "cleanup" QUIT EXIT
pushd $WORKDIR &>/dev/null
${DIR}/tpm2_pcr_read
rc=$?
fs=$(get_filesize NVChip)
[ $? -ne 0 ] && exit 1
if [ $fs -ne 176832 ]; then
echo "Error: Unexpected size of NVChip file."
echo "Expected: 131072"
echo "Got : $fs"
rc=1
fi
popd &>/dev/null
exit $rc