]> git.ipfire.org Git - thirdparty/systemd.git/commit
tpm2-util: do not serialize tpm2 bank if none is specified
authorLennart Poettering <lennart@poettering.net>
Thu, 23 May 2024 11:57:07 +0000 (13:57 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 May 2024 13:38:37 +0000 (15:38 +0200)
commit360198efc33deac69b4cb833572372dd4b8d01f1
tree4eced3f47531ba3f4226d9ec54df7ecfbc15d665
parent96bf8aa051c5687fba14fef9f841c5ffe16d57f9
tpm2-util: do not serialize tpm2 bank if none is specified

If both literal and signed PCR bindings are not used then we won't
determine a PCR bank to use, and hence we shouldnt attempt to serialize
it either.

Hence, if the bank is zero, skip serialization.

(And while we are at it, also skip serialization of the primary
algorithm if not set, purely to make things systematic).

[This effectively results in little change, as previously we'd then
seralize a json "null", while now we simply won't genreate the field]
src/shared/tpm2-util.c