tpm2: add Tpm2PCRValue struct and associated functions
Add a new struct that can represent a PCR index, hash, and value all together. This replaces code (e.g. the tpm2_pcr_read() parameters) that required using both a TPML_PCR_SELECTION as well as array of TPM2B_DIGEST entries, which was difficult to correlate the selection hash/index to each digest.
This commit is contained in:
@@ -435,7 +435,7 @@ static int parse_one_option(const char *option) {
|
||||
}
|
||||
|
||||
pcr = r ? TPM_PCR_INDEX_VOLUME_KEY : UINT_MAX;
|
||||
} else if (!TPM2_PCR_VALID(pcr)) {
|
||||
} else if (!TPM2_PCR_INDEX_VALID(pcr)) {
|
||||
log_warning("Selected TPM index for measurement %u outside of allowed range 0…%u, ignoring.", pcr, TPM2_PCRS_MAX-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user