]> git.proxmox.com Git - swtpm.git/log
swtpm.git
3 years agodebian/rpm: Adjust build and runtime dependencies and directory ownership
Stefan Berger [Tue, 25 Aug 2020 16:39:16 +0000 (12:39 -0400)]
debian/rpm: Adjust build and runtime dependencies and directory ownership

Remove tpm-tools from runtime dependencies. Keep trousers for the
creation of the 'tss' user for now. Add python related dependencies.

Adjust the directory ownership for /var/lib/swtpm-localca to tss:root and
the mode flags to 0750. The new CA now may still be created as tss:tss but
users in the tss group will not have access to it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: Switch over to new python tool and get rid of the bash script
Stefan Berger [Mon, 24 Aug 2020 14:45:34 +0000 (10:45 -0400)]
swtpm_setup: Switch over to new python tool and get rid of the bash script

Switch over to the new python implementation of swtpm_setup. We need to
also adjust test cases that involved the tcsd that otherwise fail for
various reasons. For in-place testing we need to adjust the PYTHONPATH
and PATH so that swtpm_setup.py can be found and so that swtpm_setup.py
then finds swtpm if it is not explicitly passed as parameter.

Adjust the man page for swtpm_setup to reflect the changes.

We now can run swtpm_setup as any user. However, libvirt still runs it
as tss:tss (for example), which is then creating the signing key as tss:tss
as well. Ideally libvirt would run it as tss:root or any other combination
since the tss group may be used for user wanting to access /dev/tpmrm0 for
example. We at least change the directory ownership of /var/lib/swtpm-localca
to tss:root and keep the world out of this directory.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: Rewrite swtpm_setup.sh in python
Stefan Berger [Thu, 20 Aug 2020 18:12:43 +0000 (14:12 -0400)]
swtpm_setup: Rewrite swtpm_setup.sh in python

Rewrite swtpm_setup.sh in python. Use a permanent connection from the
tool to swtpm via passing file descriptors of a unix socketpair. Implement
all functionality in python so that we don't rely on trousers and tpm-tools
for swtpm_setup. This now allows any user to setup a TPM 1.2 whereas before
it had to be root or the tss user.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Have softhsm_setup use the temporary directory now
Stefan Berger [Thu, 27 Aug 2020 23:50:30 +0000 (19:50 -0400)]
tests: Have softhsm_setup use the temporary directory now

Modify the pkcs11 related test case to set the environment variable for
softhsm_setup to use the temporary directory for config file and state
of softhsm. Also set the SOFTHSM2_CONF environment variable since
certtool also uses the pkcs11 module which in turn will look for its
config file.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Enable softhsm_setup to work with a temporary directory
Stefan Berger [Thu, 27 Aug 2020 23:35:09 +0000 (19:35 -0400)]
tests: Enable softhsm_setup to work with a temporary directory

Use softhsm's SOFTHSM2_CONF environment variable to set the directory
where the configration file is located so that we can now use a temporary
directory for the location of the directory. Use the environment variable
SOFTHSM_SETUP_CONFIGDIR to set the directory where softhsm_setup can
setup its temporary environment for the config file and state of softhsm.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Have softhsm_setup generate private key and add getpubkey command
Stefan Berger [Thu, 27 Aug 2020 23:33:15 +0000 (19:33 -0400)]
tests: Have softhsm_setup generate private key and add getpubkey command

Have softhsm_setup generate a private key on every start. Also add
a getpubkey command.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoman: Adjust and improve the man page for swtpm_setup
Stefan Berger [Mon, 24 Aug 2020 14:31:39 +0000 (10:31 -0400)]
man: Adjust and improve the man page for swtpm_setup

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Fix tests for slow/busy system by taking time again (DA timeout test)
Stefan Berger [Thu, 27 Aug 2020 00:53:10 +0000 (20:53 -0400)]
tests: Fix tests for slow/busy system by taking time again (DA timeout test)

Slow systems, like Cygwin, need so much time from taking the time to sending
the command that we need to take the current time again to check whether the
success is valid. Previously the test may have failed since the old time that
was taken did not allow the success to be valid.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Check for flock tool
Stefan Berger [Wed, 26 Aug 2020 22:26:55 +0000 (18:26 -0400)]
build-sys: Check for flock tool

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Squeeze spaces in case od print two space between hexbytes (OpenBSD)
Stefan Berger [Wed, 26 Aug 2020 22:23:21 +0000 (18:23 -0400)]
tests: Squeeze spaces in case od print two space between hexbytes (OpenBSD)

The OpenBSD implementation of 'od -tx1' prints two spaces between
hexbytes, thus the grep for "00 00 00 00" fails and we report an
invalid error. This patch fixes this by squeezing the two consecutive
spaces.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoman: Improve the man page for swtpm_ioctl and add example
Stefan Berger [Mon, 24 Aug 2020 13:48:11 +0000 (09:48 -0400)]
man: Improve the man page for swtpm_ioctl and add example

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoman: Update swtpm-localca.options to reflect expected contents and format
Stefan Berger [Mon, 24 Aug 2020 13:30:04 +0000 (09:30 -0400)]
man: Update swtpm-localca.options to reflect expected contents and format

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoman: Remove generated man pages from repo and ignore created ones
Stefan Berger [Thu, 20 Aug 2020 12:34:58 +0000 (08:34 -0400)]
man: Remove generated man pages from repo and ignore created ones

Remove the generated man pages from the repo and add the file patterns
to .gitignore.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agosamples: Implement script to create user config files and extend man page
Stefan Berger [Wed, 19 Aug 2020 15:07:56 +0000 (11:07 -0400)]
samples: Implement script to create user config files and extend man page

Implement a script that creates the user config files in the
${XDG_CONFIG_HOME} directory and sub-directories.

Extend swtpm_setup.pod showing swtpm-create-user-config-files usage.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoRevert "samples: Implement script to create user config files"
Stefan Berger [Thu, 20 Aug 2020 12:55:02 +0000 (08:55 -0400)]
Revert "samples: Implement script to create user config files"

This reverts commit d09484c02d5302e3179c02492adfb568956c5ffa.

3 years agoswtpm_setup: Accomodate for BSD sed that does not print \n as newline
Stefan Berger [Wed, 19 Aug 2020 19:33:09 +0000 (15:33 -0400)]
swtpm_setup: Accomodate for BSD sed that does not print \n as newline

BSD's sed does not print \n as newline, so we have to split the string
into different lines using tr.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agosamples: Implement script to create user config files
Stefan Berger [Wed, 19 Aug 2020 15:07:56 +0000 (11:07 -0400)]
samples: Implement script to create user config files

Implement a script that creates the user config files in the
${XDG_CONFIG_HOME} directory and sub-directories.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Skip test if time was detected to be going backwards
Stefan Berger [Wed, 19 Aug 2020 17:57:14 +0000 (13:57 -0400)]
tests: Skip test if time was detected to be going backwards

We have occasional test failures on Travis running tests on OS X where
time seems to be going backwards in the dictionary attack timeout test.
This patch tries to detect that the time went backwards and skip the
test once a failure would have been detected.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Label swtpm and swtpm_cuse with SELinux label
Stefan Berger [Wed, 19 Aug 2020 17:40:56 +0000 (13:40 -0400)]
build-sys: Label swtpm and swtpm_cuse with SELinux label

When running the selinux-install target also label swptm and swtpm_cuse.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Add build targets selinux-install and selinux-uninstall
Stefan Berger [Wed, 19 Aug 2020 13:48:59 +0000 (09:48 -0400)]
build-sys: Add build targets selinux-install and selinux-uninstall

Add build targets selinux-install and selinux-uninstall to install
and uninstall the SELinux policy rules at a given priority. The
priority defeaults to 400, which works fine on Fedora.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Have configure display swtpm version being built
Stefan Berger [Tue, 18 Aug 2020 19:58:38 +0000 (15:58 -0400)]
build-sys: Have configure display swtpm version being built

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm: Change include of sys/fcntl.h to fcntl.h
Stefan Berger [Sun, 16 Aug 2020 16:52:56 +0000 (12:52 -0400)]
swtpm: Change include of sys/fcntl.h to fcntl.h

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: Get rid of eval when calling external tool (swtpm-localca)
Stefan Berger [Mon, 10 Aug 2020 02:24:41 +0000 (22:24 -0400)]
swtpm_setup: Get rid of eval when calling external tool (swtpm-localca)

Get rid of using eval when calling $create_certs_tool and only use
eval for resolving variables from the config file.

We only want variable substitution for entries from configuration
files, so escape all other special shell characters that may be
making it onto the command line so that no subshells are opened
and no redirection to files can occurr.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Extend swtpm-localca test with odd vmid strings
Stefan Berger [Mon, 10 Aug 2020 18:50:34 +0000 (14:50 -0400)]
tests: Extend swtpm-localca test with odd vmid strings

Extend the swtpm-localca test with odd vmid string to ensure
that they go into the certificate unmodified.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agosamples: Get rid of using eval when running swtpm_cert
Stefan Berger [Fri, 7 Aug 2020 20:18:27 +0000 (16:18 -0400)]
samples: Get rid of using eval when running swtpm_cert

Get rid of using eval when running swtpm_cert in swtpm-localca.
This is to avoid further evaluation of bash expression that can
spawn subshells ('$(echo foo)') or do other bad things. Bad input
could come from malformed configuration files.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agosamples: Escape many more characters before calling eval on an entry
Stefan Berger [Fri, 7 Aug 2020 15:29:34 +0000 (11:29 -0400)]
samples: Escape many more characters before calling eval on an entry

Escape many more special shell characters before calling eval on
an entry to convert a variable to its value. Uncareful writing of
a swtpm-local.conf config file could have lead to files being over-
written using '>' for example.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoman: Add missing -- to --rsa-keysize in documentation
Stefan Berger [Mon, 10 Aug 2020 00:37:29 +0000 (20:37 -0400)]
man: Add missing -- to --rsa-keysize in documentation

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Have tpm2_ptool use store in temporary directory
Stefan Berger [Thu, 6 Aug 2020 20:33:02 +0000 (16:33 -0400)]
tests: Have tpm2_ptool use store in temporary directory

Have the tpm2_ptool use a store in the temporary directory so that
with every test we have a clean environment.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Assign unique ports 65452/65453 to test_tpm2_save_load_state
Stefan Berger [Thu, 6 Aug 2020 19:11:12 +0000 (15:11 -0400)]
tests: Assign unique ports 65452/65453 to test_tpm2_save_load_state

Assign the unique port 65452/65354 to test_tpm2_save_load_state to
avoid conflict with test_tpm_probe also using

SWTPM_SERVER_PORT=65526
SWTPM_CTRL_PORT=65527

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Assign unique ports 65450/65451 to test_tpm2_sample_create_tpmca
Stefan Berger [Thu, 6 Aug 2020 18:48:02 +0000 (14:48 -0400)]
tests: Assign unique ports 65450/65451 to test_tpm2_sample_create_tpmca

Assign the unique ports 65450/65451 to test_tpm2_sample_create_tpmca
to avoid clashes with test_samples_create_tpmca that is using

SWTPM_SERVER_PORT=65434
SWTPM_CTRL_PORT=65435

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Assign unique ports 65448/65449 to test_tpm2_setbuffersize
Stefan Berger [Thu, 6 Aug 2020 18:39:23 +0000 (14:39 -0400)]
tests: Assign unique ports 65448/65449 to test_tpm2_setbuffersize

Assign unique ports 65448/65449 to test_tpm2_setbuffersize to avoid clash
with test_samples_create_tpmca using TCSD_LISTEN_PORT=65436.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Modify sample key to be 2048 bit rather than only 2033 bit
Stefan Berger [Fri, 31 Jul 2020 14:47:27 +0000 (10:47 -0400)]
tests: Modify sample key to be 2048 bit rather than only 2033 bit

The generated sample keys started with 00010203, thus leaving the upper
15 bits of the key as '0', which in turn causes gnutls to think that the
key is only 2033 bit long, thus rejecting certificate verification once
the min-verification-profile is set to 'medium' in gnutls's config file
in /etc/crypto-policies/back-ends/gnutls.config.

We now create sample keys starting with 800102, which sets the highest bit.

This fixes test errors on Fedora Rawhide due to the change in the
min-verification-profile setting in gnutls.config.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: fix test for netstat if tcsd is not available
Jonas Witschel [Tue, 28 Jul 2020 10:29:13 +0000 (12:29 +0200)]
build-sys: fix test for netstat if tcsd is not available

A typo in the condition meant that netstat was always required regardless of
whether tcsd is available or not.

Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
3 years agotests: Squeeze spaces in case od print two space between hexbytes (OpenBSD)
Stefan Berger [Fri, 24 Jul 2020 19:11:18 +0000 (15:11 -0400)]
tests: Squeeze spaces in case od print two space between hexbytes (OpenBSD)

The OpenBSD implementation of 'od -tx1' prints two spaces between
hexbytes, thus the grep for "00 00 00 00" fails and we report an
invalid error. This patch fixes this by squeezing the two consecutive
spaces.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Check whether tss user and group are available
Stefan Berger [Thu, 23 Jul 2020 18:17:44 +0000 (14:17 -0400)]
build-sys: Check whether tss user and group are available

If the tcsd (trousers) is available, TPM 1.2 support should work as well.
Typically the tss user and group should be defined at this point, but
this may not always be the case, so make sure that this user and group
are available on the system.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: Only change file and directory ownership if needed
Stefan Berger [Thu, 23 Jul 2020 04:55:49 +0000 (00:55 -0400)]
swtpm_setup: Only change file and directory ownership if needed

Change the file and directory ownership of tcsd related files only if it
is absolutely needed. It is not needed if we are running as user TCSD_USER
in group TCSD_GROUP because then the files were created with the needed
owner and group. This avoids problems when trying to change file ownership
when invoked by libvirt where we do not have the capabilities to change
file ownership even as root.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: Allow group read-rights on $TCSD_CONFIG file if tss user != tss group
Stefan Berger [Thu, 23 Jul 2020 04:47:37 +0000 (00:47 -0400)]
swtpm_setup: Allow group read-rights on $TCSD_CONFIG file if tss user != tss group

When the TSS_USER != TSS_GROUP, e.g., user 'root' and group 'tss', then
tcsd requires that the access mode bits on the $TCSD_CONFIG file are set
to 0640, otherwise we get this error:

TCSD ERROR: TCSD config file (/tmp/tmp.Yd4LIF7mCE) must be mode 0640

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoswtpm_setup: log errors from tcsd in logfile
Stefan Berger [Thu, 23 Jul 2020 04:42:52 +0000 (00:42 -0400)]
swtpm_setup: log errors from tcsd in logfile

Redirect stdout and stderr from tcsd into a file and if tcsd reported
an error copy the error into the logfile. This makes debugging tcsd
related issues, such as ownership or access mode issues, easier.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Error out if libtpms.pc cannot be found and request PKG_CONFIG_PATH be set
Stefan Berger [Fri, 24 Jul 2020 11:55:26 +0000 (07:55 -0400)]
build-sys: Error out if libtpms.pc cannot be found and request PKG_CONFIG_PATH be set

Error out if libtpms.pc cannot be found for pkg-config. This now requires that an
in-place libtpms be accessed like this:

PKG_CONFIG_PATH=/home/stefanb/libtpms/ \
LIBTPMS_CFLAGS=-I/home/stefanb/libtpms/include/ \
LIBTPMS_LDFLAGS=-L/home/stefanb/libtpms/src/.libs/ \
./configure --prefix=/usr

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agoCHANGES: Add documentation for changes in 0.4.0
Stefan Berger [Mon, 13 Jul 2020 17:37:05 +0000 (13:37 -0400)]
CHANGES: Add documentation for changes in 0.4.0

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Explicitly link libswtpm_libtpms with -lcrypto (Gentoo)
Stefan Berger [Tue, 21 Jul 2020 22:39:07 +0000 (18:39 -0400)]
build-sys: Explicitly link libswtpm_libtpms with -lcrypto (Gentoo)

This patch fixes the following linker issue reported for Gentoo in
issue #280.

ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to EVP_sha512
ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to PKCS5_PBKDF2_HMAC
ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to SHA512

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agobuild-sys: Use AC_COMPILE_IFELSE to check for unused linker flags (clang)
Stefan Berger [Tue, 21 Jul 2020 21:38:10 +0000 (17:38 -0400)]
build-sys: Use AC_COMPILE_IFELSE to check for unused linker flags (clang)

This patch fixes a clang issue report in issue #280.

clang does not use ld, so we cannot grep for support of certain linker
flags but have to test-compile.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
3 years agotests: Use the IBM TSS2 v1.5.0's test suite
Stefan Berger [Mon, 13 Jul 2020 13:10:43 +0000 (09:10 -0400)]
tests: Use the IBM TSS2 v1.5.0's test suite

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>
3 years agodebian: Address some issues raised by lintian
Stefan Berger [Tue, 7 Jul 2020 16:05:13 +0000 (16:05 +0000)]
debian: Address some issues raised by lintian

Remove swtpm_cuse related install script since not needed anymore.

Also address the following issues:

E: swtpm-tools: unknown-control-interpreter control/postinst #!/usr/bin/env
W: swtpm: syntax-error-in-debian-changelog line 25 "bad key-value after `;': `urgency medium'"

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Adapt test cases' expected PCR result due to libtpms TPM 2 fix
Stefan Berger [Fri, 26 Jun 2020 22:31:35 +0000 (18:31 -0400)]
tests: Adapt test cases' expected PCR result due to libtpms TPM 2 fix

libtpms version 0.6.3, 0.7.3, and master have a change to the TPM 2 code
that affects the pcrUpdateCounter, which now returns a smaller value than
before.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agobuild-sys: Enable automake silent rules
Stefan Berger [Thu, 18 Jun 2020 17:15:11 +0000 (13:15 -0400)]
build-sys: Enable automake silent rules

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoFix typos in code and man pages
Seunghun Han [Sat, 6 Jun 2020 14:22:09 +0000 (23:22 +0900)]
Fix typos in code and man pages

This patch fixes typos of code and man pages reported by lintian.

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
4 years agoAdd line breaks in a man page
Seunghun Han [Wed, 3 Jun 2020 06:01:01 +0000 (15:01 +0900)]
Add line breaks in a man page

This patch fixes line break warnings reported by the lintian tool.

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
4 years agotests: Skip derived key test 1st part on big endian machines
Stefan Berger [Wed, 27 May 2020 16:20:26 +0000 (12:20 -0400)]
tests: Skip derived key test 1st part on big endian machines

The first part of the derived key test only works fine on 64 bit
little endian machines. Skip big endian machines.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Create the RSA 3072 EK key with an empty nonce
Stefan Berger [Mon, 18 May 2020 12:54:44 +0000 (08:54 -0400)]
swtpm_setup: Create the RSA 3072 EK key with an empty nonce

Create the RSA 3072 EK key with an empty nonce rather than a nonce full
of 0 bytes.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Put RSA 3072 EK Certificate into NVRAM idx 0x01c0001c
Stefan Berger [Mon, 18 May 2020 12:34:16 +0000 (08:34 -0400)]
swtpm_setup: Put RSA 3072 EK Certificate into NVRAM idx 0x01c0001c

Put the RSA 3072 EK Certificate into NVRAM index 0x01c0001c.

Signed-off-by: Stefan Berger stefanb@linux.ibm.com>
4 years agobuild-sys: Let swtpm build with in-place libtpms
James Bottomley [Sun, 10 May 2020 19:32:43 +0000 (12:32 -0700)]
build-sys: Let swtpm build with in-place libtpms

Building things like this in-place is really useful when you can't be
bothered to package and install them for your distribution but still
want to use them.  This patch allows building swtpm with libtpms in
place.  Simply specify the location to LDFLAGS and CFLAGS on the
configure line

LIBTPMS_CFLAGS=-I/home/jejb/git/libtpms/include/ LIBTPMS_LDFLAGS=-L/home/jejb/git/libtpms/src/.libs/ ./configure

It will then build a version that can run in-place.

I also think it corrects a bug in the original in that if pkg-config
had specified a non standard library location, the version check
wouldn't have used it.

Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Allow to create largest possible EK
Stefan Berger [Wed, 29 Apr 2020 19:14:36 +0000 (15:14 -0400)]
swtpm_setup: Allow to create largest possible EK

By passing '--rsa-keysize max' allow to create the largest possible RSA
EK key.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Extend swtpm_setup test cases to also test with RSA 3072 bit keys
Stefan Berger [Thu, 23 Apr 2020 19:01:14 +0000 (15:01 -0400)]
tests: Extend swtpm_setup test cases to also test with RSA 3072 bit keys

Extend a few test cases to also test with RSA 3072 bit keys if they
are supported.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Add support for RSA 3072 bit EK keys
Stefan Berger [Thu, 23 Apr 2020 15:28:57 +0000 (11:28 -0400)]
swtpm_setup: Add support for RSA 3072 bit EK keys

Extend the creation of the EK key to support also 3072 bits RSA keys.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Report supported RSA key sizes useful for EK key creation
Stefan Berger [Thu, 23 Apr 2020 17:18:07 +0000 (13:18 -0400)]
swtpm_setup: Report supported RSA key sizes useful for EK key creation

Extend the --print-capabilities option to also report supported RSA
key sizes. Only the TPM 2 may support anything else than 2048 bit RSA
keys, so we only consult 'swtpm socket --tpm2 --print-capabilities'
and grep for 2048 and 3072 key sizes and report them.
If nothing is found, nothing is reported, as before, and 2048 bit RSA
keys should be assumed.

'swtpm_setup --tpm2 --print-capabilities' may now show the following:
{
  "type": "swtpm_setup",
  "features": [
    "cmdarg-keyfile-fd",
    "cmdarg-pwdfile-fd",
    "tpm2-rsa-keysize-2048",
    "tpm2-rsa-keysize-3072"
  ]
}

Also adjust a test case to use a regular expression for matching
against an expected string that may nor may not have rsa-keysize
verbs.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Remove RSA 3072 tests only if libtpms not show RSA 3072 support
Stefan Berger [Mon, 20 Apr 2020 15:36:12 +0000 (11:36 -0400)]
tests: Remove RSA 3072 tests only if libtpms not show RSA 3072 support

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>
4 years agoswtpm: Construct RSA key size capabilities from TPMLIB_GetInfo()
Stefan Berger [Thu, 23 Apr 2020 14:19:50 +0000 (10:19 -0400)]
swtpm: Construct RSA key size capabilities from TPMLIB_GetInfo()

Construct RSA key size capability strings from libtpms TPMLIB_GetInfo()
string so that we can easily show which RSA key sizes are supported by
the TPM 2 implementation. If none are advertised, 1024 & 2048 can be
assumed to be supported.

'swtpm socket --tpm2 --print-capabilities' may now print the following:
{
  "type": "swtpm",
  "features": [
    "tpm-send-command-header",
    "flags-opt-startup",
    "cmdarg-seccomp",
    "cmdarg-key-fd",
    "cmdarg-pwd-fd",
    "no-tpm12-tools",
    "rsa-keysize-1024",
    "rsa-keysize-2048",
    "rsa-keysize-3072"
  ]
}

We need to adapt the related test case to use a regular expression since
the rsa-keysize-xyz strings may or may not be there depending on libtpms
version.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Report 'no-tpm12-tools' if tcsd or tpm-tools missing
Stefan Berger [Fri, 1 May 2020 20:27:14 +0000 (16:27 -0400)]
swtpm_setup: Report 'no-tpm12-tools' if tcsd or tpm-tools missing

If the host is missing tcsd (trousers) or the tpm-tools, swtpm_setup
will now report the 'no-tpm12-tools' verb like this:

> swtpm_setup --print-capabilities | jq

{
  "type": "swtpm_setup",
  "features": [
    "cmdarg-keyfile-fd",
    "cmdarg-pwdfile-fd",
    "no-tpm12-tools"
  ]
}

The only TPM 1.2 setup parameter that requires interaction with
the TPM 1.2 that can be pass is then '--createek'.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: bugfix: Create ECC storage primary key in owner hierarchy
Stefan Berger [Fri, 1 May 2020 19:10:03 +0000 (15:10 -0400)]
swtpm_setup: bugfix: Create ECC storage primary key in owner hierarchy

The ECC storage primary key was mistakently created in the endorsement
hierarchy but should be in the owner hierarchy. This patch corrects this
to have this key created in the owner hierarchy (like the RSA key),
thus using 0x40 00 00 01.

This only mattered if one used --create-spk and --ecc together.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: return result of called function rather than 0
Stefan Berger [Fri, 1 May 2020 14:14:29 +0000 (10:14 -0400)]
swtpm_setup: return result of called function rather than 0

Return the result of the called function rather than 0.

Fixes: d65f5ae1 ("swtpm_setup: Create RSA 2048 and ECC NIST P256 keys and certs")
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: bugfix: remove tpm2_stirrandom and tpm2_changeeps
Stefan Berger [Fri, 1 May 2020 01:12:26 +0000 (21:12 -0400)]
swtpm_setup: bugfix: remove tpm2_stirrandom and tpm2_changeeps

Remove tpm2_stirrandom, which we should not need to run on a newly
created TPM 2.
Also remove tpm2_changeeps which was called twice when creating two
EKs, thus invalidating a previous EK that may have been created.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Switch to NIST P384 curves
Stefan Berger [Wed, 29 Apr 2020 23:22:09 +0000 (19:22 -0400)]
swtpm_setup: Switch to NIST P384 curves

Switch to NIST P384 curves for the storage primary key as well as the 2nd EK.
The EK part now complies with the following specification:

TCG PC Client Platform TPM Profile Specification for TPM 2.0
Version 1.04
Revision 37
February 3, 2020

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Create RSA 2048 and ECC NIST P256 keys and certs
Stefan Berger [Thu, 30 Apr 2020 05:41:13 +0000 (01:41 -0400)]
swtpm_setup: Create RSA 2048 and ECC NIST P256 keys and certs

Following "TCG PC Client Platform TPM Profile Specification for
TPM 2.0, version 1.04, Rev 37" create and RSA and an ECC NIST P256
key now. We will upgrade the ECC NIST key to P384 in the next
step.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Move code into tpm2_create_ek_and_cert
Stefan Berger [Thu, 30 Apr 2020 05:02:51 +0000 (01:02 -0400)]
swtpm_setup: Move code into tpm2_create_ek_and_cert

Move a whole bunch of EK and certificate creation code into its
own function.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Implement function to create ECC NIST P384 EK keys
Stefan Berger [Wed, 29 Apr 2020 22:16:17 +0000 (18:16 -0400)]
swtpm_setup: Implement function to create ECC NIST P384 EK keys

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Rename NONCE_ECC to NONCE_ECC_256
Stefan Berger [Wed, 29 Apr 2020 22:36:30 +0000 (18:36 -0400)]
swtpm_setup: Rename NONCE_ECC to NONCE_ECC_256

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Pass the ECC curve id and hash alg. into functions
Stefan Berger [Wed, 29 Apr 2020 20:58:00 +0000 (16:58 -0400)]
swtpm_setup: Pass the ECC curve id and hash alg. into functions

Pass the ECC curve id and hash algorithm and the ECC_NONCE to the
function creating the ECC keys rather than hard coding them. Rename
the functions that create the NIST_P256 ECC keys to have _nist_p256
suffix in the name.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Calculate offset for 2nd ecc key part based on length
Stefan Berger [Wed, 29 Apr 2020 20:40:15 +0000 (16:40 -0400)]
swtpm_setup: Calculate offset for 2nd ecc key part based on length

Rather than passing the offset of the 2nd part of an ecc key pass
the length of the key and calculate the 2nd offset using the length.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Leave notes about version of templates that were used
Stefan Berger [Wed, 29 Apr 2020 19:48:34 +0000 (15:48 -0400)]
swtpm_setup: Leave notes about version of templates that were used

Leave a not about what version of template was used for the
RSA and ECC EK keys before updating them now.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agosamples: Parse optional id= for ECC curve IDs
Stefan Berger [Wed, 29 Apr 2020 23:05:11 +0000 (19:05 -0400)]
samples: Parse optional id= for ECC curve IDs

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_cert: Support --ecc-curveid option to pass curve id
Stefan Berger [Wed, 29 Apr 2020 23:15:30 +0000 (19:15 -0400)]
swtpm_cert: Support --ecc-curveid option to pass curve id

Implement support for passing the curve id via the --curve-id
option. Default assumes secp256r1. secp384r1 is also supported.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Pass -pc 80 to tssgetcapability to see all 65 handles
Stefan Berger [Sat, 25 Apr 2020 16:07:22 +0000 (12:07 -0400)]
tests: Pass -pc 80 to tssgetcapability to see all 65 handles

tssgetcapability only retrieves a maximum of 64 handles by default.
However, there are 65 persisted keys. Pass -pc 80 to the command to
see all 65 Handles.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Make coverity happy by handling default case in case statement
Stefan Berger [Fri, 24 Apr 2020 19:20:23 +0000 (15:20 -0400)]
swtpm: Make coverity happy by handling default case in case statement

Handle the default cases, which shouldn't ever be reachable, and set
the tocopy to '0' so that no unitialized variable gets copied.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Add test case for loading of an NVRAM completely full with keys
Stefan Berger [Thu, 23 Apr 2020 00:55:15 +0000 (20:55 -0400)]
tests: Add test case for loading of an NVRAM completely full with keys

Add a test case that fills up the NVRAM area with as many persisted keys
as possible and then fills up the rest with an NVRAM index so that all
space is occupied. We have to be able to load this state again into the
NVRAM once the OBJECT's size increases due to RSA keys size increase,
which must have us increase the total size of NVRAM in libtpm's TPM profile.

The state in tests/data/tpm2state5/tpm2-00.permall was created using
libtpms 0.6.0, where only 2048 bit keys were supported and total NVRAM size
was 128kb. This state file should never be changed and always be loadable
into a current libtpms. In its USER NVRAM it holds 64 persisted 2048 bit
keys and an NVRAM index with 236 bytes. For this to stay the reference
NVRAM, we need to make sure that it fits exactly to the byte.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Repeat download of TPM 1.2 test suite with random wait intervals
Stefan Berger [Fri, 24 Apr 2020 15:17:54 +0000 (11:17 -0400)]
tests: Repeat download of TPM 1.2 test suite with random wait intervals

Sometimes the download of the TPM 1.2 test suite from sourceforge
fails. So retry up to 3 times and wait a random seconds in the interval
of [3..10] before retrying.

Check the hash of the file we downloaded to make sure we get what we
expected.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Invoke print capabilites after choosing TPM version
Stefan Berger [Thu, 23 Apr 2020 13:11:22 +0000 (09:11 -0400)]
swtpm: Invoke print capabilites after choosing TPM version

Invoke the printing of the capabilites after choosing the TPM version
in libtpms.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Add test case for 'swtpm <iface> --tpm2 --print-capabilities'
Stefan Berger [Thu, 23 Apr 2020 15:01:58 +0000 (11:01 -0400)]
tests: Add test case for 'swtpm <iface> --tpm2 --print-capabilities'

Add a test case testing the returned value from

  swtpm <iface> --tpm2 --print-capabilities

along with those return from swtpm_setup.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Revert accidental port change from commit 0194fb22a
Stefan Berger [Wed, 22 Apr 2020 20:27:42 +0000 (16:27 -0400)]
tests: Revert accidental port change from commit 0194fb22a

Revert the accidental port change from commit 0194fb22a.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Remove unnecessary #include <seccomp.h> (fixes SuSE build)
Stefan Berger [Mon, 20 Apr 2020 21:54:10 +0000 (17:54 -0400)]
swtpm: Remove unnecessary #include <seccomp.h> (fixes SuSE build)

It's not necessary anymore to #include <seccomp.h> from the main programs.
Once removed, it also fixes the build on SuSE where seccomp.h is in
seccomp/seccomp.h and we didn't use the LIBSECCOMP_CFLAGS for swtpm.c etc.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Use 'cp -f' for copying over existing files (Travis issue)
Stefan Berger [Wed, 15 Apr 2020 22:32:29 +0000 (18:32 -0400)]
tests: Use 'cp -f' for copying over existing files (Travis issue)

Use 'cp -f' to force-copy over existing files. This solves an issue
seen only on Travis.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agosamples: Extend script to create a CA using a TPM 2 for signing
Stefan Berger [Tue, 30 Oct 2018 02:02:06 +0000 (22:02 -0400)]
samples: Extend script to create a CA using a TPM 2 for signing

Extend the script that creates a CA that uses a TPM 2 for signing.
For this we have to create tokens using the TPM 2 pkcs11 module's
tpm2_ptool and can then use the p11tool for creating keys.

Add a test case that requires a running tpm2-abrmd and tpm2_ptool.
Eventually the test case should (try to) start its own tpm2-abrmd
and talk to swtpm directly but the tcti module to do that isn't
available as a package, yet.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Add some recent syscalls to seccomp blacklist
Stefan Berger [Mon, 13 Apr 2020 15:58:32 +0000 (11:58 -0400)]
swtpm: Add some recent syscalls to seccomp blacklist

Add some recent syscalls to the seccomp blacklist, particularly
setter type of functions.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Address cygwin compilation warning
Stefan Berger [Sun, 12 Apr 2020 00:19:12 +0000 (20:19 -0400)]
swtpm: Address cygwin compilation warning

Compilation on cygwin reports the following issue:

In file included from key.c:43:
key.c: In function ‘key_stream_to_bin’:
key.c:135:26: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  135 |            !isspace(input[digits]) &&
      |                     ~~~~~^~~~~~~~
key.c:143:40: error: array subscript has type ‘char’ [-Werror=char-subscripts]
  143 |     if (input[digits] && !isspace(input[digits]))
      |                                   ~~~~~^~~~~~~~

Address the issue using an explicit cast of char to int.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm_setup: Remove some old cruft
Stefan Berger [Fri, 10 Apr 2020 12:22:37 +0000 (08:22 -0400)]
swtpm_setup: Remove some old cruft

Remove some commented code and some code that isn't executed any
differently for the user id that's running it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Create orderly NVRAM indices and then clear TPM 2 (for coverage)
Stefan Berger [Fri, 10 Apr 2020 00:32:46 +0000 (20:32 -0400)]
tests: Create orderly NVRAM indices and then clear TPM 2 (for coverage)

Create orderly NVRAM indices and then clear the TPM 2 so that NvDeleteRam()
gets executed and we get better code coverage.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Modify test to create 2 orderly indices
Stefan Berger [Thu, 9 Apr 2020 22:54:37 +0000 (18:54 -0400)]
tests: Modify test to create 2 orderly indices

Modify the test_tpm2_save_load_state_3 to create 2 orderly NVRAM indices
in the first two locations. Those indices will be cleared by a reset
of the TPM and therefore cannot be read once the TPM 2 restarts after
the reset. This also provides better test coverage.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoTravis: Run IBM TSS2 for coverage; use Bionic
Stefan Berger [Thu, 9 Apr 2020 14:56:38 +0000 (10:56 -0400)]
Travis: Run IBM TSS2 for coverage; use Bionic

The IBM TSS2 is available starting with Bionic. Use it there
to extend the test coverage of the code.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Change localhost to 127.0.0.1 or explicityly set 127.0.0.1
Stefan Berger [Thu, 9 Apr 2020 16:50:03 +0000 (12:50 -0400)]
tests: Change localhost to 127.0.0.1 or explicityly set 127.0.0.1

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>
4 years agoswtpm_setup: Explicitly set TCSD_TCP_DEVICE_HOSTNAME=127.0.0.1
Stefan Berger [Thu, 9 Apr 2020 22:18:00 +0000 (18:18 -0400)]
swtpm_setup: Explicitly set TCSD_TCP_DEVICE_HOSTNAME=127.0.0.1

To make swtpm_setup.sh work on Travis on Bionic we need to
explicitly set TCSD_TCP_DEVICE_HOSTAME=127.0.0.1 since lookup
of localhost (with the API the tcsd is using) does not work.
It doesn't negatively affect any other use case, so no problem
setting it.

Also replace localhost in the bash tcp device path with 127.0.0.1.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Run all tests again in run_test
Stefan Berger [Tue, 7 Apr 2020 20:48:26 +0000 (16:48 -0400)]
tests: Run all tests again in run_test

Previous commit broke the run_test script and only ended up running
the first test. This  patch fixes it and displays an success message
at the end.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Disable CUSE interface testing in run_test.sh
Stefan Berger [Tue, 7 Apr 2020 19:46:34 +0000 (15:46 -0400)]
tests: Disable CUSE interface testing in run_test.sh

Diable testing with the CUSE interface in run_test.sh. The CUSE driver
in Linux seems to have some stability problems.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Better detect a 32 bit TPM for the TPM2 derived keys test
Stefan Berger [Tue, 7 Apr 2020 19:30:25 +0000 (15:30 -0400)]
tests: Better detect a 32 bit TPM for the TPM2 derived keys test

The simplest way to detect whether SWTPM_EXE is a 64 bit application on
Linux is to check whether it links against any library in a */lib64/*
directory and only if this is the case we run a particular test case for
which we know what keys 64 bit TPMs are producing given a pre-created
state.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Use the IBM TSS2 v1.4.0's test suite
Stefan Berger [Tue, 7 Apr 2020 15:14:14 +0000 (11:14 -0400)]
tests: Use the IBM TSS2 v1.4.0's test suite

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>
4 years agoRPM: Adjust version to 0.4.0 at beginning of dev cycle
Stefan Berger [Tue, 7 Apr 2020 14:40:15 +0000 (10:40 -0400)]
RPM: Adjust version to 0.4.0 at beginning of dev cycle

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoDebian: Adjust changelog for 0.4.0~dev1 developer release
Stefan Berger [Tue, 7 Apr 2020 14:39:12 +0000 (10:39 -0400)]
Debian: Adjust changelog for 0.4.0~dev1 developer release

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agobuild-sys: Bump up version to 0.4.0 at beginning of dev cycle
Stefan Berger [Tue, 7 Apr 2020 14:37:56 +0000 (10:37 -0400)]
build-sys: Bump up version to 0.4.0 at beginning of dev cycle

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoTravis: Checkout a certain libtpms revision
Stefan Berger [Wed, 18 Mar 2020 12:13:09 +0000 (08:13 -0400)]
Travis: Checkout a certain libtpms revision

Allow specifying a libtpms revision to test with, defaulting to
master branch.

Have the OS X test use the stable-0.6.0 branch.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agoswtpm: Fix vtpm proxy case without startup flags
Stefan Berger [Fri, 6 Mar 2020 15:16:33 +0000 (10:16 -0500)]
swtpm: Fix vtpm proxy case without startup flags

'swtpm chardev --vptm-proxy' currently requires a '--flag startup-xyz'
to be passed since otherwise the need_init_cmd variable would not be
set to false and swtpm would terminate after sending the startup
command. To maintain backwards compatibility we have to always
set the need_init_cmd variable to false for the --vtpm-proxy case
and must not require a startup flag to be passed.

Roll back one of the test case to not use the startup flag.

Fixes: e6bc4bdf0 ('swtpm: Enable sending startup commands ...')
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
4 years agotests: Skip test 4 of derived keys in case an allowed error is encounterd
Stefan Berger [Wed, 26 Feb 2020 02:34:21 +0000 (21:34 -0500)]
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>