Commit Graph

1332 Commits

Author SHA1 Message Date
Stefan Berger
6e7df39f22 build: remove hardcoded tss user and group
Adding forgotten file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-03 10:13:46 -05:00
Stefan Berger
c4ac0a11e9 build: remove hardcoded tss user and group
Remove the hardcodes tss user and group and to configure with
--with-tss-user=tss --with-tss-group=tss to set the tss user
and group to be used.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-02 20:47:37 -05:00
Stefan Berger
118cc15230 swtpm: Check for existing device
Check for an existing device with the same name and print an error
if the device already exists.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-29 11:00:56 -04:00
Stefan Berger
6e710866f3 swtpm: report missing TPM state path
Report missing TPM state path as soon as possible.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-29 10:48:30 -04:00
Stefan Berger
bc525ccdab swtpm: Add support for --tpmstate dir=<dir> command line parameter
Add support for the --tpmstate dir=<dir> command line parameter.
It will be used instead of the TPM_PATH, unless it is not set.

Adapt two test cases for the new parameter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-27 21:58:10 -04:00
Stefan Berger
efb0779cd6 rpm: do not remove policies when removing package during upgrade
Do not remove the SELinux policies during the remove phase of
an old package when upgrading.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-27 21:39:00 -04:00
Stefan Berger
83ef6c972f build: bump revision up to 'dev2'
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-27 07:32:12 -04:00
Stefan Berger
08f1e70db6 build: Simplify the check for -fstack-protector-strong
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-26 11:23:19 -04:00
Stefan Berger
b080afb533 Build: Also search for the gawk tool
Extend configure.ac to also search for the gawk tool.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-26 10:56:54 -04:00
Stefan Berger
f77427eb0d build: Check for -fstack-protector-strong before using it
Import AX_CHECK_COMPILE_FLAG to help check for compiler option
-fstack-protector-strong.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-26 10:49:07 -04:00
Stefan Berger
b215173767 swtpm: Add command line parameter for pidfile
Add support for --pid file=<pidfile> command line parameter support.
The swtpm_cuse and swtpm now write their process IDs (pids) into
a file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-26 06:34:14 -04:00
Stefan Berger
907e813b3c spec: use current spec file.
Use current spec file rather than one that references libtpms 0.6.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-16 19:10:27 -04:00
Stefan Berger
7d4b4514a3 build: enable RPM building for non-root users
Disable the chown commands when building an RPM; we try to detect this
by the usage of DESTDIR.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-16 19:08:43 -04:00
Stefan Berger
c43ad8fac2 tests: Skip test since it requires root rights
The swtpm_setup needs to either be run as root or as tss user.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2015-10-16 15:56:23 -04:00
Stefan Berger
ee38dc59a9 spec: add spec for usage with yum-builddep
Add a current spec file for usage with yum-builddep for installing
all the necessary build dependencies.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-16 12:04:51 -04:00
Stefan Berger
39d0c3ded0 man pages: Add man page describing the ioctl's
This patch adds a man page that describes the supported ioctl's.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-03 18:42:31 -04:00
Stefan Berger
373a9be985 Some more changes to the ioctl's
Some more changes to tpm_ioctl.h including
- comment for request and response part of an ioctl
- unified format
- prefix all constants with PTM_

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-03 18:41:33 -04:00
Stefan Berger
1cc0af409b dist: currently build a development version
Add .dev to the version of the built swtpm package to indicate
development version.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-10-03 18:12:22 -04:00
Stefan Berger
a76b4eebc2 build: only apply hardening CFLAGS if -O0 is not used
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-08-04 11:55:31 -04:00
Stefan Berger
2c3c8d27d2 tests: fix more typos
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-08-03 09:56:27 -04:00
Stefan Berger
2773883b3e test: fix a typo
Fix a typing error.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-08-03 07:01:13 -04:00
Stefan Berger
8e45d3e25e swtpm_cert: remove unnecessary file
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 18:05:17 -04:00
Stefan Berger
1004cfde5a samples: propagate error code
Propagate error code to the exit statement.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 16:02:09 -04:00
Stefan Berger
cf476b14d2 man pages: update on swtpm_ioctl.8
Update swtpm_ioctl.8 to latest content.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 10:59:01 -04:00
Stefan Berger
5007f2d06f man pages: clarification for swtpm_setup
swtpm_setup uses swtpm executable it finds in the path.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-02 10:55:27 -04:00
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
4f185f6e45 swtpm_setup: cleanup
Cleanup the code a bit:
 o added description to several functions
 o remove empty lines between functions
 o cleanup the usage screen
 o fix the parameters to logerr

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-07-01 21:01:59 -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
a209a01816 swtpm_cuse: be more consistent with input buffer size checks
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-23 14:04:59 -04:00
Stefan Berger
d8b618851f Improve comments in tpm_ioctl.h
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-18 13:13:46 -04:00
Stefan Berger
6c2ef667c7 man pages: check in generated man pages
Check in generated man pages that had been missing.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-05 16:30:12 -04:00
Stefan Berger
ff1a99d7e6 swtpm: receiving of TPM state blob ends once last byte has been copied
The receiving of TPM state blob ends when the last byte has been copied
into a response to the user. No more request need to be sent afterwards.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-05 16:28:09 -04:00
Stefan Berger
c896156107 swtpm: delete blob file if set blob has length 0
If a blob with length 0 is set, we make sure the corresponding file
that would hold this blob is not available.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-06-05 16:25:33 -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
5e60c24f40 remove the tpm_number from the public interface
Remove the tpm_number from the public interface (while we still can do that)

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
31380fe68e tpm_ioctl: Remove _t from the types
Since POSIX reserves the *_t namespace of types, remove it from
all our typedefs. While doing that, adjust the typedefs to all have
the prefix ptm_ .

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
857daa32b9 tpm_ioctl: convert blob type to 32 bit int
Convert the blob type to 32bit int (while we still can do that ... )

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
8f3b270ab0 swtpm: move code to set state blob into own function
Move the code that sets the TPM's state blob into its own function.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
22fda83bf9 swtpm: move code to get the TPM state blobs into own function
Move the code to get the TPM state blobs into is own function and introduce
a caching layer that retrieves the state blob from the TPM once and has
subsequent requests to copy the state work on the cached blob.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 12:55:30 -04:00
Stefan Berger
0224c76d68 cleanup in tpm_ioctl.h
Do some cleanups in tpm_ioctl.h

Signed-off-by; Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-28 06:50:04 -04:00
Stefan Berger
ad976d1a2e Add copyright stanza where missing; update date
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-26 20:52:40 -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
082533af22 swtpm: Have crypto functions use a key as parameter
Have the crypto functions use a key as a parameter rather than having them
operate on a specific fixed key.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-25 11:12:23 -04:00
Stefan Berger
81264f7356 swtpm: break apart key parsing function
Break the key parsing function apart into a common parsing function
and one specific to the file encryption key.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-25 11:12:23 -04:00