]> git.ipfire.org Git - thirdparty/systemd.git/commit
tpm2-setup: add new early boot tool for initializing the SRK
authorLennart Poettering <lennart@poettering.net>
Tue, 26 Sep 2023 19:25:53 +0000 (21:25 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 29 Sep 2023 17:36:04 +0000 (19:36 +0200)
commit2e64cb71b9c0160c335d8e52954149e078bba2fb
tree6009b2b90b9f5a7e88c65d2a8ff3084b634ea26c
parentbaab1b3faa387ebbb469067168197b109259c79d
tpm2-setup: add new early boot tool for initializing the SRK

This adds an explicit service for initializing the TPM2 SRK. This is
implicitly also done by systemd-cryptsetup, hence strictly speaking
redundant, but doing this early has the benefit that we can parallelize
this in a nicer way. This also write a copy of the SRK public key in PEM
format to /run/ + /var/lib/, thus pinning the disk image to the TPM.
Making the SRK public key is also useful for allowing easy offline
encryption for a specific TPM.

Sooner or later we should probably grow what this service does, the
above is just the first step. For example, the service should probably
offer the ability to reset the TPM (clear the owner hierarchy?) on a
factory reset, if such a policy is needed. And we might want to install
some default AK (?).

Fixes: #27986
Also see: #22637
12 files changed:
man/rules/meson.build
man/systemd-tpm2-setup.service.xml [new file with mode: 0644]
meson.build
src/shared/generator.c
src/shared/tpm2-util.c
src/shared/tpm2-util.h
src/tpm2-setup/meson.build [new file with mode: 0644]
src/tpm2-setup/tpm2-setup.c [new file with mode: 0644]
test/units/testsuite-70.sh
units/meson.build
units/systemd-tpm2-setup-early.service.in [new file with mode: 0644]
units/systemd-tpm2-setup.service.in [new file with mode: 0644]