Check the help screen for necessary supported options since the IBM TSS2
test will have to be patched to support swtpm directly. If it does not
support it, exit the tests early with an error message.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Enable SWTPM_TEST_PROFILE for running the test_tpm2_ibmtss2 test cases
with a user provided profile. Document it.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Run against the installed version only when SWTPM_TEST_IBMTSS is
set to the directory that has the tests, otherwise, build the known
version.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
The IBMTSS2 tests suite creates signatures over SHA1 that may now fail on
RHEL 9.x and CentOS 9. To have these tests succeed set
OPENSSL_ENABLE_SHA1_SIGNATURES=1 so the tests do not need to be modified
and also check that the TPM 2 can handle SHA1 signatures as before.
'swtpm socket --tpm2' should set this environment variable automatically
if needed.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
With swtpm now requiring libtpms >= 0.10 some of the patches applied to
the IBM TSS2 test suite have become obsolete. Remove them but also
have swtpm use the default-v1 profile that enables some of the newer
commands that were previously disabled.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Older versions of libtpms need to have another patch applied that disables
x509 certificate creation (0013-Disable-x509-test-cases-part2.patch).
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add CFLAGS="-DOPENSSL_SUPPRESS_DEPRECATED=1" to the configure line
to avoid compile-time errors when building the TPM 1.2 test with
OpenSSL 3.0.
IBM TSS2 v1.6 test does not currently work with OpenSSL 3.0, so
skip it.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add restoring of the volatile state after having it stored.
Since this is now taking a long time it must be explicitly enabled
by setting the environment variable SWTPM_TEST_STORE_VOLATILE=1.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
If we are running the tests as a user that doesn't have a git config
setup we run into the following issue when trying to apply patches
suing 'git am':
Committer identity unknown
*** Please tell me who you are.
Run
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
This patch fixes this by setting the git config on the local checkout
before using 'git am'.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Apply patches to the IBM TSS2 test suite rather than using sed on its
files and other types of file manipulations.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upgrade to use the IBM TSS2 tests from v1.6.0.
Add a patch that eliminates all testing of 3072 bit RSA keys in case
libtpms does not support such keys. Also disable a test case related
to ACT for older revisions.
This test passes with libtpms 0.8.0 as well libtpms 0.6.0 and 0.7.0.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upgrade to use the IBM TSS2 tests from v1.5.0.
Add a patch that eliminates all testing of 3072 bit RSA keys in case
libtpms does not support such keys. This test also passes with libtpms
0.6.0 and 0.7.0.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
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>
To make the test cases work on Travis on Bionic replace all occurrences of
localhost with 127.0.0.1. The only affected client tools seem to be those
related to the TPM 1.2 and the IBM TSS2. For some reason the API used
there cannot resolve localhost to 127.0.0.1.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Upgrade to use the IBM TSS2 tests from v1.4.0 but eliminate all testing
with 3072 bit RSA keys.
This test also passes with libtpms 0.6.0 and 0.7.0.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Use v1.3.0 of the IBM TSS 2.0 repo.
Depending on the revision that libtpms implements, some test cases have to be
replaced with empty files.
The test suite now works with the libtpms stable-0.6.0 and stable-0.7.0
branches. A patch fixing an NV PIN issue needed to be applied to those
branches.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Get the IBM TSS2 test suite from its git repo, compile it, and run
its test suite if SWTPM_TEST_EXPENSIVE=1 is set.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>