Skip to content

Commit

Permalink
Merge b8c5319 into ecabc01
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanberger committed Sep 18, 2020
2 parents ecabc01 + b8c5319 commit ee2edb7
Show file tree
Hide file tree
Showing 13 changed files with 834 additions and 652 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ Makefile
/include/swtpm.h
/man/man3/*.3
/man/man8/*.8
/samples/dist
/samples/py_swtpm_localca/swtpm_localca_conf.py
/samples/swtpm-create-user-config-files
/samples/swtpm-localca
/samples/swtpm-localca.conf
/src/selinux/*.pp.bz2
/src/selinux/swtpm.pp
/src/selinux/swtpm_svirt.fc
Expand Down
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ matrix:
SWTPM_TEST_IBMTSS2="1"
after_success:
- pylint3 --max-line-length=100 src/swtpm_setup/py_swtpm_setup/*.py || exit 1;
- pylint3 --max-line-length=100 samples/py_swtpm_localca/*.py || exit 1;
before_script:
- sudo apt-get -y install tss2
- sudo pip install cpp-coveralls
Expand Down Expand Up @@ -149,8 +150,6 @@ matrix:
- HOMEBREW_NO_AUTO_UPDATE=1 brew install glib
- HOMEBREW_NO_AUTO_UPDATE=1 brew install gawk
- HOMEBREW_NO_AUTO_UPDATE=1 brew install gmp
- HOMEBREW_NO_AUTO_UPDATE=1 brew tap discoteq/discoteq
- HOMEBREW_NO_AUTO_UPDATE=1 brew install flock
- HOMEBREW_NO_AUTO_UPDATE=1 brew install socat
# To run the pkcs11 test with softhsm we need SUDO (above)
- HOMEBREW_NO_AUTO_UPDATE=1 brew install softhsm
Expand Down
9 changes: 4 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ if test "x$SOCAT" = "x"; then
AC_MSG_ERROR([socat is required: socat package])
fi

AC_PATH_PROG([FLOCK], flock)
if test "x$FLOCK" = "x"; then
AC_MSG_ERROR([flock is required: flock package])
fi

AC_PATH_PROG([BASE64], base64)
if test "x$BASE64" = "x"; then
AC_MSG_ERROR([base64 is required: base64 package])
Expand Down Expand Up @@ -547,6 +542,7 @@ AC_CONFIG_FILES([Makefile \
etc/Makefile \
etc/swtpm_setup.conf \
samples/Makefile \
samples/py_swtpm_localca/swtpm_localca_conf.py \
samples/swtpm-localca.conf \
samples/swtpm-create-user-config-files \
include/Makefile \
Expand Down Expand Up @@ -575,6 +571,9 @@ AC_CONFIG_LINKS([src/swtpm_setup/py_swtpm_setup/__init__.py:src/swtpm_setup/py_s
src/swtpm_setup/py_swtpm_setup/swtpm.py:src/swtpm_setup/py_swtpm_setup/swtpm.py \
src/swtpm_setup/py_swtpm_setup/swtpm_utils.py:src/swtpm_setup/py_swtpm_setup/swtpm_utils.py \
src/swtpm_setup/py_swtpm_setup/swtpm_setup.py:src/swtpm_setup/py_swtpm_setup/swtpm_setup.py])
AC_CONFIG_LINKS([samples/py_swtpm_localca/__init__.py:samples/py_swtpm_localca/__init__.py \
samples/py_swtpm_localca/swtpm_localca.py:samples/py_swtpm_localca/swtpm_localca.py \
samples/py_swtpm_localca/swtpm_utils.py:samples/py_swtpm_localca/swtpm_utils.py])
AC_OUTPUT

echo
Expand Down
14 changes: 14 additions & 0 deletions man/man8/swtpm-localca.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ for the I<swtpm-localca> program.
Entries may contain shell variables that will be resolved. All shell
variables must be formatted like this: '${varname}'.

Users may write their own configuration into
I<${XDG_CONFIG_HOME}/swtpm-localca.conf> or if XDG_CONFIG_HOME
is not set it may be in I<${HOME}/.config/swtpm-localca.conf>.

The following configuration variables are supported:

=over 4
Expand Down Expand Up @@ -48,6 +52,16 @@ used.
This variable can be set to the port on which B<tcsd> is listening for
connections. By default port I<30003> will be used.

=item B<env:<environment variables>>

Additional environment variables that may be needed by pkcs11 modules can
be set using this format. An example for such an environment variable may
look like this:

env:MY_MODULE_PKCS11_CONFIG = /tmp/mymodule-pkcs11.conf

The line must not contain any trailing spaces.

=back

=head1 EXAMPLE
Expand Down
4 changes: 4 additions & 0 deletions man/man8/swtpm-localca.options.pod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ to pass to the I<swtpm_cert> program and should hold options
that apply to the creation of all TPM Endorsement Key (EK) and platform
certificates.

Users may write their own options into
I<${XDG_CONFIG_HOME}/swtpm-localca.options> or if XDG_CONFIG_HOME
is not set it may be in I<${HOME}/.config/swtpm-localca.options>.

=head1 EXAMPLE

An example I<swtpm-localca.options> file may look as follows:
Expand Down
6 changes: 5 additions & 1 deletion man/man8/swtpm_setup.conf.pod
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ swtpm_setup.conf - Configuration file for swtpm_setup
=head1 DESCRIPTION

The file I</etc/swtpm_setup.conf> contains configuration information for
the swtpm_setup and swtpm_setup.sh programs. It must only contain
swtpm_setup. It must only contain
one configuration keyword per line, followed by an equals sign (=) and then
followed by appropriate configuration information. A comment at the
end of the line may be introduced by a hash (#) sign.

Users may write their own configuration into
I<${XDG_CONFIG_HOME}/swtpm_setup.conf> or if XDG_CONFIG_HOME
is not set it may be in I<${HOME}/.config/swtpm_setup.conf>.

The following keywords are recognized:

=over 4
Expand Down
43 changes: 43 additions & 0 deletions samples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,57 @@ samplessysconf_DATA = \
swtpm-localca.conf \
swtpm-localca.options

PY_SWTPM_LOCALCA_FILES = $(wildcard py_swtpm_localca/*.py)

PY_PACKAGE_NAME=swtpm_localca
PY_PACKAGE_NV=$(PY_PACKAGE_NAME)-$(SWTPM_VER_MAJOR).$(SWTPM_VER_MINOR).$(SWTPM_VER_MICRO)
PY_PACKAGE=dist/$(PY_PACKAGE_NV).tar.gz

# for out-of-tree builds we need to copy setup.py
$(PY_PACKAGE): $(PY_SWTPM_LOCALCA_FILES)
@$(CP) $(srcdir)/setup.py ./ &>/dev/null || true
./setup.py sdist

all-local: $(PY_PACKAGE)

if PYTHON_INSTALLATION
install-exec-local: $(PY_PACKAGE)
@if ! test $(findstring /usr, "$(DESTDIR)$(bindir)"); then \
echo "Warning: Not installing python package to $(DESTDIR)$(bindir)"; \
else \
echo "Installing python to DESTDIR '/$(DESTDIR)'"; \
./setup.py install --prefix=$(prefix) --root "/$(DESTDIR)" --install-layout deb 2>/dev/null || \
./setup.py install --prefix=$(prefix) --root "/$(DESTDIR)" 2>/dev/null ; \
fi

uninstall-local:
@if ! test $(findstring /usr, "$(DESTDIR)$(bindir)"); then \
echo "Cleanup for distcheck build not implemented" ; \
else \
echo "Local pip3 uninstall"; \
$(PIP3) uninstall -y $(PY_PACKAGE_NAME); \
fi
endif


install-data-local:
$(MKDIR_P) $(DESTDIR)$(localstatedir)/lib/swtpm-localca
if test -z $(DESTDIR); then \
chown -R @TSS_USER@:root $(DESTDIR)$(localstatedir)/lib/swtpm-localca || true; \
chmod 0750 $(DESTDIR)$(localstatedir)/lib/swtpm-localca || true; \
fi

# for out-of-tree builds we need to clean up
clean-local:
if test "$(top_srcdir)" != "$(top_builddir)"; then \
rm -f setup.py; \
fi
rm -rf py_swtpm_localca/__pycache__/
rm -rf swtpm_localca.egg-info/
rm -rf dist

EXTRA_DIST= \
setup.py \
swtpm-create-tpmca \
swtpm-create-user-config-files \
swtpm-localca \
Expand Down
Empty file.
Loading

0 comments on commit ee2edb7

Please sign in to comment.