latchset / clevis

Automated Encryption Framework
GNU General Public License v3.0
832 stars 99 forks source link

Using preset pcr_digest and pcr_ids with clevis-encrypt-tpm2 #450

Open willakat opened 4 months ago

willakat commented 4 months ago

When sealing a key to PCR values, it should be possible to combine measured pcr values with preset.

For instance one could use something like '"tpm2": {"pcr_bank":"sha256", "pcr_ids": "0,1,7,11", "pcr_digest": {"11": "'${pcr11}'"}} in order to designate a value for pcr11 while using measured values for 0,1 and 7. As of writing, it seems that it isn't possible to provide a dictionary for the pcr_digest value. Only a string value is processed (and an object value is silently ignored), this string needs to contain values for all the pcrs.

From a usability standpoint, it may be interesting to support a dictionary value for pcr_digest and use those values as overrides on the output of tpm2_pcrread.