Skip to content

Commit

Permalink
tests: Remove RSA 3072 tests only if libtpms not show RSA 3072 support
Browse files Browse the repository at this point in the history
Check the libtpms capabilities via 'swtpm_ioctl -i 4' to see whether
libtpms supports RSA 3072 bit keys. Only if this is not the case
deactivate all RSA 3072 bit key tests.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed May 4, 2020
1 parent c6b52d1 commit 8abf473
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/test_tpm2_ibmtss2
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ if [ $revision -lt 155 ]; then
done
fi

# libtpms may at some revision start supporting RSA 3072 keys...
if [ $revision -gt 0 ]; then
rsa3072=$(run_swtpm_ioctl ${SWTPM_INTERFACE} --info 4 |
sed -n 's/.*"RSAKeySizes":\[\([0-9,]*\)\].*/\1/p' |
grep 3072)
if [ -z "$rsa3072" ]; then
pushd regtests &>/dev/null

echo "Modifying test cases related to RSA 3072 keys."
Expand All @@ -92,6 +94,8 @@ if [ $revision -gt 0 ]; then
sed -i "s| \"-rsa 3072\"||" testsalt.sh

popd &>/dev/null
else
echo "swptm/libtpms support RSA 3072 bit keys"
fi

export TPM_SERVER_NAME=127.0.0.1
Expand Down

0 comments on commit 8abf473

Please sign in to comment.