Blame SOURCES/0001-testparms-fix-condition-for-negative-test.patch

33d9b2
From 0789bf264a108c4718875a050d00b1fdee4478b7 Mon Sep 17 00:00:00 2001
33d9b2
From: Jonas Witschel <git@diabonas.de>
33d9b2
Date: Wed, 29 Sep 2021 17:08:07 +0200
33d9b2
Subject: [PATCH] testparms: fix condition for negative test
33d9b2
Content-type: text/plain
33d9b2
33d9b2
Commit e858dec76686bb4c42e74e0984b433231e530f93 ("testparms: ensure curve not
33d9b2
supported before negative test") is supposed to ensure that the negative test
33d9b2
is run only if ecc521 is *not* supported, but instead it runs the negative test
33d9b2
if ecc521 is *available*. This worked anyway for libtpms < 0.9.0 because camellia
33d9b2
was not supported, but since libtpms 0.9.0 added support for this algorithm, the
33d9b2
test suite fails now with swtpm.
33d9b2
33d9b2
Signed-off-by: Jonas Witschel <git@diabonas.de>
33d9b2
---
33d9b2
 test/integration/tests/testparms.sh | 2 +-
33d9b2
 1 file changed, 1 insertion(+), 1 deletion(-)
33d9b2
33d9b2
diff --git a/test/integration/tests/testparms.sh b/test/integration/tests/testparms.sh
33d9b2
index 8c3548e58f39..a587a60a34cf 100644
33d9b2
--- a/test/integration/tests/testparms.sh
33d9b2
+++ b/test/integration/tests/testparms.sh
33d9b2
@@ -63,7 +63,7 @@ else
33d9b2
 fi
33d9b2
 
33d9b2
 # Attempt to specify a suite that is not supported (error from TPM)
33d9b2
-if tpm2 getcap ecc-curves | grep -q TPM2_ECC_NIST_P521; then
33d9b2
+if ! tpm2 getcap ecc-curves | grep -q TPM2_ECC_NIST_P521; then
33d9b2
     if tpm2 testparms "ecc521:ecdsa:camellia" &>/dev/null; then
33d9b2
         echo "tpm2 testparms succeeded while it shouldn't or TPM failed"
33d9b2
         exit 1
33d9b2
-- 
33d9b2
2.35.3
33d9b2