Commit Graph

62 Commits

Author SHA1 Message Date
Stefan Berger
76b58d7e09 debian/rpm: Adjust changelog for 0.9.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-06-17 09:03:06 -04:00
Stefan Berger
3d620d0dd5 debian: Sync AppArmor profile with what is used by Ubuntu
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-06-11 11:03:03 -04:00
Stefan Berger
605e0ce880 build-sys/rpm/debian: Add gmp library and devel package as dependency
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2023-08-22 21:21:03 -04:00
Lena Voytek
f732f489c2 debian: Allow apparmor access to qemu session bus swtpm files
When running a VM connected to qemu:///session, swtpm needs access to its own
process id and socket files in /run/user/<UID>/libvirt/qemu/run/swtpm/. Add
permissions to access them in the apparmor profile.

Signed-off-by: Lena Voytek <lena.voytek@canonical.com>
2023-08-10 20:03:06 -04:00
Stefan Berger
6709a4ee54 build-sys: Bump up version to 0.9.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-11-11 11:58:11 -05:00
Stefan Berger
2ae7b01937 debian/rpm: Adjust changelog for 0.8.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-11-10 12:24:08 -05:00
Stefan Berger
34886d2841 debian: Do not remove swtpm_cuse.8 via clean file
swtpm_cuse.8 is not generated anymore but its a static file now
that must not be removed anymore via the debian/clean file.

Resolves: https://github.com/stefanberger/swtpm/issues/751
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2022-09-19 10:00:46 -04:00
Lena Voytek
3d2747a1be debian: Add swtpm apparmor profile
An apparmor profile was added for Debian-based distributions in order to
increase security. This blocks swtpm from accessing restricted and unnecessary
files, folders, and network interfaces. swtpm works as normal alongside libvirt
and its configurations, however users may run into issues when using swtpm on
its own when providing it with a restricted directory. The apparmor profile can
be modified to include additional permissions by creating and adding to the
file /etc/apparmor.d/local/usr.bin.swtpm.

Signed-off-by: Lena Voytek <lena.voytek@canonical.com>
2022-05-05 20:58:30 -04:00
Seunghun Han
33aa135545 Move *.conf and *.options to man5
According to the man page sections guideline, man8 should be used
for system administration commands. So this commit moves *.conf and
*.options files to man5.

Signed-off-by: Seunghun Han <kkamagui@gmail.com>
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-22 18:30:17 -05:00
Stefan Berger
3115dff02f build-sys: Bump up version to 0.8.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-20 12:02:11 -05:00
Stefan Berger
b79fd91c4b debian/rpm: Adjust changelog for 0.7.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-11-09 10:49:45 -05:00
Stefan Berger
9e21a3fec2 rpm/debian: Clean up packaging files
- Remove unused python3-twisted and gmp-devel.
- Add back rule to package /man8/swtpm_localca.8*

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-10-18 10:39:27 -04:00
Thomas Lamprecht
f2786a759f d/swtpm-tools postinst: create the TSS user if it does not exist
Adapted from tpm-udev [0] which handles that, but it is not really a
hard-requirement for swtpm and TSS_USER is configurable after all
(even if that is mostly used for the test system).

So, create that user and group if it does not exists to avoid errors
and failing installation.

[0]: https://salsa.debian.org/debian/tpm-udev/-/blob/master/debian/tpm-udev.postinst

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-07 12:47:08 -04:00
Thomas Lamprecht
7d0f8e1c81 d/swtpm-tools postinst: avoid trying to create/chown in non-configure steps
configure steps should be limited to get only executed on, well
configuration, so check for that and do nothing in the remaining
commands [0] the postinst can be called with.

[0]: https://www.debian.org/doc/debian-policy/ch-maintainerscripts.html#summary-of-ways-maintainer-scripts-are-called

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-07 12:47:08 -04:00
Thomas Lamprecht
088a8ca44b debian: downgrade trousers package dependency to recommended
Currently `trousers` is listed as (hard) Dependency, but it does not
seems to be required for quite a few usecases, e.g., ours where we
mainly using swtpm for providing a tpm to VMs.

With trousers in Debian one gets an additional pain point: it comes
with rather dated and in some cirumstances failing by mistake init
script [0] that can throw errors when setting up during installation
and thus fail the whole installation of swtpm as Debian policy for
`Depends` hits:

> A package will not be configured unless all of the packages listed
> in its Depends field have been correctly configured
-- [1]

Declaring dependencies for things are not a hard requirement means
that a user will be required to install more dependencies than
actually needed.

Just documenting that as fact why I investigated in the
hard-requirement on trousers in the first place, not an actual
justification - it's a packaging bug after all.

So downgrade the dependency to "Suggests", as it seems a reasonable
level when checking its documented meaning:

> This is used to declare that one package may be more useful with
> one or more others. Using this field tells the packaging system and
> the user that the listed packages are related to this one and can
> perhaps enhance its usefulness, but that installing this one without
> them is perfectly reasonable.
-- [1]

[0]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=895201
[1]: https://www.debian.org/doc/debian-policy/ch-relationships.html

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-07 09:38:43 -04:00
Nick Chevsky
3d5ae5e1d6 Change swtpm-localca to swtpm_localca in manpages
- Move content of swtpm-localca(8) manual page to swtpm_localca(8)
  and make swtpm-localca(8) an alias for swtpm_localca(8), mirroring
  the fact that /usr/bin/swtpm_localca is the actual program and
  /usr/share/swtpm/swtpm-localca a wrapper for it.
- Change references to `swtpm-localca` in manual pages' content to
  `swtpm_localca`, reflecting the actual name of the program they are
  meant to document.

Signed-off-by: Nick Chevsky <nchevsky@users.noreply.github.com>
2021-07-27 20:05:41 -04:00
Nick Chevsky
4eb47cb0ca Debian packaging improvements
- debian/clean: Add files that were not being automatically cleaned
  up by dh(1)'s `clean` target.
- debian/control:
  - Add new recommended/required fields and bump Standards-Version.
  - Remove redundant build dependencies that are implied transitively.
  - Bump debhelper dependency version to match debian/compat.
  - Move swtpm-libs's ${misc:Pre-Depends} dependency to `Pre-Depends`.
    Resolves `depends-on-misc-pre-depends` Lintian warning.
  - Sort packages and dependency lists alphabetically as per
    wrap-and-sort(1).
- debian/not-installed: List deliberately non-installed files to
  avoid dh_missing(1) warnings.
- debian/rules:
  - Pass --no-scripts to dh_makeshlibs(1) in order to keep a
    ldconfig(8) trigger from being implicitly added, which for
    this package was redundant and triggered Lintian warning
    `package-has-unnecessary-activation-of-ldconfig-trigger`.
  - Remove redundant --parallel dh flag.
  - Remove redundant dh_usrlocal override.
- debian/*.install:
  - Add swtpm-create-tpmca(8) and its manpage, which were missing.
  - Remove redundant `#! /usr/bin/dh-exec` lines.
  - Sort entries alphabetically as per wrap-and-sort(1).
- debian/swtpm-tools.postinst.in: Add `set -e` to fail in case of
  error. Fixes `maintainer-script-ignores-errors` Lintian warning.

Signed-off-by: Nick Chevsky <nchevsky@users.noreply.github.com>
2021-07-26 17:22:41 -04:00
Nick Chevsky
bb6d019a2e Remove obsolete manpage for swtpm_setup.sh(8)
swtpm_setup.sh was replaced by swtpm_setup in v0.5.0.

Signed-off-by: Nick Chevsky <nchevsky@users.noreply.github.com>
2021-07-21 16:05:54 -04:00
Stefan Berger
fd00c5ff87 samples: Replace swtpm_localca with script calling swtpm-localca (issue #482)
Replace the binary swtpm_localca with a script that now calls the binary
swtpm-localca, which is to be installed in $bindir.

So that we can use this for script for calling swtpm-localca during testing
(when it is not installed), write the script in such a way that it de-
termines whether there's swtpm-localca in the same directory and if not call
it from ${bindir}/swtpm-localca.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-07-16 16:03:14 -04:00
Stefan Berger
ec49cac756 build-sys: Bump up version to 0.7.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-11 07:53:28 -04:00
Stefan Berger
ea627b3b5e debian/rpm: Adjust changelog for 0.6.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-04 16:04:09 -04:00
Stefan Berger
8658bdf102 debian/rpm: Remove left-over python files that do not exist anymore
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-06-04 16:04:09 -04:00
Stefan Berger
e689684c57 samples: Rewrite of swtpm_localca in 'C' (addresses issue #437)
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>
2021-06-01 09:31:43 -04:00
Stefan Berger
c125e34bf2 swtpm_setup: Rewrite in 'C' (addresses issue #437)
This is a 1:1 rewrite of swtpm_setup in 'C' as a first 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)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-28 13:08:16 -04:00
Stefan Berger
d321bfa6b4 Debian: Fix build warnings by updating compat to '10'
Thos patch fixes the following issue when building a Debian package:

dh clean --parallel
dh: warning: Compatibility levels before 10 are deprecated (level 9 in use)
   dh_auto_clean -O--parallel
dh_auto_clean: warning: Compatibility levels before 10 are deprecated (level 9 in use)
   dh_clean -O--parallel
dh_clean: warning: Compatibility levels before 10 are deprecated (level 9 in use)
 dpkg-source -b .

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2021-05-07 16:56:15 -04:00
Stefan Berger
2caa41bd15 build-sys: Bump up version to 0.6.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-10-28 08:32:50 -04:00
наб
3dea271c67 debian: drop revision from version, illegal for native-format packages
$ dpkg-buildpackage -us -uc
dpkg-buildpackage: info: source package swtpm
dpkg-buildpackage: info: source version 0.5.0-1
dpkg-buildpackage: info: source distribution RELEASED
dpkg-buildpackage: info: source changed by Stefan Berger <stefanb@linux.ibm.com>
dpkg-source: error: can't build with source format '3.0 (native)':
native package version may not have a revision

Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
2020-10-28 08:32:50 -04:00
Stefan Berger
b931e10985 debian/rpm: Adjust changelog for 0.5.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-10-07 14:24:43 -04:00
Stefan Berger
3a3e5661f0 debian/rpm: Adjust packaged files for swptm-localca in python
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-22 12:27:16 -04:00
Jonas Witschel
fdaa6f1f1c build-sys: make pip dependency check non-fatal
The only place where pip is required is in src/swtpm_setup/Makefile.am, l. 48,
to uninstall a manually built package. Most people will have pip already
installed, since it comes bundled with Python by default. It might not be
installed by default in minimal build environments used for distribution
packaging, but these rely on the file tracking by a package manager instead of
using "make uninstall".

In conclusion, I think requiring pip is only helpful for a very limited number
of people, and is just a superfluous build dependency for distribution
packagers. Issuing a warning that the package cannot be uninstalled cleanly if
pip is not found seems enough.

Signed-off-by: Jonas Witschel <diabonas@archlinux.org>
2020-09-14 07:41:24 -04:00
Stefan Berger
3bf8f4628c build-sys: Bump up version to 0.5.0 at beginning of dev cycle
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-09-09 06:49:50 -04:00
Stefan Berger
0c238a2c93 debian/rpm: Adjust changelog for 0.4.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-28 17:43:06 -04:00
Stefan Berger
5d613001c1 debian/rpm: Adjust build and runtime dependencies and directory ownership
Remove tpm-tools from runtime dependencies. Keep trousers for the
creation of the 'tss' user for now. Add python related dependencies.

Adjust the directory ownership for /var/lib/swtpm-localca to tss:root and
the mode flags to 0750. The new CA now may still be created as tss:tss but
users in the tss group will not have access to it.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-08-28 16:27:15 -04:00
Stefan Berger
6b75ea0dfe debian: Address some issues raised by lintian
Remove swtpm_cuse related install script since not needed anymore.

Also address the following issues:

E: swtpm-tools: unknown-control-interpreter control/postinst #!/usr/bin/env
W: swtpm: syntax-error-in-debian-changelog line 25 "bad key-value after `;': `urgency medium'"

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-07-07 15:47:28 -04:00
Stefan Berger
728af8972a Debian: Adjust changelog for 0.4.0~dev1 developer release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-04-07 11:16:49 -04:00
Stefan Berger
38f36f30e3 Debian: Adjust changelog for 0.3.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-02-17 12:11:31 -05:00
Stefan Berger
27d3fc877b Debian: Remove CUSE TPM from build and adjust rules file
Remove the CUSE TPM from the build and adjust the rules file
so that the build works on Ubuntu servers for example.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-02-17 12:11:31 -05:00
Stefan Berger
194bfc66b9 debian: Fix issues reported by lintian and changelog format issues
Fix several issues reported by lintian and the format of
the changelog.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2020-01-14 20:26:36 -05:00
Stefan Berger
c487ba77e5 debian: Adjust changelog for 0.2.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-16 14:28:28 -04:00
Stefan Berger
758bf70a3a packages: Add libseccomp-devel to rpm and debian build deps
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
2c25d137f7 debian: Edit changelog for 0.1.0 release
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-28 17:03:26 -05:00
Stefan Berger
9e8e018145 debian: Fix libtpms0 dependency and force gnutls availability
Libtpms is now libtpms0 as a dependency.
Gnutls is neede for swtpm_cert to create the certs. Force it to
be available.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-28 17:03:26 -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
34308cc7d3 tests: Add test case that uses a pkcs11 URI for signing a cert
Use SoftHSM to create a pkcs11 URI and then use the pkcs11 URI
to sign the certificate of a TPM 2.0 with this key using swtpm-localca.

This test case works with softhsm >= 2.3.0 on Fedora and should work
with a recent version of Ubuntu. If an error is encountered setting
up the softhsm2 environment, we just skip the test.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-23 12:48:43 -05:00
Stefan Berger
bc4d1d0341 debian: Add missing build dependencies
3 build dependencies were missing for a clean environment.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-16 16:03:49 -05:00
Stefan Berger
a530ec8acc debian: Change architecture for swtpm-dev from all to any
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-01-07 13:16:30 -05:00
Stefan Berger
c782a85a8f debian: we need python3-twisted for a test case
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2018-10-29 21:21:22 +00:00
Stefan Berger
a246953a50 build-sys: Install libswpm_libtpms into $(libdir)/swtpm
Install the private libswtpm_libtpms into $(libdir)/swtpm
rather than into the shared libaries directory.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-25 08:35:45 -04:00
Stefan Berger
dea49eb3e6 debian: Use autogen.sh
Use autogen.sh when building a Debian package.

Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com>
2018-09-13 09:28:15 -04:00