Commit Graph

274 Commits

Author SHA1 Message Date
Stefan Berger
84d2e89a74 swtpm_setup: remove PATH extension to local dir
Remove the extension of PATH to the local dir('.') from swtpm_setup.sh
and adapt test cases accordingly.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 10:50:05 -04:00
Stefan Berger
a8279cfde4 test: poll for port closure
Poll for the swtpm with socket interface port to close the port

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-30 13:32:22 -04:00
Stefan Berger
53b55e7145 test: poll for port available
Poll for the swtpm with socket interface port to become available for
usage.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-30 13:08:12 -04:00
Stefan Berger
d7fc046934 tests: cleanup testcases
Cleanup the test cases:
- remove unnecessary sleeps
- check exit code of swtpm_ioctl

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-30 10:42:15 -04:00
Stefan Berger
05cd79b843 Support read()/write() for TPM state blob transfer
Support the read/write interface and POSIX API calls for transfer of
TPM state blobs.

Extend the swtpm_ioctl program to support this as well. Use the
environment variable SWTPM_IOCTL_BUFFERSIZE to set the size of the
buffer to use and enable the read/write interface in this (test)
program.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-04 18:49:25 -04:00
Stefan Berger
25fee77410 Extend test cases with large permanent state
For being able to test the transfer of larger state blobs, extend the existing
test case with creating a large NVRAM location that becomes part of the permanent
state.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-04 10:55:32 -04:00
Stefan Berger
b89c956e1f tests: remove saving of volatile state before saving blob
Remove the explicit saving of volatile state before saving the volatile
state blob to a file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
bd98690a4a Add ioctl to get configuration flags about keys in use
Add an ioctl that lets an application retrieve which keys are in use by the
TPM, i.e., file encryption or migration key

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-26 07:30:38 -04:00
Stefan Berger
8236603be8 tests: add volatilestate.bin to EXTRA_DIST
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-25 15:46:04 -04:00
Stefan Berger
1680c41d9e swtpm: Add a command line option for a migration key
The migration key ensures that TPM state blobs, when retrieved using the
ioctl for getting state blobs, are always encrypted with this key.
When the state is later on loaded back into the TPM using the ioctl
to set the state blobs, the migration key is used to decrypt them.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-25 11:18:44 -04:00
Stefan Berger
4dfb26d9b4 tests: do not let test_resume_volatile touch files in git
Have test_resume_volatile create a temporary dir and copy test files to it
that may be modified during the test run.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-24 21:37:11 -04:00
Stefan Berger
b902468900 swtpm: integrity protect the encrypt TPM state
Integrity protect the TPM state when it is written in entrypted form.
libtpms state (for TPM1.2) is also integrity protecting the blobs, but
we better determine the integrity of the decrypted data on the layer
above it.
2015-05-19 16:35:08 -04:00
Stefan Berger
0dba8f77eb tests: add test case that certificate is created automatically
Add a test case that ensures that swtpm-localca automatically
creates a signing key and issuer cert if none is available.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-12 09:35:55 -04:00
Stefan Berger
d379cbb4a4 test: Use TPM_ResetEstablishmentBit command in some tests
Rather than only using the ioctl to reset the TPM Establishment
bit in a given locality, also use the TPM_ResetEstablishmentBit
command for it in some test cases.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-02 09:19:46 -04:00
Stefan Berger
a4b00166dd tests: Fix test case output
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-01 16:25:54 -04:00
Stefan Berger
0722cffd12 tests: Extends test_volatilestate with checks on establishment bit
Extend the testcase test_volatilestate with check on the TPM
establishment bit and that it is saved across volatile save/load
operations.
2015-05-01 12:24:39 -04:00
Stefan Berger
9fb43c7a98 test: Terminate swtpm in case testcase is aborted
Send a SIGTERM to the swtpm in case the testcase is aborted.
2015-04-28 20:16:47 -04:00
Stefan Berger
1140f4c656 tests: bail out if modprobe cuse fails
Terminate the test case immediately if modprobe cuse fails.
2015-04-02 06:43:39 -04:00
Stefan Berger
950040f03c swtpm_cuse: implement STOP ioctl
Implement a STOP ioctl in the swtpm and swtpm_ioctl client.
Modify test cases to used swtpm_ioctl --stop.
2015-03-16 11:50:03 -04:00
Stefan Berger
198ebab3c1 Add new ioctls for getting and setting state blobs
Add new ioctls to get and set the 3 different types of state blobs
from and to the CUSE TPM. Add test cases for testing the new ioctl's
on a CUSE TPM that stores the state encrypted and on a CUSE TPM that
stores it non-encrypted.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-03-12 09:32:28 -04:00
Stefan Berger
e150007d18 Allow tests to run in parallel
Create uniqe names for the /dev/vtpm* so that tests can run in parallel.
Also separate the state directories of the TPMs into individual temporary
dirs.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-19 16:10:59 -05:00
Stefan Berger
bb3c6bf625 Search for external echo tool
Search for bash-external echo tool.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-18 22:27:53 -05:00
Stefan Berger
0321a3808d Add ioctl to reset the establishment bit
Add an ioctl to reset the establishment bit. It takes as an
argument the locality to use.
2014-12-08 11:35:16 -05:00
Stefan Berger
e46a2b6686 merging swtpm-tools into this project 2014-12-05 13:43:21 -05:00