Commit Graph

1150 Commits

Author SHA1 Message Date
Stefan Berger
ee8b6c2d65 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>
2017-01-13 21:45:04 -05:00
Patrick Ohly
1239447c77 README: clarify status of qemu tpm patches
Makes it easier to find them and learn about the upstream status.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
2017-01-10 17:25:37 +01:00
Stefan Berger
3a8a06ad0a 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>
2017-01-03 08:22:55 -05:00
Stefan Berger
498433f7b5 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>
2017-01-03 07:18:38 -05:00
Stefan Berger
f26ec8c8c7 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>
2017-01-02 21:01:16 -05:00
Stefan Berger
9d64b92375 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>
2017-01-02 20:53:28 -05:00
Stefan Berger
6286beacd2 Enable building on cygwin
Enable building the swtpm on cygwin.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-01-02 20:53:28 -05:00
Stefan Berger
c3fdf68860 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>
2017-01-02 20:53:28 -05:00
Stefan Berger
09d1a532ba 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>
2017-01-02 18:54:30 -05:00
Stefan Berger
bc3539a7ad Replace the CLA with the DCO, simply requiring a Signed-off-by:
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-12-21 11:11:48 -05:00
Stefan Berger
4c0b273b09 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>
2016-12-06 15:46:31 -05:00
Stefan Berger
2cd10cee2f 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>
2016-09-27 17:26:08 -04:00
Stefan Berger
82693130d0 build: Package swtpm_ioctls.3 in swtpm-dev package
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-09-27 17:24:14 -04:00
Stefan Berger
f6864d75c4 Merge pull request #10 from nicholasbishop/patch-1
Fix two typos in the README
2016-07-17 19:04:29 -04:00
Nicholas Bishop
1797d09a25 Fix two typos in the README 2016-07-12 13:37:23 -04:00
Stefan Berger
5db666e8fb 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>
2016-06-27 07:02:27 -04:00
Stefan Berger
969edf6f9e 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>
2016-06-27 06:38:39 -04:00
Stefan Berger
3aa53709a1 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>
2016-06-26 20:26:53 -04:00
Stefan Berger
471d8daef2 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>
2016-06-26 20:15:01 -04:00
Stefan Berger
4c707474d5 swtpm_bios: Fix typo in usage page
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-06-26 20:14:00 -04:00
Stefan Berger
ae801f7b27 Adding RHEL/Centos status info 2016-06-26 20:03:43 -04:00
Stefan Berger
70f3e24891 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>
2016-06-26 13:57:35 -04:00
Stefan Berger
01eb4d3a3b 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>
2016-04-20 16:58:48 -04:00
Stefan Berger
aeee2dc88b 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>
2016-04-20 16:58:44 -04:00
Stefan Berger
bf2cee5c73 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>
2016-04-20 10:55:28 -04:00
Stefan Berger
37dcf15b86 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>
2016-04-20 10:46:10 -04:00
Stefan Berger
96cc5d6027 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>
2016-04-19 14:21:58 -04:00
Stefan Berger
fc4e289617 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>
2016-04-18 17:21:20 -04:00
Stefan Berger
7382352955 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>
2016-04-18 17:15:08 -04:00
Stefan Berger
ea898d5b63 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>
2016-04-18 15:46:23 -04:00
Stefan Berger
e8e4cbe52c 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>
2016-04-18 15:44:44 -04:00
Stefan Berger
85bae89bb0 tests: source script relative to directory
'source' tests_cuse relative to the tests directory

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-04-15 22:16:00 -04:00
Stefan Berger
4ec7d70fe8 swtpm_bios: redirect error output to stderr
Redirect all error output to stderr.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-04-15 21:51:55 -04:00
Stefan Berger
04b607b346 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>
2016-04-15 21:51:18 -04:00
Stefan Berger
8d69193426 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>
2016-04-15 18:20:35 -04:00
Stefan Berger
5647fe1536 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>
2016-04-14 14:25:09 -04:00
Stefan Berger
1828edeebe 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>
2016-04-14 14:00:11 -04:00
Stefan Berger
492a635e69 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>
2016-03-26 13:27:03 -04:00
Stefan Berger
6a2dd35b41 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>
2016-03-25 23:47:44 -04:00
Stefan Berger
8f387d55e6 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>
2016-03-25 23:39:24 -04:00
Stefan Berger
a7a261a7e0 swtpm: move function to convert blobtype to name to tpmlib.c
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-03-25 10:30:56 -04:00
Stefan Berger
73e0c38d8e 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>
2016-03-25 09:52:54 -04:00
Stefan Berger
3488d25f45 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>
2016-03-24 22:00:24 -04:00
Stefan Berger
b5fbddbcf1 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>
2016-03-24 14:33:58 -04:00
Stefan Berger
03e0099137 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>
2016-03-24 09:34:59 -04:00
Stefan Berger
f56a0cd2a5 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>
2016-03-21 15:25:18 -04:00
Stefan Berger
3f4b2d599e Make TCP socket port reusable
Set the SO_REUSEADDR socket option.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-03-21 12:59:24 -04:00
Stefan Berger
708a1a471e swtpm: Fix parsing of the options
Fix the parsing of the command line options.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-03-21 12:47:00 -04:00
Stefan Berger
c2d04f537b swtpm: Fix application of flag mask
Fix the application of the flag mask.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2016-03-21 12:46:56 -04:00
Stefan Berger
9195be7f87 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>
2016-03-21 11:29:54 -04:00