Libtpms-based TPM emulator with socket, character device, and Linux CUSE interface.
Go to file
Stefan Berger c2e524dbc7 swtpm: Use fchmod to set mode bits provided by user
The mode bits that the user provided were only applied with open() and were
subject to masking with the value of current umask. When umask was set to
0027 the test case test_commandline was failing because the mode bits on
the create TPM state file were not the expected ones (masked by umask).
Therefore, set the mode bits using fchmod if the user provided them,
otherwise do not set them. This way the mode bits will be set to the values
the user requested.

Currently the directory storage backend was setting the mode bits to the
default value (0640) *after* opening the TPM state file. Now, if the user
did not provide any mode bits then the mode bits will be set so that the
file can be written to as owner. This ensures that at least mode bits 0600
are set by default. However, if the user provided mode bit flags then these
will be used without modification.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2024-06-12 14:23:54 -04:00
.github/ISSUE_TEMPLATE Update bug_report.md 2022-10-10 07:53:26 -04:00
debian debian: Sync AppArmor profile with what is used by Ubuntu 2024-06-11 11:03:03 -04:00
include headers: Exclude TPM ioctls definitions for the GNU/Hurd 2024-02-15 10:07:19 -05:00
man Revert "utils: Implement find_program() to try BINDIR path before PATH" 2023-09-01 22:48:45 -04:00
samples samples: swtpm-create-tpmca: Fix shellcheck issues and add to syntax-check target 2023-02-22 17:27:05 -05:00
src swtpm: Use fchmod to set mode bits provided by user 2024-06-12 14:23:54 -04:00
tests tests: Add test cases for using swtpm --print-states while swtpm is running 2024-06-11 08:43:01 -04:00
.gitignore selinux: Redevelop SELinux policy for Fedora 40 (ditch old rules) 2024-05-27 20:06:17 -04:00
.travis.yml Travis: Update from focal to jammy and from bionic to focal 2023-02-27 07:10:10 -05:00
autogen.sh build-sys: Create m4 directory on older systems 2018-12-15 10:06:03 -05:00
CHANGES selinux: Redevelop SELinux policy for Fedora 40 (ditch old rules) 2024-05-27 20:06:17 -04:00
configure.ac build-sys: Add support for --disable-tests to disable tests 2024-03-22 11:18:05 -04:00
COPYING initial check-in 2014-12-05 11:16:03 -05:00
DCO1.1.txt Replace the CLA with the DCO, simply requiring a Signed-off-by: 2016-12-21 11:11:48 -05:00
INSTALL docs: Update INSTALL document 2021-07-21 09:04:24 -04:00
LICENSE swtpm: Replace the CUSE TPM with the new implementation 2015-12-07 15:01:57 -05:00
Makefile.am samples: swtpm-create-tpmca: Fix shellcheck issues and add to syntax-check target 2023-02-22 17:27:05 -05:00
README docu: Cut down the README to its minimum 2018-09-24 17:48:41 -04:00
run_tests tests: Run all tests again in run_test 2020-04-07 17:14:10 -04:00
swtpm.spec selinux: Redevelop SELinux policy for Fedora 40 (ditch old rules) 2024-05-27 20:06:17 -04:00
swtpm.spec.in selinux: Redevelop SELinux policy for Fedora 40 (ditch old rules) 2024-05-27 20:06:17 -04:00
TODO Adding RHEL/Centos status info 2016-06-26 20:03:43 -04:00

SWTPM - Software TPM Emulator
      David Safford safford@us.ibm.com
      Stefan Berger stefanb@us.ibm.com

The SWTPM package provides TPM emulators with different front-end interfaces
to libtpms. TPM emulators provide socket interfaces (TCP/IP and Unix) and
the Linux CUSE interface for the creation of multiple native /dev/vtpm* devices.

The SWTPM package also provides several tools for using the TPM emulator,
creating certificates for a TPM, and simulating the manufacturing of
a TPM by creating a TPM's EK and platform certificates etc. Please read 
the READMEs in the individual tool's directory under src/.

Please consult the Wiki for information about swtpm:

   https://github.com/stefanberger/swtpm/wiki