Skip to content

Commit

Permalink
tests: Pass --verify-profile=medium to certtool if supported
Browse files Browse the repository at this point in the history
certtool emits the following message if --verify-profile is not
passed:

Note that no verification profile was selected. In the future the medium profile will be enabled by default.
Use --verify-profile low to apply the default verification of NORMAL priority string.

Pass the --verify-profile option if certtool supports it (since ~3.6.12).

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
  • Loading branch information
stefanberger committed Nov 2, 2022
1 parent a2abd3b commit 22e975d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_tpm2_swtpm_localca
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ PATH=${TOPBUILD}/src/swtpm_cert:$PATH

source ${TESTDIR}/common

if [ -n "$(${CERTTOOL} --help | grep -E "\-\-verify-profile")" ]; then
verify_profile="--verify-profile=medium"
fi

trap "cleanup" SIGTERM EXIT

function cleanup()
Expand Down Expand Up @@ -125,6 +129,7 @@ do

${CERTTOOL} \
--verify \
${verify_profile} \
--load-ca-certificate "${ISSUERCERT}" \
--infile "${workdir}/ek.pem"
if [ $? -ne 0 ]; then
Expand Down
5 changes: 5 additions & 0 deletions tests/test_tpm2_swtpm_localca_pkcs11.test
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ PATH=${TOPBUILD}/src/swtpm_cert:$PATH

source ${TESTDIR}/common

if [ -n "$(${CERTTOOL} --help | grep -E "\-\-verify-profile")" ]; then
verify_profile="--verify-profile=medium"
fi

trap "cleanup" SIGTERM EXIT

function cleanup()
Expand Down Expand Up @@ -214,6 +218,7 @@ do

GNUTLS_PIN=${PIN} ${CERTTOOL} \
--verify \
${verify_profile} \
--load-ca-certificate ${ISSUERCERT} \
--infile ${workdir}/ek.pem
if [ $? -ne 0 ]; then
Expand Down

0 comments on commit 22e975d

Please sign in to comment.