Commit Graph

123 Commits

Author SHA1 Message Date
Stefan Berger
a63fe71ad5 build-sys: Check for flock tool
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-26 18:53:30 -04:00
Stefan Berger
a12b09b1ea samples: Implement script to create user config files and extend man page
Implement a script that creates the user config files in the
${XDG_CONFIG_HOME} directory and sub-directories.

Extend swtpm_setup.pod showing swtpm-create-user-config-files usage.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-20 09:49:33 -04:00
Stefan Berger
217c29cb07 Revert "samples: Implement script to create user config files"
This reverts commit d09484c02d.
2020-08-20 09:49:33 -04:00
Stefan Berger
d09484c02d samples: Implement script to create user config files
Implement a script that creates the user config files in the
${XDG_CONFIG_HOME} directory and sub-directories.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-19 14:39:31 -04:00
Stefan Berger
040c7097e0 build-sys: Have configure display swtpm version being built
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-18 16:21:32 -04:00
Jonas Witschel
609dfd873a build-sys: fix test for netstat if tcsd is not available
A typo in the condition meant that netstat was always required regardless of
whether tcsd is available or not.

Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
2020-07-28 10:30:23 -04:00
Stefan Berger
aa88eebe32 build-sys: Check whether tss user and group are available
If the tcsd (trousers) is available, TPM 1.2 support should work as well.
Typically the tss user and group should be defined at this point, but
this may not always be the case, so make sure that this user and group
are available on the system.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-24 10:50:08 -04:00
Stefan Berger
3b33116d97 build-sys: Error out if libtpms.pc cannot be found and request PKG_CONFIG_PATH be set
Error out if libtpms.pc cannot be found for pkg-config. This now requires that an
in-place libtpms be accessed like this:

PKG_CONFIG_PATH=/home/stefanb/libtpms/ \
	LIBTPMS_CFLAGS=-I/home/stefanb/libtpms/include/ \
	LIBTPMS_LDFLAGS=-L/home/stefanb/libtpms/src/.libs/ \
	./configure --prefix=/usr

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-24 08:33:05 -04:00
Stefan Berger
0371b63bec build-sys: Explicitly link libswtpm_libtpms with -lcrypto (Gentoo)
This patch fixes the following linker issue reported for Gentoo in
issue #280.

ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to EVP_sha512
ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to PKCS5_PBKDF2_HMAC
ld.lld: error: /var/tmp/portage/app-crypt/swtpm-0.3.1-r1/work/swtpm-0.3.1/src/swtpm/.libs/libswtpm_libtpms.so: undefined reference to SHA512

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-21 20:52:34 -04:00
Stefan Berger
b381e1eb29 build-sys: Use AC_COMPILE_IFELSE to check for unused linker flags (clang)
This patch fixes a clang issue report in issue #280.

clang does not use ld, so we cannot grep for support of certain linker
flags but have to test-compile.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-21 20:52:34 -04:00
Stefan Berger
13cb26d846 build-sys: Enable automake silent rules
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-06-18 14:05:03 -04:00
James Bottomley
b4374c3392 build-sys: Let swtpm build with in-place libtpms
Building things like this in-place is really useful when you can't be
bothered to package and install them for your distribution but still
want to use them.  This patch allows building swtpm with libtpms in
place.  Simply specify the location to LDFLAGS and CFLAGS on the
configure line

LIBTPMS_CFLAGS=-I/home/jejb/git/libtpms/include/ LIBTPMS_LDFLAGS=-L/home/jejb/git/libtpms/src/.libs/ ./configure

It will then build a version that can run in-place.

I also think it corrects a bug in the original in that if pkg-config
had specified a non standard library location, the version check
wouldn't have used it.

Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-05-12 13:50:37 -04:00
Stefan Berger
3e3d2c82dd build-sys: Bump up version to 0.4.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-07 11:16:49 -04:00
Stefan Berger
2e187bc299 build-sys: Set version to 0.3.0 for next release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-02-17 12:11:31 -05:00
Stefan Berger
0232f78f0d build-sys: Display check result for build with libseccomp
Display the check result of 'yes' or 'no' for whether we build
with libseccomp.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-01-14 20:26:36 -05:00
Stefan Berger
5d35321e20 build-sys: Avoid prefix=NONE if no prefix is passed to configure
If no prefix is passed to the configure line we get prefix=NONE
in evaluations of variables that depend on prefix at this point.
If the user provides no --prefix we assume /usr/local as the
default and override the 'NONE' value we have at this point.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-21 16:53:49 -04:00
Stefan Berger
761df6cd63 build-sys: Add libbsecomp to configure.ac
Implement support for --with-seccomp and --without-seccomp for Linux
systems with --with-seccomp being the default. On all other systems
--without-seccomp is the implicit default.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-03-18 15:43:44 -04:00
Stefan Berger
f1a8a1cb51 Set version to 0.2.0 for next release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-02-26 08:33:24 -05:00
Stefan Berger
44b92d43cd debian: Add post install script for swtpm-tools
Add a post install script for swtpm-tools that creates
the /var/lib/swtpm-localca directory and changes ownersip
on it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-28 17:03:26 -05:00
Stefan Berger
d16b86b7b0 build-sys: Adjust localstatedir and files using it
Adjust the localstatedir variable to not have ${prefix} if
prefix is '/usr/', otherwise use ${prefix}.

Also adjust the files that were pointing to directories that
are controlled by $localstatedir.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-17 11:28:40 -05:00
Stefan Berger
0432b6535c build-sys: Fix hard coded /etc path and replace with @SYSCONFDIR@
When the project is configured with --prefix=/usr/local several configuration
files are installed to /usr/local/etc but not read by the programs that
need them. This patch fixes this issue by replacing @SYSCONFDIR@ in the source
code of those files with the actual used path.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-17 11:28:40 -05:00
Stefan Berger
ef606d4a65 build-sys: If TPM 1.2 NVRAM area tools are missing print out a warning
Allow to build without the TPM 1.2 NVRAM area tools but print out a warning
that they are needed for TPM 1.2 certificate injection.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-12-15 10:06:03 -05:00
Stefan Berger
b78b6af2f8 build-sys: Set action-if-found in AC_CHECK_LIB where missing
Prevent the LIBS variable from collecting all kinds of libraries
by setting the action-if-found parameter in AC_CHECK_LIB. This
avoid linking of executables with unnecessary libraries.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-11-17 16:37:03 -05:00
Stefan Berger
b8421f3de4 build-sys: Support --enable-test-coverage as an option
Support --enable-test-coverage as an option for compiling with
coverage instrumentation.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-25 12:30:21 -04:00
Stefan Berger
5eeea3570b build-sys: Support --disable-hardening as an option
By default the hardening compiler flags are enabled and
--disable-hardening disables them.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-25 10:32:36 -04:00
Stefan Berger
5478de0a0d build-sys: Link with -lrt if libc does not have clock_gettime()
On older system libc does not provide clock_gettime() so we need
to link with -lrt.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-10-05 22:20:49 -04:00
Stefan Berger
1389bafe3f build-sys: Pass header file to compiler for checking for supported flag
Older versions of gcc need some input file to compile so that
we learn whether -fstack-protector-strong is supported.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-10-05 22:20:49 -04:00
Stefan Berger
ebf1557dde build-sys: Move glib-2.0 dependency to CUSE TPM build
Only when the CUSE TPM is built we need the glib-2.0 dependency
(which can be removed at some point probably).

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-10-02 10:19:31 -04:00
Stefan Berger
b4372fe50f tests: Use python3 rather than python for the test programs
Fedora policy seems to be to use python3 explicitly for the hashbang
rather than python, which could be either python2 or python3. So convert
it to python3. Also adapt configure.ac to require python3 executable.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-25 08:35:45 -04:00
Stefan Berger
908afaf5f8 build-sys: Replace AC_PROG_LIBTOOL with LT_INIT
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-25 08:35:45 -04:00
Stefan Berger
518a042cf7 build-sys: Use X="$X ..." rather than X+="..." in configure.ac
Some configure interpreters do not like X+='...' but need
X="$X ..." instead.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-29 17:44:21 +00:00
Stefan Berger
33be7be2a0 Replace tests with '==' through '='
On NetBSD configure.ac cannot have '==' in tests. So we have to replace
them with '='.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-29 12:59:29 +00:00
Stefan Berger
b096be2603 build-sys: explicitly adapt sysconfdir and datarootdir follow $prefix
When using --prefix=/usr never install into /etc/usr.
When using --prefix=/ never install into //share/.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-26 16:03:53 -04:00
Stefan Berger
571a8eed77 build-sys: Add GNUTLS_C/LDFLAGS to CFLAGS when checking for gnutls
On OpenBSD the gnutls library is in /usr/local/lib and AC_CHECK_LIB does
find it there without explicitly adding GNUTLS_CFLAGS and GNUTLS_LDFLAGS to
CFLAGS.

Also add the GNUTLS_CFLAGS to CFLAGS at the end.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-26 16:03:53 -04:00
Stefan Berger
f2458ef7d6 build-sys: Replace PKG_CHECK_VAR with direct call to $PKG_CONFIG
Older distros may not have PKG_CHECK_VAR due to usage of pkg-config
older than v0.28. So, replace the call to PKG_CHECK_VAR with a direct
call to $PKG_CONFIG. Also use PKG_PROG_PKG_CONFIG to determine the
location of pkg-config.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-24 17:08:05 -04:00
Stefan Berger
64faf455fb build-sys: Build swtpm_setup on all supported platforms
Introduce compile-time variable HAVE_TCSD if the TCSD could
be found. It influences whether TPM 1.2 related swtpm_setup
test cases can be run. If it is set, they can be run.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
dbb399de05 build-sys: Make sure python is installed for test cases
Some test cases need either python 2 or 3. Make sure it is installed.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
5cd844d09e build-sys: require netstat to be available if swtpm_setup can be built
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Marc-André Lureau
7318ae5125 build-sys: use pkg-config variable to check libtpms cryptolib
We also have to move the Travis tests to xenail since PKG_CHECK_VAR
was not available in trusty (14.04).

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:47 -04:00
Stefan Berger
fbc596abbb swtpm: Provide support for TPM2 using --tpm2
Implement support for TPM2. Some of the capabilities are not supported yet in
this patch.

Extend the man pages with description for --tpm2.

Missing: configure should probe for needed API calls in libtpms

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-08-07 12:19:46 -04:00
Stefan Berger
7849b6c67f build: Remove FreeBL support since libtpms does not support it
Remove FreeBL support for swtpm since there will not be support
for FreeBL with TPM 2 in libtpms.

Since a lot of documentation shows --with-openssl, we leave that for
now.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-06-15 09:08:24 -04:00
Stefan Berger
06b8d0327b build: fix linker SEARCH_DIR extraction for OpenBSD and Cygwin
Signed-off-by: Stefan Berger <stefanb@linx.vnet.ibm.com>
2017-10-12 13:07:46 -04:00
Stefan Berger
f071d82071 build: test for linux-* rather than linux-gnu
Check for linux-* when testing $host_os so we properly detect
when to set WITH_VTPM_PROXY.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2017-05-31 17:45:54 -04:00
Stefan Berger
c751e32ec7 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>
2017-01-15 08:55:07 -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
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
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
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
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
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
a1fa5d77e2 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>
2015-12-03 19:31:10 -05:00
Stefan Berger
8cb126e4c3 build: check for socat tool
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-30 15:35:32 -05:00
Stefan Berger
58774fd617 build: move chmod into AC_CONFIG_FILES
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-11-29 18:59:16 -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
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
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
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
3cb54a5d35 build: install /var/lib/swtpm-localca with proper owner
Install /var/lib/swtpm-localca so that tss can access it.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-05-04 00:31:44 -04:00
Stefan Berger
48abfbb1c0 Expect tool is required
Check for the expect tool in configure.
Require the expect tool in the spec file.
2015-04-01 22:39:17 -04:00
Stefan Berger
e6085e9615 Add some hardening flags to compiler and linker
Protect the stack, create position indep. executables, use Relocation
Read-Only (RELRO) and have the linker resolve all symbols upon
program start.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2015-01-30 17:08:40 -05:00
Stefan Berger
213677a217 Fix cut and paste error
Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-22 15:54:01 -05:00
Stefan Berger
ec37bb56cb Make SELinux policy extension support chooseable
Extend configure.ac to make SELinux policy extension support
chooseable. By default configure will check whether SELinux
support is installed on the local system and will add SELinux
policy extension support if support is found.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-19 09:28:47 -05:00
Stefan Berger
3bbdd7bc76 Support for openssl
Also support swtpm using OpenSSL library. 
Introduce --with-openssl in configure.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-18 22:19:57 -05:00
Stefan Berger
833a54165e Check for missing freebl headers and freebl lib
Add a check for missing freebl header blapi.h (missing in Ubuntu)
and missing freebl static library that provides AES_CreateContext.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2014-12-18 11:04:22 -05:00
Stefan Berger
09c58b7003 Make compileable on RHEL 7 for ppc64
There are some tiny adjustments needed for linking on RHEL 7 for ppc64.
Otherwise it works there now as well.
2014-12-09 20:10:00 -05:00
Stefan Berger
baecda4040 Link programs with minimal set of libraries
Don't build up a global LIBS variable but put the libraries into
individual variables that can be used for linking individual programs
with. Do the same for CFLAGS.
2014-12-09 19:59:27 -05:00
Stefan Berger
095168973d Improve on the list of dependencies.
Update the list of rpm dependencies referred to in INSTALL and
configure.ac and the spec file.
2014-12-09 13:42:17 -05:00
Stefan Berger
e46a2b6686 merging swtpm-tools into this project 2014-12-05 13:43:21 -05:00
Stefan Berger
f163b20210 initial check-in 2014-12-05 11:16:03 -05:00