Add a missing '\' to the list of pod files and reduce the EXTRA_DIST
files list to only those that available via git and not generated.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
The test test_tpm2_save_load_state seems to have been forgotten
about and was not run. Add it now to the the tests to run.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Currently multiple spaces are used when a single one would do,
which will still achieve the same result but is not quite as
aesthetically pleasing :)
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This will result in -D_FORTIFY_SOURCE=2 actually being added to
HARDENING_CFLAGS where applicable.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Add fsync(2) before rename(2) for temp file to ensure data reaches disk
and for directory which containing state file to ensure directory entry
also reaches disk.
Signed-off-by: Eiichi Tsukata <eiichi.tsukata@nutanix.com>
Resolve autoreconf warnings:
configure.ac:602: warning: macro 'AM_CFLAGS' not found in library
configure.ac:605: warning: macro 'AM_LDFLAGS' not found in library
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
autoreconf from autoconf 2.71 emmits a lot of warnings:
```
+ autoreconf -fiv
autoreconf: export WARNINGS=
autoreconf: Entering directory '.'
autoreconf: configure.ac: not using Gettext
autoreconf: running: aclocal --force -I m4
aclocal: warning: couldn't open directory 'm4': No such file or directory
configure.ac:587: warning: macro 'AM_CFLAGS' not found in library
configure.ac:590: warning: macro 'AM_LDFLAGS' not found in library
autoreconf: configure.ac: tracing
autoreconf: running: libtoolize --copy --force
libtoolize: putting auxiliary files in '.'.
libtoolize: copying file './ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIRS, 'm4'.
libtoolize: copying file 'm4/libtool.m4'
libtoolize: copying file 'm4/ltoptions.m4'
libtoolize: copying file 'm4/ltsugar.m4'
libtoolize: copying file 'm4/ltversion.m4'
libtoolize: copying file 'm4/lt~obsolete.m4'
autoreconf: configure.ac: not using Intltool
autoreconf: configure.ac: not using Gtkdoc
autoreconf: running: aclocal --force -I m4
configure.ac:587: warning: macro 'AM_CFLAGS' not found in library
configure.ac:590: warning: macro 'AM_LDFLAGS' not found in library
autoreconf: running: /usr/bin/autoconf --force
configure.ac:29: warning: The macro `AC_CONFIG_HEADER' is obsolete.
configure.ac:29: You should run autoupdate.
./lib/autoconf/status.m4:719: AC_CONFIG_HEADER is expanded from...
configure.ac:29: the top level
configure.ac:53: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:53: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:53: the top level
configure.ac:76: warning: The macro `AC_HEADER_STDC' is obsolete.
configure.ac:76: You should run autoupdate.
./lib/autoconf/headers.m4:704: AC_HEADER_STDC is expanded from...
configure.ac:76: the top level
configure.ac:81: warning: The macro `AC_TYPE_SIGNAL' is obsolete.
configure.ac:81: You should run autoupdate.
./lib/autoconf/types.m4:776: AC_TYPE_SIGNAL is expanded from...
configure.ac:81: the top level
configure.ac:202: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:202: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:202: the top level
configure.ac:279: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:279: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:279: the top level
configure.ac:434: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:434: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:434: the top level
configure.ac:441: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:441: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:441: the top level
configure.ac:521: warning: The macro `AC_HELP_STRING' is obsolete.
configure.ac:521: You should run autoupdate.
./lib/autoconf/general.m4:204: AC_HELP_STRING is expanded from...
configure.ac:521: the top level
autoreconf: running: /usr/bin/autoheader --force
autoreconf: running: automake --add-missing --copy --force-missing
configure.ac:40: installing './compile'
configure.ac:43: installing './config.guess'
configure.ac:43: installing './config.sub'
configure.ac:41: installing './install-sh'
configure.ac:48: installing './missing'
samples/Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
autoreconf: Leaving directory '.'
```
Execute autoupdate to apply all those chenges and then cleanup that
in next commits.
Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Add a missing else branch that was forgotten about when the code was trans-
lated from python. This now also gets the test case
test_tpm2_samples_create_tpmca to work again when it is run from the command
line. This test case doesn't work as part of the test suite due to
concurreny issues with other test cases using tpm2-abrmd at the same.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Some of the code comes from libtpms, where various methods are named
"TPM_Something". The swtpm version of these methods are named
"SWTPM_Something". However, certain debug/log messages and comments were
updated accordingly to reflect that.
This is a cosmetic change that fixes that.
Signed-off-by: Felipe Franciosi <felipe@nutanix.com>
Cygwin's regex implementation doesn't seem to understand '\\s'
but needs [[:space:]] instead to properly skip over spaces.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
GnuTLS on 32-bit platforms complains about the long expiration time
of the certificates since they overflow the 32-bit time_t. Reduce
the duration to 12 years.
This system expresses time with a 32-bit time_t; that prevents dates after 2038 to be expressed by GnuTLS.
Overflow while parsing days
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This patch addresses the following gcc-11 compiler issues:
In file included from /usr/include/glib-2.0/glib.h:114,
from swtpm_setup_utils.c:14:
swtpm_setup_utils.c: In function 'get_config_value':
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'tmp' may be used uninitialized in this function [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
swtpm_setup_utils.c:36:31: note: 'tmp' was declared here
36 | g_autofree gchar *tmp;
| ^~~
swtpm.c: In function 'swtpm_start':
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'pidfile_file' may be used uninitialized in this function [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
swtpm.c:54:23: note: 'pidfile_file' was declared here
54 | g_autofree gchar *pidfile_file;
| ^~~~~~~~~~~~
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This patch addresses the following gcc-11 compiler issues:
In file included from /usr/include/glib-2.0/glib.h:114,
from ../src/utils/swtpm_utils.h:13,
from swtpm_localca_utils.c:24:
swtpm_localca_utils.c: In function 'get_config_envvars':
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'value' may be used uninitialized in this function [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
swtpm_localca_utils.c:98:37: note: 'value' was declared here
98 | g_autofree gchar *key, *value;
| ^~~~~
In file included from /usr/include/glib-2.0/glib.h:114,
from ../src/utils/swtpm_utils.h:13,
from swtpm_localca_utils.c:24:
/usr/include/glib-2.0/glib/glib-autocleanups.h:28:3: error: 'key' may be used uninitialized in this function [-Werror=maybe-uninitialized]
28 | g_free (*pp);
| ^~~~~~~~~~~~
swtpm_localca_utils.c:98:31: note: 'key' was declared here
98 | g_autofree gchar *key, *value;
| ^~~
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Having the spec file in the top-level directory of the dist
archive makes it possible to build rpms with a single,
convenient command.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Using these instead of the regular version number makes it
more complicated than necessary to perform builds, and there
doesn't seem to be any advantage in keeping them around.
After this change, the rpm building instructions contained in
the INSTALL file actually work.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
These are never going to change, so using string substitution
serves no purpose beyon mild obfuscation.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
This file is generated from swtpm.spec.in, and as such should
not be tracked in git; in fact, an entry for it exists in the
gitignore file.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
autogen.sh will automatically invoke configure passing it any
command line arguments it received, so we shouldn't instruct
the user to unnecessarily run it again immediately afterwards.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Configure generates include/swtpm/tpm_ioctl.h.gch when trying
to figure out which hardening options can be enabled.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Modify a test case and write an environment variable into the
swtpm_setup.conf config file to test that it gets resolved.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This is a 1:1 rewrite of swtpm_localca in 'C' as a final step to get
rid of the python dependency. It addresses issue #437.
Tested on: Cygwin, Fedora 33, Ubuntu Xenial & Bionic, FreeBSD,
DragonFlyBSD, OpenBSD (i386), Mac, Debian (recent), Centos-8,
CentOS (recent), Alpine (recent), OpenSUSE (recent),
Fedora 28 PPC Big Endian
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>