]> git.proxmox.com Git - swtpm.git/log
swtpm.git
8 years agoswtpm: Add the control channel to the socket interface TPM
Stefan Berger [Fri, 18 Mar 2016 20:51:19 +0000 (16:51 -0400)]
swtpm: Add the control channel to the socket interface TPM

Add the control channel to the socket interface TPM as well.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: let socket and character interfaces share the mainloop
Stefan Berger [Fri, 18 Mar 2016 19:55:35 +0000 (15:55 -0400)]
swtpm: let socket and character interfaces share the mainloop

Let the socket and character interfaces share the same mainloop
function.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoPrepare the mainloop function for usage by the socket interface
Stefan Berger [Fri, 18 Mar 2016 19:14:16 +0000 (15:14 -0400)]
Prepare the mainloop function for usage by the socket interface

Prepare the mainloop function so that it can be used by the socket
interface as well.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: move chardev's mainloop into own file
Stefan Berger [Fri, 18 Mar 2016 18:27:07 +0000 (14:27 -0400)]
swtpm: move chardev's mainloop into own file

Move the swtpm chardev main loop into its own file for sharing
with the socket interface.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add --connect option support
Stefan Berger [Fri, 18 Mar 2016 17:09:01 +0000 (13:09 -0400)]
swtpm: add --connect option support

Add support for --connect option for the socket version of the TPM.
This parameter takes the type, port, file descriptor and disconnect
options. Only TCP connections are currently supported.

See updated man pages.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotpm_fastpath
Stefan Berger [Thu, 17 Mar 2016 00:03:06 +0000 (20:03 -0400)]
tpm_fastpath

Only let certain commands that are cancelable be processed
by the thread. Directly process all other commands.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Exit with error if TPM needs to be reset for activation
Stefan Berger [Thu, 18 Feb 2016 14:55:23 +0000 (09:55 -0500)]
swtpm_bios: Exit with error if TPM needs to be reset for activation

Exit with error code 129 if the TPM needs to be reset to become activated.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoAdding CLAs for corporate and individual contributors.
Stefan Berger [Mon, 1 Feb 2016 16:56:24 +0000 (11:56 -0500)]
Adding CLAs for corporate and individual contributors.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Add check for libtpms crytpo library
Stefan Berger [Tue, 26 Jan 2016 17:20:05 +0000 (12:20 -0500)]
build: Add check for libtpms crytpo library

Extend configure.ac to check for the crypto library libtpms is
using and make sure we are using the same here. Due to symbol
clashes between freebl and openssl related to the hash update
functions, we get crashes otherwise.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Add tpm_bios.h to noinst_HEADERS
Stefan Berger [Mon, 25 Jan 2016 21:23:13 +0000 (16:23 -0500)]
build: Add tpm_bios.h to noinst_HEADERS

tpm_bios.h was missing in the tar created by 'make dist'. This patch
fixes it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: use data structures to write commands
Stefan Berger [Sun, 24 Jan 2016 16:21:14 +0000 (11:21 -0500)]
swtpm_bios: use data structures to write commands

Use TPM data structures and constants to write commands.

Fix white space errors on the way.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: do not compare positive integer with < 0
Stefan Berger [Sun, 24 Jan 2016 15:07:55 +0000 (10:07 -0500)]
swtpm: do not compare positive integer with < 0

Do not compare positive integer with < 0.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: do not compare positive integer with < 0
Stefan Berger [Sun, 24 Jan 2016 14:42:43 +0000 (09:42 -0500)]
swtpm: do not compare positive integer with < 0

Do not compare positivie integer with < 0.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: use ioctl structure to return values
Stefan Berger [Sun, 24 Jan 2016 14:40:42 +0000 (09:40 -0500)]
swtpm: use ioctl structure to return values

Use the ioctl structures to return values. Properly initialize the
TPM result value.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: check for unsupported file descriptor types
Stefan Berger [Fri, 22 Jan 2016 12:37:16 +0000 (07:37 -0500)]
swtpm: check for unsupported file descriptor types

Rather than checking whether the given file descriptor is a character
device, check whether it is one of the unsupported ones. This addresses
a problem when passing anonymous file descriptors that are not character
devices.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_setup: send command for EK creation directly
Stefan Berger [Thu, 14 Jan 2016 01:05:01 +0000 (20:05 -0500)]
swtpm_setup: send command for EK creation directly

Send the TPM command for EK creation directly; it requires no
crytpo and can be hard coded.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Exclude swtpm_cert from Debian package if not found
Stefan Berger [Wed, 13 Jan 2016 21:23:08 +0000 (16:23 -0500)]
build: Exclude swtpm_cert from Debian package if not found

Exclude the swtpm_cert tool and its man page if it is not found
due to it not being compiled due to backlevel gnutls library.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Fix the Debian package dependencies
Stefan Berger [Wed, 13 Jan 2016 17:37:41 +0000 (12:37 -0500)]
build: Fix the Debian package dependencies

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoRevert "build: Include swtpm_cert if it was built, other fixes"
Stefan Berger [Wed, 13 Jan 2016 17:35:38 +0000 (12:35 -0500)]
Revert "build: Include swtpm_cert if it was built, other fixes"

This reverts commit a0116f936a0d0226e53e41f951588f15234aed1d.

8 years agobuild: Include swtpm_cert if it was built, other fixes
Stefan Berger [Wed, 13 Jan 2016 17:24:04 +0000 (12:24 -0500)]
build: Include swtpm_cert if it was built, other fixes

swtpm_cert is only included in the package if it was built, which works
on >= 15.04.

Get the dependencies right.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: add gnutls-utils as dependency
Stefan Berger [Wed, 13 Jan 2016 15:47:25 +0000 (10:47 -0500)]
build: add gnutls-utils as dependency

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotests: Display logfile upon failure
Stefan Berger [Wed, 13 Jan 2016 15:35:15 +0000 (10:35 -0500)]
tests: Display logfile upon failure

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Enable building of Debian package
Stefan Berger [Wed, 13 Jan 2016 00:54:35 +0000 (19:54 -0500)]
build: Enable building of Debian package

Add debian build files to enable building of Debian package using for exampl

debuild -b   or   dpkg-buildpackage -us -uc

Extend the .gitignore.

The debhelper checks show warnings and errors that will need to be addressed
some other time. For some I don't know how to solve them at the moment.

Signed-off-by: Stefan Berger <stefanb@linux.watson.ibm.com>
8 years agobuild: fix some issues in configure.ac
Stefan Berger [Wed, 13 Jan 2016 00:53:28 +0000 (19:53 -0500)]
build: fix some issues in configure.ac

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Link libswtpm_libtpms with glib libs
Stefan Berger [Wed, 13 Jan 2016 00:52:26 +0000 (19:52 -0500)]
build: Link libswtpm_libtpms with glib libs

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: add threadpool.h
Stefan Berger [Tue, 29 Dec 2015 09:30:27 +0000 (04:30 -0500)]
build: add threadpool.h

Add the threadpool.h to the noinst headers, so it ends up in the tgz file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Introduce durations to wait for command completions
Stefan Berger [Tue, 29 Dec 2015 09:25:42 +0000 (04:25 -0500)]
swtpm_bios: Introduce durations to wait for command completions

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: use select for waiting for response
Stefan Berger [Tue, 29 Dec 2015 01:33:02 +0000 (20:33 -0500)]
swtpm_bios: use select for waiting for response

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: move threadpool code out of cuse-tpm
Stefan Berger [Sun, 27 Dec 2015 01:09:41 +0000 (20:09 -0500)]
swtpm: move threadpool code out of cuse-tpm

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_setup: improve error handling
Stefan Berger [Mon, 28 Dec 2015 21:10:07 +0000 (16:10 -0500)]
swtpm_setup: improve error handling

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agosamples: improve error handling
Stefan Berger [Mon, 28 Dec 2015 20:58:11 +0000 (15:58 -0500)]
samples: improve error handling

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: move process owership to common file and enable in all implementations
Stefan Berger [Sat, 26 Dec 2015 21:37:58 +0000 (16:37 -0500)]
swtpm: move process owership to common file and enable in all implementations

Move the code to change process ownership into its own function and enable
--runas|-r <owner> in all implementations.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotests: add timeout to socat
Stefan Berger [Mon, 21 Dec 2015 08:25:50 +0000 (03:25 -0500)]
tests: add timeout to socat

Add a timeout to socat so that on slower machines the tests succeed.

Clean up an #include.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add CMD_SHUTDOWN to control channel
Stefan Berger [Mon, 21 Dec 2015 01:54:03 +0000 (20:54 -0500)]
swtpm: add CMD_SHUTDOWN to control channel

Extend the control channel with CMD_SHUTDOWN to shut down the TPM.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoUpdate TODO list
Stefan Berger [Sun, 20 Dec 2015 21:59:28 +0000 (16:59 -0500)]
Update TODO list

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add cuse TPM interface option to swtpm
Stefan Berger [Sun, 20 Dec 2015 21:18:59 +0000 (16:18 -0500)]
swtpm: add cuse TPM interface option to swtpm

Now that the CUSE TPM part is BSD licensed, extend the swtpm
program with the cuse option.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: clean up single letter options
Stefan Berger [Sun, 20 Dec 2015 18:17:04 +0000 (13:17 -0500)]
swtpm: clean up single letter options

Remove single letter options that are not described in the help screen.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotests: Deactivate the checking for the certificate size
Stefan Berger [Mon, 14 Dec 2015 02:58:38 +0000 (21:58 -0500)]
tests: Deactivate the checking for the certificate size

Deactivate the checking for the certificate size since different
GnuTLS versions may create certificates of different sizes by adding
additional fields or other data to the cert.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: do not ignore write return value
Stefan Berger [Mon, 14 Dec 2015 02:40:33 +0000 (21:40 -0500)]
swtpm: do not ignore write return value

If the 'swtpm chardev' receives an error on write() or not all bytes
could be written, log an error and terminate.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotests: move modprobe cuse into common file
Stefan Berger [Mon, 14 Dec 2015 02:23:12 +0000 (21:23 -0500)]
tests: move modprobe cuse into common file

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: use endian.hi for endianess conversion
Stefan Berger [Mon, 7 Dec 2015 22:25:14 +0000 (17:25 -0500)]
swtpm: use endian.hi for endianess conversion

Use the macros defined in endian.h for endianess conversion.

Fix the conversion of a 64bit variable.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add missing dirent.h include
Stefan Berger [Tue, 8 Dec 2015 03:10:17 +0000 (22:10 -0500)]
swtpm: add missing dirent.h include

On PowerKVM dirent.h needs to be included.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: fix build of rpm
Stefan Berger [Tue, 8 Dec 2015 03:05:28 +0000 (22:05 -0500)]
build: fix build of rpm

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Replace the CUSE TPM with the new implementation
Stefan Berger [Mon, 7 Dec 2015 20:01:57 +0000 (15:01 -0500)]
swtpm: Replace the CUSE TPM with the new implementation

Replace the CUSE TPM with the new BSD implementation.
Update the license references and the license itself.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: transfer the rest of the code
Stefan Berger [Mon, 7 Dec 2015 19:57:54 +0000 (14:57 -0500)]
swtpm: transfer the rest of the code

Transfer the rest of the CUSE TPM code into the new application.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Implement ptm_init_done function
Stefan Berger [Mon, 7 Dec 2015 19:57:54 +0000 (14:57 -0500)]
swtpm: Implement ptm_init_done function

Implement the ptm_init_done function

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Implement command line option parsing and main function
Stefan Berger [Mon, 7 Dec 2015 19:57:54 +0000 (14:57 -0500)]
swtpm: Implement command line option parsing and main function

Implement the command line option parsing and the main() function.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Re-implement CUSE TPM under BSD license
Stefan Berger [Mon, 7 Dec 2015 19:57:54 +0000 (14:57 -0500)]
swtpm: Re-implement CUSE TPM under BSD license

Eric Richter implemented a clean-room skeleton CUSE driver which
we will now convert to the CUSE TPM. The goal is to replace the
GPL CUSE TPM implementation with this 3-clause BSD implementation.
Among other things, this makes it easier to link with OpenSSL.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Add option to give up physical presence
Stefan Berger [Fri, 4 Dec 2015 22:46:41 +0000 (17:46 -0500)]
swtpm_bios: Add option to give up physical presence

Extend the swtpm_bios tool with an option to give up physical presence.

Have the TPM error codes reflected in the exit error of 128.

Add a test case for the tool.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: do not display help screen on -h
Stefan Berger [Fri, 4 Dec 2015 14:31:49 +0000 (09:31 -0500)]
swtpm_ioctl: do not display help screen on -h

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Add option to only display version info
Stefan Berger [Fri, 4 Dec 2015 12:31:55 +0000 (07:31 -0500)]
swtpm: Add option to only display version info

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add version info to all programs
Stefan Berger [Fri, 4 Dec 2015 00:17:47 +0000 (19:17 -0500)]
swtpm: add version info to all programs

Move src/swtpm/swtpm.h.in to include/swtpm.h.in to make it commonly
available. Adapt all other programs to use it and display version information
in the help screen.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: poll for HUP as well
Stefan Berger [Thu, 3 Dec 2015 14:14:54 +0000 (09:14 -0500)]
swtpm: poll for HUP as well

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: check for socat tool
Stefan Berger [Mon, 30 Nov 2015 20:35:17 +0000 (15:35 -0500)]
build: check for socat tool

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: move chmod into AC_CONFIG_FILES
Stefan Berger [Sun, 29 Nov 2015 23:59:13 +0000 (18:59 -0500)]
build: move chmod into AC_CONFIG_FILES

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_setup: enable help screen for normal users
Stefan Berger [Sun, 29 Nov 2015 22:05:18 +0000 (17:05 -0500)]
swtpm_setup: enable help screen for normal users

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: fix some coverity errors
Stefan Berger [Sun, 29 Nov 2015 06:46:49 +0000 (01:46 -0500)]
swtpm: fix some coverity errors

Fix some errors raised by Coverity.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotest: fix file permission
Stefan Berger [Sat, 28 Nov 2015 15:47:32 +0000 (10:47 -0500)]
test: fix file permission

Signed-off-ny: Stefan Berger <stefanb@linux.vnet.ibm.com>

8 years agoswtpm: introduce control channel for chardev TPM
Stefan Berger [Fri, 27 Nov 2015 22:34:15 +0000 (17:34 -0500)]
swtpm: introduce control channel for chardev TPM

Implement a control channel for the 'chardev' swtpm that implements
a minimal set of control messages for now.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Fix typo in error message
Stefan Berger [Sat, 28 Nov 2015 03:13:36 +0000 (22:13 -0500)]
swtpm: Fix typo in error message

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: consoldiate code
Stefan Berger [Fri, 27 Nov 2015 22:34:15 +0000 (17:34 -0500)]
swtpm: consoldiate code

Consolidate common code.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: fix TPM_DEBUG define
Stefan Berger [Fri, 27 Nov 2015 15:25:14 +0000 (10:25 -0500)]
swtpm: fix TPM_DEBUG define

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm chardev: remove not supported command line option
Stefan Berger [Fri, 27 Nov 2015 15:23:54 +0000 (10:23 -0500)]
swtpm chardev: remove not supported command line option

Remove a not supported command line option from the help screen of
'swtpm chardev'.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: remove pidfile after process exits
Stefan Berger [Sun, 15 Nov 2015 18:51:05 +0000 (13:51 -0500)]
swtpm: remove pidfile after process exits

Remove the pidfile once swtpm process exits.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: add support for listening on chardev
Stefan Berger [Sun, 8 Nov 2015 19:09:17 +0000 (14:09 -0500)]
swtpm: add support for listening on chardev

Add support for 'swtpm chardev' that listens for TPM commands on a given
character device and sends responses through it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: make all possible variables static
Stefan Berger [Sun, 8 Nov 2015 17:22:37 +0000 (12:22 -0500)]
swtpm: make all possible variables static

Some of the variables in swtpm.c were not static, fix this.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: remove hardcoded tss user and group
Stefan Berger [Tue, 3 Nov 2015 15:12:58 +0000 (10:12 -0500)]
build: remove hardcoded tss user and group

Adding forgotten file.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: remove hardcoded tss user and group
Stefan Berger [Tue, 3 Nov 2015 01:41:43 +0000 (20:41 -0500)]
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>
8 years agoswtpm: Check for existing device
Stefan Berger [Thu, 29 Oct 2015 15:00:25 +0000 (11:00 -0400)]
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>
8 years agoswtpm: report missing TPM state path
Stefan Berger [Thu, 29 Oct 2015 14:08:30 +0000 (10:08 -0400)]
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>
8 years agoswtpm: Add support for --tpmstate dir=<dir> command line parameter
Stefan Berger [Wed, 28 Oct 2015 01:53:25 +0000 (21:53 -0400)]
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>
8 years agorpm: do not remove policies when removing package during upgrade
Stefan Berger [Tue, 27 Oct 2015 15:42:16 +0000 (11:42 -0400)]
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>
8 years agobuild: bump revision up to 'dev2'
Stefan Berger [Tue, 27 Oct 2015 11:23:59 +0000 (07:23 -0400)]
build: bump revision up to 'dev2'

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Simplify the check for -fstack-protector-strong
Stefan Berger [Mon, 26 Oct 2015 15:19:51 +0000 (11:19 -0400)]
build: Simplify the check for -fstack-protector-strong

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoBuild: Also search for the gawk tool
Stefan Berger [Mon, 26 Oct 2015 14:56:54 +0000 (10:56 -0400)]
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>
8 years agobuild: Check for -fstack-protector-strong before using it
Stefan Berger [Mon, 26 Oct 2015 14:09:54 +0000 (10:09 -0400)]
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>
8 years agoswtpm: Add command line parameter for pidfile
Stefan Berger [Mon, 26 Oct 2015 10:25:27 +0000 (06:25 -0400)]
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>
8 years agospec: use current spec file.
Stefan Berger [Fri, 16 Oct 2015 23:10:23 +0000 (19:10 -0400)]
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>
8 years agobuild: enable RPM building for non-root users
Stefan Berger [Fri, 16 Oct 2015 23:08:26 +0000 (19:08 -0400)]
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>
8 years agotests: Skip test since it requires root rights
Stefan Berger [Fri, 16 Oct 2015 19:56:14 +0000 (15:56 -0400)]
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>
8 years agospec: add spec for usage with yum-builddep
Stefan Berger [Fri, 16 Oct 2015 16:04:41 +0000 (12:04 -0400)]
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>
9 years agoman pages: Add man page describing the ioctl's
Stefan Berger [Sat, 3 Oct 2015 22:41:33 +0000 (18:41 -0400)]
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>
9 years agoSome more changes to the ioctl's
Stefan Berger [Sat, 3 Oct 2015 22:41:33 +0000 (18:41 -0400)]
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>
9 years agodist: currently build a development version
Stefan Berger [Sat, 3 Oct 2015 22:12:18 +0000 (18:12 -0400)]
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>
9 years agobuild: only apply hardening CFLAGS if -O0 is not used
Stefan Berger [Tue, 4 Aug 2015 15:48:02 +0000 (11:48 -0400)]
build: only apply hardening CFLAGS if -O0 is not used

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agotests: fix more typos
Stefan Berger [Mon, 3 Aug 2015 13:55:35 +0000 (09:55 -0400)]
tests: fix more typos

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agotest: fix a typo
Stefan Berger [Mon, 3 Aug 2015 11:01:10 +0000 (07:01 -0400)]
test: fix a typo

Fix a typing error.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agoswtpm_cert: remove unnecessary file
Stefan Berger [Thu, 2 Jul 2015 22:05:05 +0000 (18:05 -0400)]
swtpm_cert: remove unnecessary file

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agosamples: propagate error code
Stefan Berger [Thu, 2 Jul 2015 20:02:07 +0000 (16:02 -0400)]
samples: propagate error code

Propagate error code to the exit statement.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agoman pages: update on swtpm_ioctl.8
Stefan Berger [Thu, 2 Jul 2015 14:58:57 +0000 (10:58 -0400)]
man pages: update on swtpm_ioctl.8

Update swtpm_ioctl.8 to latest content.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agoman pages: clarification for swtpm_setup
Stefan Berger [Thu, 2 Jul 2015 14:55:22 +0000 (10:55 -0400)]
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>
9 years agoswtpm_setup: remove PATH extension to local dir
Stefan Berger [Thu, 2 Jul 2015 14:49:24 +0000 (10:49 -0400)]
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>
9 years agoswtpm_setup: cleanup
Stefan Berger [Thu, 2 Jul 2015 00:51:14 +0000 (20:51 -0400)]
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>
9 years agotest: poll for port closure
Stefan Berger [Tue, 30 Jun 2015 17:31:08 +0000 (13:31 -0400)]
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>
9 years agotest: poll for port available
Stefan Berger [Tue, 30 Jun 2015 17:08:09 +0000 (13:08 -0400)]
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>
9 years agotests: cleanup testcases
Stefan Berger [Tue, 30 Jun 2015 14:42:05 +0000 (10:42 -0400)]
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>
9 years agoswtpm_cuse: be more consistent with input buffer size checks
Stefan Berger [Tue, 23 Jun 2015 18:04:39 +0000 (14:04 -0400)]
swtpm_cuse: be more consistent with input buffer size checks

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agoImprove comments in tpm_ioctl.h
Stefan Berger [Thu, 18 Jun 2015 17:13:46 +0000 (13:13 -0400)]
Improve comments in tpm_ioctl.h

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
9 years agoman pages: check in generated man pages
Stefan Berger [Fri, 5 Jun 2015 20:30:09 +0000 (16:30 -0400)]
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>
9 years agoswtpm: receiving of TPM state blob ends once last byte has been copied
Stefan Berger [Fri, 5 Jun 2015 20:28:05 +0000 (16:28 -0400)]
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>