]> git.proxmox.com Git - swtpm.git/log
swtpm.git
7 years agotests: Wait for chardev to appear
Stefan Berger [Tue, 24 Jan 2017 13:43:48 +0000 (08:43 -0500)]
tests: Wait for chardev to appear

Wait for the chardev the VTPM proxy device creates to actually appear.
In some cases the exec statement opening the file would otherwise
create a file /dev/tpm0 for example and subsequently tests then ended
up failing.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoswtpm: Expose logging level to command line
Stefan Berger [Mon, 23 Jan 2017 23:18:59 +0000 (18:18 -0500)]
swtpm: Expose logging level to command line

Expose the logging level to the command line by extending the
log option with a level parameter.
Extend the man swtpm man page with the level parameter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoswtpm: Support unsigned int option
Stefan Berger [Mon, 23 Jan 2017 23:05:04 +0000 (18:05 -0500)]
swtpm: Support unsigned int option

Implement support for an unsigned int option.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoswtpm: Implement logging following indentation level
Stefan Berger [Mon, 23 Jan 2017 22:56:07 +0000 (17:56 -0500)]
swtpm: Implement logging following indentation level

Introduce a log level for the logging functions. The log level
is defined by the number of spaces used for indentation. Adapt
the log functions to only log when the number of leading spaces
in a string is appropriate for logging.

Call the log function of libtpms to set the file descriptor to
log to, the log level, and log line prefix.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoswtpm: Fix buffer used in logging output
Stefan Berger [Mon, 23 Jan 2017 22:52:23 +0000 (17:52 -0500)]
swtpm: Fix buffer used in logging output

Fix the buffer used in the logging output.

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

7 years agotests: Add a test case for swtpm using the vTPM proxy device
Stefan Berger [Sun, 15 Jan 2017 04:05:40 +0000 (23:05 -0500)]
tests: Add a test case for swtpm using the vTPM proxy device

Add a test case for swtpm chardev using the vTPM proxy device.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoAdd bindaddr and ifname parameters to --server option on help screen
Stefan Berger [Sun, 15 Jan 2017 03:58:47 +0000 (22:58 -0500)]
Add bindaddr and ifname parameters to --server option on help screen

Fix the missing mentioning of the bindaddr and ifname parameters for
the --server option on the help screen.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoErrno is not set after inet_pton
Stefan Berger [Sun, 15 Jan 2017 03:52:55 +0000 (22:52 -0500)]
Errno is not set after inet_pton

Do not call strerror(errno) after failure from inet_pton.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoOnly compile vTPM proxy support if available on platform
Stefan Berger [Sun, 15 Jan 2017 02:57:54 +0000 (21:57 -0500)]
Only compile vTPM proxy support if available on platform

Support for vTPM proxy is only available on Linux.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoAnnounce the TPM frontend device name and major/minor numbers
Stefan Berger [Sat, 14 Jan 2017 20:28:01 +0000 (15:28 -0500)]
Announce the TPM frontend device name and major/minor numbers

Announce the TPM frontend device name and major/minor numbers.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoswtpm: print TPM commands read from file descriptor
Stefan Berger [Sat, 14 Jan 2017 02:48:08 +0000 (21:48 -0500)]
swtpm: print TPM commands read from file descriptor

Print TPM commands read from the file descriptor.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoImplement option --vtpm-proxy to create Linux vtpm proxy device
Stefan Berger [Fri, 13 Jan 2017 23:32:57 +0000 (18:32 -0500)]
Implement option --vtpm-proxy to create Linux vtpm proxy device

Implement the option --vtpm-proxy that create a Linux vtpm proxy device
and makes the chardev TPM listen on the anaonymous file descriptor that
is returned from the ioctl creating the device.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoDisplay chardev choice only if compiled in
Stefan Berger [Tue, 3 Jan 2017 13:22:50 +0000 (08:22 -0500)]
Display chardev choice only if compiled in

Only display the chardev choice if chardev support has been
compiled in.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoDetect whether to build with chardev
Stefan Berger [Tue, 3 Jan 2017 12:13:19 +0000 (07:13 -0500)]
Detect whether to build with chardev

Detect whether to build with the chardev interface and only run tests that
need the chardev if it is supported on a particular platform.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoConditionally run tests
Stefan Berger [Tue, 3 Jan 2017 01:55:00 +0000 (20:55 -0500)]
Conditionally run tests

Conditionally run tests if building with CUSE interface or if
building with swtpm_setup.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoReturn EXIT_FAILURE if unknown command was given
Stefan Berger [Tue, 3 Jan 2017 00:44:33 +0000 (19:44 -0500)]
Return EXIT_FAILURE if unknown command was given

Return EXIT_FAILURE to the caller if an unknown command was given.

Signed-off-by: Stefan Berger <stefan@linux.vnet.ibm.com>
7 years agoEnable building on cygwin
Stefan Berger [Mon, 2 Jan 2017 23:50:47 +0000 (18:50 -0500)]
Enable building on cygwin

Enable building the swtpm on cygwin.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoSkip swtpm_setup build if NVRAM tools are not available
Stefan Berger [Mon, 2 Jan 2017 23:36:53 +0000 (18:36 -0500)]
Skip swtpm_setup build if NVRAM tools are not available

When NVRAM tools are not available we skip building swtpm_setup.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoAdd configure option --with-cuse to enable building without CUSE
Stefan Berger [Mon, 2 Jan 2017 23:32:48 +0000 (18:32 -0500)]
Add configure option --with-cuse to enable building without CUSE

Enable building without CUSE interface using --without-cuse.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agoReplace the CLA with the DCO, simply requiring a Signed-off-by:
Stefan Berger [Wed, 21 Dec 2016 16:11:48 +0000 (11:11 -0500)]
Replace the CLA with the DCO, simply requiring a Signed-off-by:

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
7 years agobuild: search for nonstandard libtpms locations using LIBRARY_PATH
Stefan Berger [Tue, 6 Dec 2016 20:45:51 +0000 (15:45 -0500)]
build: search for nonstandard libtpms locations using LIBRARY_PATH

Allow setting the LIBRARY_PATH variable when running configure so
that we can find libtpms in non-standard locations.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: fix Debian packaging if swtpm_cert is missing
Stefan Berger [Tue, 27 Sep 2016 21:26:03 +0000 (17:26 -0400)]
build: fix Debian packaging if swtpm_cert is missing

Fix the Debian packaging if swtpm_cert is missing. We convert
swtpm-tools.install into an executable shell script that displays
all files to package.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agobuild: Package swtpm_ioctls.3 in swtpm-dev package
Stefan Berger [Tue, 27 Sep 2016 21:24:11 +0000 (17:24 -0400)]
build: Package swtpm_ioctls.3 in swtpm-dev package

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoMerge pull request #10 from nicholasbishop/patch-1
Stefan Berger [Sun, 17 Jul 2016 23:04:29 +0000 (19:04 -0400)]
Merge pull request #10 from nicholasbishop/patch-1

Fix two typos in the README

8 years agoFix two typos in the README
Nicholas Bishop [Tue, 12 Jul 2016 17:37:23 +0000 (13:37 -0400)]
Fix two typos in the README

8 years agorpm: kernel-modules-extra only required on Fedora
Stefan Berger [Mon, 27 Jun 2016 11:02:24 +0000 (07:02 -0400)]
rpm: kernel-modules-extra only required on Fedora

The kernel-moudles-extra packages is only required on Fedora.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoAllow choice of crypto subsystem via rpmbuild parameter
Stefan Berger [Mon, 27 Jun 2016 10:38:39 +0000 (06:38 -0400)]
Allow choice of crypto subsystem via rpmbuild parameter

Use 'rpmbuild -ba --define "crypto_subsystem openssl" dist/swtpm.spec'
to build swtpm with openssl.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_setup: support --tpmstate as alias for --tpm-state
Stefan Berger [Mon, 27 Jun 2016 00:26:50 +0000 (20:26 -0400)]
swtpm_setup: support --tpmstate as alias for --tpm-state

Support --tpm-state option as an alias for the --tpmstate option.
--tpm-state is a parameter that is also supported by the swtpm
program, so for consistency reasons we should have the same name
for the option here.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: Add missing option descriptions to usage page
Stefan Berger [Mon, 27 Jun 2016 00:14:48 +0000 (20:14 -0400)]
swtpm_ioctl: Add missing option descriptions to usage page

Add missing --unix and tcp option descriptions to the usage page.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Fix typo in usage page
Stefan Berger [Mon, 27 Jun 2016 00:13:57 +0000 (20:13 -0400)]
swtpm_bios: Fix typo in usage page

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoAdding RHEL/Centos status info
Stefan Berger [Mon, 27 Jun 2016 00:03:43 +0000 (20:03 -0400)]
Adding RHEL/Centos status info

8 years agotests: Use a function to wait for pid file to appear
Stefan Berger [Sun, 26 Jun 2016 17:57:10 +0000 (13:57 -0400)]
tests: Use a function to wait for pid file to appear

Introduce wait_for_file function to wait for a file for a max. amount of
time and have that function poll for the file to appear.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: Add support for UnixIO and TCP control channel
Stefan Berger [Wed, 20 Apr 2016 14:45:12 +0000 (10:45 -0400)]
swtpm_ioctl: Add support for UnixIO and TCP control channel

Add support for UnixIO and TCP control channels. Both types of
transport require that packets are sent in big endian format
and therefore some code needs to be adjusted for that. The
ioctl interface is local and in that case no endianess conversion
is done.

Add a new test case that uses the extended swtpm_ioctl tool to
test the control channel.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Fix typo in command name
Stefan Berger [Wed, 20 Apr 2016 20:45:20 +0000 (16:45 -0400)]
swtpm: Fix typo in command name

Fix a typo in two command names so that they are similar to
the command name spelling used for the ioctl's.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: replace return codes in main()
Stefan Berger [Wed, 20 Apr 2016 14:48:24 +0000 (10:48 -0400)]
swtpm_ioctl: replace return codes in main()

Replace the return codes in main with EXIT_SUCCESS and EXIT_FAILURE.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: add --tpm-device command line option
Stefan Berger [Tue, 19 Apr 2016 19:10:01 +0000 (15:10 -0400)]
swtpm_ioctl: add --tpm-device command line option

Add support for providing the TPM device via command line option
--tpm-device <device>.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_ioctl: switch to using getopt_long for option parsing
Stefan Berger [Tue, 19 Apr 2016 18:21:32 +0000 (14:21 -0400)]
swtpm_ioctl: switch to using getopt_long for option parsing

Rather than parsing the option on our own use getopt_long() now.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Add support for UnixIO socket
Stefan Berger [Mon, 18 Apr 2016 21:21:17 +0000 (17:21 -0400)]
swtpm_bios: Add support for UnixIO socket

Add support for UnixIO socker using --unixio command line
option.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Add support for commands over UnixIO socket
Stefan Berger [Mon, 18 Apr 2016 21:15:05 +0000 (17:15 -0400)]
swtpm: Add support for commands over UnixIO socket

Add support for receiving TPM commands over UnixIO socket.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Add option parameter --tcp to connect to TCP socket
Stefan Berger [Mon, 18 Apr 2016 19:43:05 +0000 (15:43 -0400)]
swtpm_bios: Add option parameter --tcp to connect to TCP socket

Add support for connecting to a TCP socket where a TPM is listening
for commands.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: Add empty option as last one in the list.
Stefan Berger [Mon, 18 Apr 2016 19:44:44 +0000 (15:44 -0400)]
swtpm_bios: Add empty option as last one in the list.

Add an empty option as the last one in the list.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agotests: source script relative to directory
Stefan Berger [Fri, 15 Apr 2016 23:39:17 +0000 (19:39 -0400)]
tests: source script relative to directory

'source' tests_cuse relative to the tests directory

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: redirect error output to stderr
Stefan Berger [Fri, 15 Apr 2016 23:27:37 +0000 (19:27 -0400)]
swtpm_bios: redirect error output to stderr

Redirect all error output to stderr.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: add --tpm-device command line option
Stefan Berger [Fri, 15 Apr 2016 23:20:08 +0000 (19:20 -0400)]
swtpm_bios: add --tpm-device command line option

Add support for providing the TPM device via command line option
--tpm-device <device>.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm_bios: switch to using getopt_long for option parsing
Stefan Berger [Fri, 15 Apr 2016 22:18:56 +0000 (18:18 -0400)]
swtpm_bios: switch to using getopt_long for option parsing

Rather than parsing the option on our own use getopt_long()
now.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoFix the size of the receive buffer
Stefan Berger [Thu, 14 Apr 2016 18:25:06 +0000 (14:25 -0400)]
Fix the size of the receive buffer

Fix the size of the receive buffer input.body to match the largest
buffer any type of command has.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoSearch for certtool when checking for gnutls
Stefan Berger [Thu, 14 Apr 2016 18:00:09 +0000 (14:00 -0400)]
Search for certtool when checking for gnutls

Search for certtol when checking for gnutls. It is require if --with-gnutls
is selected since some of the test related scripts will use it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Add support for setting the locality on the TPM
Stefan Berger [Sat, 26 Mar 2016 17:27:03 +0000 (13:27 -0400)]
swtpm: Add support for setting the locality on the TPM

Implement the CMD_SET_LOCALITY command.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Add support for sending state blobs to the TPM
Stefan Berger [Fri, 25 Mar 2016 18:04:38 +0000 (14:04 -0400)]
swtpm: Add support for sending state blobs to the TPM

Implement the CMD_SET_STATE_BLOB command.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Add support for getting state blobs from the TPM
Stefan Berger [Fri, 25 Mar 2016 17:16:30 +0000 (13:16 -0400)]
swtpm: Add support for getting state blobs from the TPM

Add support for CMD_GET_STATE_BLOB to get the current state of
the TPM.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: move function to convert blobtype to name to tpmlib.c
Stefan Berger [Fri, 25 Mar 2016 14:30:56 +0000 (10:30 -0400)]
swtpm: move function to convert blobtype to name to tpmlib.c

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Check for bad input packets sizes
Stefan Berger [Fri, 25 Mar 2016 12:08:09 +0000 (08:08 -0400)]
swtpm: Check for bad input packets sizes

Check all commands for bad input packet sizes.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Implement resetting the establishment bit with a command
Stefan Berger [Fri, 25 Mar 2016 01:57:43 +0000 (21:57 -0400)]
swtpm: Implement resetting the establishment bit with a command

Implement the resetting of the establishment bit with a command

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: deactivate reset establishment
Stefan Berger [Thu, 24 Mar 2016 18:33:53 +0000 (14:33 -0400)]
swtpm: deactivate reset establishment

Deactivate the code around resetting the TPM established bit
since its implementation currently requires libtpms 0.6.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Implement two more control channel commands.
Stefan Berger [Thu, 24 Mar 2016 13:33:47 +0000 (09:33 -0400)]
swtpm: Implement two more control channel commands.

Implement two more control channel commands:
- CMD_STORE_VOLATILE
- CMD_HASH_DATA

Implement test cases.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Further implement the control channel for socket and chardev
Stefan Berger [Mon, 21 Mar 2016 15:18:21 +0000 (11:18 -0400)]
swtpm: Further implement the control channel for socket and chardev

Further implement the control channel for the socket and chardev
interface swtpms.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoMake TCP socket port reusable
Stefan Berger [Mon, 21 Mar 2016 16:58:06 +0000 (12:58 -0400)]
Make TCP socket port reusable

Set the SO_REUSEADDR socket option.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Fix parsing of the options
Stefan Berger [Mon, 21 Mar 2016 16:43:18 +0000 (12:43 -0400)]
swtpm: Fix parsing of the options

Fix the parsing of the command line options.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Fix application of flag mask
Stefan Berger [Mon, 21 Mar 2016 16:41:24 +0000 (12:41 -0400)]
swtpm: Fix application of flag mask

Fix the application of the flag mask.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Listen for TCP connections
Stefan Berger [Mon, 21 Mar 2016 15:29:51 +0000 (11:29 -0400)]
swtpm: Listen for TCP connections

Fix a problem with the socket TPM not listening for TCP connections.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Rename --connect to --server
Stefan Berger [Sun, 20 Mar 2016 18:43:54 +0000 (14:43 -0400)]
swtpm: Rename --connect to --server

Rename the --connect option to --server.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
8 years agoswtpm: Extend TCP server parameters with bind address
Stefan Berger [Sun, 20 Mar 2016 18:36:19 +0000 (14:36 -0400)]
swtpm: Extend TCP server parameters with bind address

Extend TCP server parameters with an IPv4/IPv6 bind address
parameter.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
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>