condition: Check that subsystem is enabled in ConditionSecurity=tpm2
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 27 Oct 2022 09:12:10 +0000 (11:12 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 1 Nov 2022 13:50:47 +0000 (14:50 +0100)
commit300bba79c22e4be1effe2faad0e59ac725d396a1
treec5192a0c6db13c6b790a936628430abd47cf01ea
parentcd00185881fffd404e04f1b786f51be0aff214f8
condition: Check that subsystem is enabled in ConditionSecurity=tpm2

Instead of succeeding when either the firmware reports a TPM device
or we find a TPM device, let's check that the firmware reports a TPM
device and the TPM subsystem is enabled in the kernel.

To check whether the subsystem enabled, we check if the relevant
subdirectory in /sys exists at all.
man/systemd-creds.xml
src/creds/creds.c
src/shared/condition.c
src/shared/tpm2-util.c
src/shared/tpm2-util.h