tpm2-util: tweak JSON condition check
authorLennart Poettering <lennart@poettering.net>
Mon, 6 May 2024 14:12:04 +0000 (16:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 6 May 2024 14:15:16 +0000 (16:15 +0200)
commit3f2402171b26e9257f41417d749fe207fc329085
treeaabd4c879673e771f40755b442f63a8e7f8a9798
parente6ca81d43422e6ea7b1a99c15d21b71f1628f32f
tpm2-util: tweak JSON condition check

As for the other fields let's check if the actual variable we serialize
is set before serializing it.

This shouldn't make any difference, since the pubkey and the PCR mask
should always be set together or neither, but I think it's easier to
grok this way, and makes the function nicely "dumb": it serializes what
is specified, without trying to be smart by suppressng specified fields.
src/shared/tpm2-util.c