Commit Graph

1150 Commits

Author SHA1 Message Date
Stefan Berger
4716d35a69 swtpm: Rename --connect to --server
Rename the --connect option to --server.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-03-20 14:50:40 -04:00
Stefan Berger
16eb0ff25a 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>
2016-03-20 14:49:36 -04:00
Stefan Berger
9ddc699812 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>
2016-03-18 16:51:19 -04:00
Stefan Berger
b959335e5d 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>
2016-03-18 15:55:35 -04:00
Stefan Berger
bfa865a7a1 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>
2016-03-18 15:14:16 -04:00
Stefan Berger
320d90641e 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>
2016-03-18 14:27:09 -04:00
Stefan Berger
7c0a033f96 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>
2016-03-18 13:36:40 -04:00
Stefan Berger
45cfd52628 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>
2016-03-16 20:03:06 -04:00
Stefan Berger
81c55814dd 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>
2016-02-18 09:55:23 -05:00
Stefan Berger
f3a199859b Adding CLAs for corporate and individual contributors.
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-02-01 11:56:24 -05:00
Stefan Berger
86cc4527b4 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>
2016-01-26 12:24:52 -05:00
Stefan Berger
37c73b4ba7 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>
2016-01-25 16:26:00 -05:00
Stefan Berger
3b64478713 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>
2016-01-24 11:21:14 -05:00
Stefan Berger
ed29bd7229 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>
2016-01-24 10:07:55 -05:00
Stefan Berger
71b91c9cef 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>
2016-01-24 09:42:50 -05:00
Stefan Berger
feee88b0d8 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>
2016-01-24 09:40:44 -05:00
Stefan Berger
1e0296851f 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>
2016-01-22 07:43:59 -05:00
Stefan Berger
ffc498b4ca 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>
2016-01-13 20:07:12 -05:00
Stefan Berger
699c204323 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>
2016-01-13 16:23:08 -05:00
Stefan Berger
08f09d299e build: Fix the Debian package dependencies
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-13 12:37:41 -05:00
Stefan Berger
4536ec6de2 Revert "build: Include swtpm_cert if it was built, other fixes"
This reverts commit a0116f936a.
2016-01-13 12:35:38 -05:00
Stefan Berger
a0116f936a 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>
2016-01-13 12:24:13 -05:00
Stefan Berger
95d41f7fb0 build: add gnutls-utils as dependency
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-13 10:48:20 -05:00
Stefan Berger
4372c7feb8 tests: Display logfile upon failure
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-13 10:35:20 -05:00
Stefan Berger
dcbb1181fb 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>
2016-01-12 19:56:00 -05:00
Stefan Berger
100029339d build: fix some issues in configure.ac
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-12 19:53:31 -05:00
Stefan Berger
4a37440a4d build: Link libswtpm_libtpms with glib libs
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-01-12 19:52:29 -05:00
Stefan Berger
c9de5f0ab1 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>
2015-12-29 04:30:27 -05:00
Stefan Berger
c3c7e8f364 swtpm_bios: Introduce durations to wait for command completions
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-29 04:25:42 -05:00
Stefan Berger
abac744529 swtpm_bios: use select for waiting for response
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-28 20:35:29 -05:00
Stefan Berger
1c1efe2dab swtpm: move threadpool code out of cuse-tpm
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-28 16:13:53 -05:00
Stefan Berger
28a18c29b3 swtpm_setup: improve error handling
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-28 16:10:10 -05:00
Stefan Berger
b7a4c100fb samples: improve error handling
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-28 15:58:15 -05:00
Stefan Berger
bb420d7481 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>
2015-12-27 18:17:49 -05:00
Stefan Berger
e11a75527e 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>
2015-12-21 03:26:46 -05:00
Stefan Berger
804e74728e 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>
2015-12-20 20:55:15 -05:00
Stefan Berger
0cfbcb3d82 Update TODO list
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-20 20:07:55 -05:00
Stefan Berger
78c5f924bf 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>
2015-12-20 20:06:57 -05:00
Stefan Berger
ddf99d057a 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>
2015-12-20 13:17:08 -05:00
Stefan Berger
cf56d345bd 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>
2015-12-13 21:58:38 -05:00
Stefan Berger
12837911ce 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>
2015-12-13 21:49:49 -05:00
Stefan Berger
96038cdfec tests: move modprobe cuse into common file
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-13 21:23:12 -05:00
Stefan Berger
86b6ffca75 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>
2015-12-07 17:25:17 -05:00
Stefan Berger
2b4c6da540 swtpm: add missing dirent.h include
On PowerKVM dirent.h needs to be included.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-07 17:24:43 -05:00
Stefan Berger
db33da6b78 build: fix build of rpm
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-07 17:24:23 -05:00
Stefan Berger
5f1ef9565d 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>
2015-12-07 15:01:57 -05:00
Stefan Berger
57d542a01c 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>
2015-12-07 14:57:54 -05:00
Stefan Berger
82cf754a79 swtpm: Implement ptm_init_done function
Implement the ptm_init_done function

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-12-07 14:57:54 -05:00
Stefan Berger
6a102bc764 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>
2015-12-07 14:57:54 -05:00
Stefan Berger
6e0dc3ddd5 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>
2015-12-07 14:57:54 -05:00