Update to v0.3.0 release

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
Marc-André Lureau 2020-02-26 11:29:04 +01:00
parent a8452cdba7
commit 5ec0c1acff
4 changed files with 110 additions and 8 deletions

2
.gitignore vendored
View File

@ -11,3 +11,5 @@
/swtpm-13536aa.tar.gz /swtpm-13536aa.tar.gz
/swtpm-9227cf4.tar.gz /swtpm-9227cf4.tar.gz
/swtpm-8dae4b3.tar.gz /swtpm-8dae4b3.tar.gz
/swtpm-0.3.0.tar.gz
/swtpm-74ae43b.tar.gz

View File

@ -0,0 +1,96 @@
From e6d81c0281900c8222022d66272254f97919cf4b Mon Sep 17 00:00:00 2001
From: Stefan Berger <stefanb@linux.vnet.ibm.com>
Date: Tue, 25 Feb 2020 21:34:21 -0500
Subject: [PATCH] tests: Skip test 4 of derived keys in case an allowed error
is encounterd
libtpms may not support TDES, so we have to skip test case 4 in
case we encounter an allowed error message.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
tests/_test_tpm2_derived_keys | 34 +++++++++++++++++++++-------------
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/tests/_test_tpm2_derived_keys b/tests/_test_tpm2_derived_keys
index 773da39..87b9940 100755
--- a/tests/_test_tpm2_derived_keys
+++ b/tests/_test_tpm2_derived_keys
@@ -51,12 +51,14 @@ fi
# @param2: whether to send TPM2_Startup
# @param3: command to send
# @param4: expected return value
+# @param5: allowed failure return value to skip test
function tx_cmd()
{
local reset="$1"
local startup="$2"
local cmd="$3"
local exp="$4"
+ local allowed_error="$5"
local RES tmp
@@ -82,7 +84,9 @@ function tx_cmd()
swtpm_open_cmddev ${SWTPM_INTERFACE} 100
RES=$(swtpm_cmd_tx ${SWTPM_INTERFACE} ${cmd})
- if [ "$RES" != "$exp" ]; then
+ if [ "$RES" == "$allowed_error" ]; then
+ echo "Skip: Encountered allowed error response ($allowed_error)"
+ elif [ "$RES" != "$exp" ]; then
echo "Error: Did not get expected return from creating key"
echo "expected: $exp"
echo "received: $RES"
@@ -93,6 +97,10 @@ function tx_cmd()
return 0
}
+# Older versions of libtpms do not support TDES
+# So we may skip the test in case we hit this error
+error_unsupt_algo=' 80 01 00 00 00 0a 00 00 02 d6'
+
# Create a primary RSA key and expect a predictable return value
# tsscreateprimary -hi e -v
# -> creates key with handle 0x80 00 00 00
@@ -245,12 +253,12 @@ test5_exp2+=' 00 00 01 00 00'
case "$(uname -p)" in
ppc64le|x86_64)
echo "[Assuming ${SWTPM_EXE} is 64bit]"
- tx_cmd 1 0 "$test1_cmd" "$test1_exp" || exit 1 && echo "Test 1: OK"
- tx_cmd 1 1 "$test2_cmd" "$test2_exp" || exit 1 && echo "Test 2: OK"
- tx_cmd 1 1 "$test3_cmd" "$test3_exp" || exit 1 && echo "Test 3: OK"
- tx_cmd 1 1 "$test4_cmd" "$test4_exp" || exit 1 && echo "Test 4: OK"
- tx_cmd 1 1 "$test5_cmd1" "$test5_exp1" || exit 1
- tx_cmd 0 0 "$test5_cmd2" "$test5_exp2" || exit 1 && echo "Test 5: OK"
+ tx_cmd 1 0 "$test1_cmd" "$test1_exp" "" || exit 1 && echo "Test 1: OK"
+ tx_cmd 1 1 "$test2_cmd" "$test2_exp" "" || exit 1 && echo "Test 2: OK"
+ tx_cmd 1 1 "$test3_cmd" "$test3_exp" "" || exit 1 && echo "Test 3: OK"
+ tx_cmd 1 1 "$test4_cmd" "$test4_exp" "$error_unsupt_algo" || exit 1 && echo "Test 4: OK"
+ tx_cmd 1 1 "$test5_cmd1" "$test5_exp1" "" || exit 1
+ tx_cmd 0 0 "$test5_cmd2" "$test5_exp2" "" || exit 1 && echo "Test 5: OK"
;;
*)
echo "This test currently only works with 64bit TPMs"
@@ -301,12 +309,12 @@ test4_exp=' 80 02 00 00 00 71 00 00 00 00 80 00 00 00 00 00 00 5a 00 00 00 32 00
test5_exp1=' 80 02 00 00 01 12 00 00 00 00 80 00 00 00 00 00 00 fb 00 32 00 08 00 0b 00 03 04 72 00 00 00 0a 00 0b 00 22 00 20 60 5c 90 40 d5 ef 80 59 70 f4 90 3e 43 7a ce 49 1e 06 06 f0 e9 79 39 e4 a0 a1 8b d5 12 ca 86 9a 00 37 00 00 00 00 00 20 e3 b0 c4 42 98 fc 1c 14 9a fb f4 c8 99 6f b9 24 27 ae 41 e4 64 9b 93 4c a4 95 99 1b 78 52 b8 55 01 00 10 00 04 40 00 00 0b 00 04 40 00 00 0b 00 00 00 20 28 d0 26 fa fd 74 91 06 74 3e 27 c4 28 05 51 58 5e 5d 17 66 8e b5 21 83 5e d6 01 27 ef fc 05 d4 80 21 40 00 00 0b 00 40 5a 84 8d d0 73 da 49 f6 76 84 6e d1 56 13 39 4d 4b 67 0a 68 97 71 c9 a4 92 a6 aa 6d 30 4b 19 6c 69 fc a7 d5 b9 5c 8f 5a af 0c f6 72 b9 85 c5 d4 0a 09 f8 f7 16 4d 11 bc 5d ec cc 48 02 15 ce 79 00 22 00 0b 04 13 09 39 42 b3 86 80 67 68 2a d7 27 e3 c7 44 1d 1c b6 65 23 c3 ee f0 b8 b8 b5 ff ee 49 1d 4b 00 00 01 00 00'
test5_exp2=' 80 02 00 00 00 95 00 00 00 00 80 00 00 01 00 00 00 7e 00 00 00 56 00 23 00 0b 00 02 04 52 00 00 00 10 00 10 00 10 00 10 00 20 af 9f be fc c8 95 21 71 04 2d 7d db 3f 42 aa 54 cc 2f a0 cf 55 82 78 f4 3f 01 88 27 46 53 2c 88 00 20 dc ad 67 2f d1 ea 89 01 f5 27 1f 58 3f a5 da 52 85 50 98 d5 06 81 10 13 86 12 d7 23 55 12 ea 0c 00 22 00 0b 72 c2 60 3f c8 bb 79 ea 92 86 7e a3 df 57 8d 15 e3 f1 10 a2 f9 1c a6 80 41 c3 cf e1 fa 43 83 2f 00 00 01 00 00'
-tx_cmd 1 0 "$test1_cmd" "$test1_exp" || exit 1 && echo "Test 1: OK"
-tx_cmd 1 1 "$test2_cmd" "$test2_exp" || exit 1 && echo "Test 2: OK"
-tx_cmd 1 1 "$test3_cmd" "$test3_exp" || exit 1 && echo "Test 3: OK"
-tx_cmd 1 1 "$test4_cmd" "$test4_exp" || exit 1 && echo "Test 4: OK"
-tx_cmd 1 1 "$test5_cmd1" "$test5_exp1" || exit 1
-tx_cmd 0 0 "$test5_cmd2" "$test5_exp2" || exit 1 && echo "Test 5: OK"
+tx_cmd 1 0 "$test1_cmd" "$test1_exp" "" || exit 1 && echo "Test 1: OK"
+tx_cmd 1 1 "$test2_cmd" "$test2_exp" "" || exit 1 && echo "Test 2: OK"
+tx_cmd 1 1 "$test3_cmd" "$test3_exp" "" || exit 1 && echo "Test 3: OK"
+tx_cmd 1 1 "$test4_cmd" "$test4_exp" "" || exit 1 && echo "Test 4: OK"
+tx_cmd 1 1 "$test5_cmd1" "$test5_exp1" "" || exit 1
+tx_cmd 0 0 "$test5_cmd2" "$test5_exp2" "" || exit 1 && echo "Test 5: OK"
run_swtpm_ioctl ${SWTPM_INTERFACE} -s
if [ $? -ne 0 ]; then
--
2.25.0.rc2.1.g09a9a1a997

View File

@ -1,2 +1 @@
SHA512 (swtpm.spec) = 7021f3417beda0f16f2c616f167a0d978822aa62f7a8c90f3a62b34aac1744942a3d22e585e51cdf5aaf2b88321c741a8be4d199f9d360c5340f883354e2ea65 SHA512 (swtpm-74ae43b.tar.gz) = 59be7ab2406105ba808b1dc3656bff1c5f533dccca6acb0bb618b6dea2851d0c5c19527487748ff8d3503ea395f1ec8f07a3766f2ac6fff204b964c111c6e311
SHA512 (swtpm-8dae4b3.tar.gz) = 9e3679d453a0f66bee4daf06113ae0d798c1b8188a838149eb52cd3dbb0960467e285fce815f5c600cea99e5d60459aec283f657272ad3d36e486a4dc002efac

View File

@ -1,7 +1,7 @@
%bcond_without gnutls %bcond_without gnutls
%global gitdate 20191115 %global gitdate 20200218
%global gitcommit 8dae4b3f9d4a71f67587d7900dae14c175a426d1 %global gitcommit 74ae43bd8e4fca809d1cbc398efcb2f7f968b59f
%global gitshortcommit %(c=%{gitcommit}; echo ${c:0:7}) %global gitshortcommit %(c=%{gitcommit}; echo ${c:0:7})
# Macros needed by SELinux # Macros needed by SELinux
@ -11,12 +11,14 @@
Summary: TPM Emulator Summary: TPM Emulator
Name: swtpm Name: swtpm
Version: 0.2.0 Version: 0.3.0
Release: 7.%{gitdate}git%{gitshortcommit}%{?dist} Release: 1.%{gitdate}git%{gitshortcommit}%{?dist}
License: BSD License: BSD
Url: http://github.com/stefanberger/swtpm Url: http://github.com/stefanberger/swtpm
Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz Source0: %{url}/archive/%{gitcommit}/%{name}-%{gitshortcommit}.tar.gz
Patch0001: 0001-tests-Skip-test-4-of-derived-keys-in-case-an-allowed.patch
BuildRequires: automake BuildRequires: automake
BuildRequires: autoconf BuildRequires: autoconf
BuildRequires: libtool BuildRequires: libtool
@ -75,7 +77,7 @@ Requires: trousers >= 0.3.9 tpm-tools >= 1.3.8-6 expect bash net-tools gnu
Tools for the TPM emulator from the swtpm package Tools for the TPM emulator from the swtpm package
%prep %prep
%autosetup -n %{name}-%{gitcommit} %autosetup -S git -n %{name}-%{gitcommit}
%build %build
@ -89,7 +91,7 @@ NOCONFIGURE=1 ./autogen.sh
%make_build %make_build
%check %check
make %{?_smp_mflags} check make %{?_smp_mflags} check VERBOSE=1
%install %install
@ -165,6 +167,9 @@ fi
%attr( 755, tss, tss) %{_localstatedir}/lib/swtpm-localca %attr( 755, tss, tss) %{_localstatedir}/lib/swtpm-localca
%changelog %changelog
* Mon Feb 24 2020 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.3.0-1.20200218git74ae43b
- Update to v0.3.0 release
* Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7.20191115git8dae4b3 * Fri Jan 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7.20191115git8dae4b3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild