creds-util: do not try TPM2 if there is not support
authorAlberto Planas <aplanas@suse.com>
Mon, 16 Jan 2023 10:16:53 +0000 (11:16 +0100)
committerAlberto Planas <aplanas@suse.com>
Mon, 16 Jan 2023 12:31:17 +0000 (13:31 +0100)
commite653a194e490fae7d166f40762c334006d592051
tree5284983ce888ed1a8d697f0fe919d077803f37d1
parent1615578f2792fdeecaf65606861bd3db9eb949c3
creds-util: do not try TPM2 if there is not support

During the credentials encryption, if systemd it is compiled with TPM2
support, it will try to use it depending on the key flags passed.

The current code only checks if the system has a functional TPM2 if the
case of the INITRD flag.

This patch do a similar check in the case that it is outside initrd (but
still automatic).

Signed-off-by: Alberto Planas <aplanas@suse.com>
src/shared/creds-util.c