forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
app-crypt/tpm2-tools: Fix broken test exposed in libtpms-0.9.0
Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Christopher Byrne <[email protected]> Signed-off-by: Ionen Wolkens <[email protected]>
- Loading branch information
1 parent
442ce52
commit 90e9e0d
Showing
2 changed files
with
34 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
app-crypt/tpm2-tools/files/tpm2-tools-5.2-testparms-fix-condition-for-negative-test.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 3d80fad66694ad14a58dd89204a25e9248c4ab0c Mon Sep 17 00:00:00 2001 | ||
From: Jonas Witschel <[email protected]> | ||
Date: Wed, 29 Sep 2021 17:08:07 +0200 | ||
Subject: [PATCH] testparms: fix condition for negative test | ||
|
||
Commit e858dec76686bb4c42e74e0984b433231e530f93 ("testparms: ensure curve not | ||
supported before negative test") is supposed to ensure that the negative test | ||
is run only if ecc521 is *not* supported, but instead it runs the negative test | ||
if ecc521 is *available*. This worked anyway for libtpms < 0.9.0 because camellia | ||
was not supported, but since libtpms 0.9.0 added support for this algorithm, the | ||
test suite fails now with swtpm. | ||
|
||
Signed-off-by: Jonas Witschel <[email protected]> | ||
--- | ||
test/integration/tests/testparms.sh | 2 +- | ||
1 file changed, 1 insertion(+), 1 deletion(-) | ||
|
||
diff --git a/test/integration/tests/testparms.sh b/test/integration/tests/testparms.sh | ||
index 8c3548e5..a587a60a 100644 | ||
--- a/test/integration/tests/testparms.sh | ||
+++ b/test/integration/tests/testparms.sh | ||
@@ -63,7 +63,7 @@ else | ||
fi | ||
|
||
# Attempt to specify a suite that is not supported (error from TPM) | ||
-if tpm2 getcap ecc-curves | grep -q TPM2_ECC_NIST_P521; then | ||
+if ! tpm2 getcap ecc-curves | grep -q TPM2_ECC_NIST_P521; then | ||
if tpm2 testparms "ecc521:ecdsa:camellia" &>/dev/null; then | ||
echo "tpm2 testparms succeeded while it shouldn't or TPM failed" | ||
exit 1 | ||
-- | ||
2.32.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters