tpm2: add/rename functions to manage pcr selections

This renames some functions to match other to/from_string() naming,
and allows better management of TPML_PCR_SELECTION and TPMS_PCR_SELECTION
structs.
This commit is contained in:
Dan Streetman
2023-03-09 10:46:19 -05:00
parent aa07a4fa35
commit c69bd0abdb
5 changed files with 359 additions and 72 deletions
+3 -1
View File
@@ -870,7 +870,9 @@ static int verb_sign(int argc, char *argv[], void *userdata) {
return log_error_errno(tpmalg, "Unsupported PCR bank");
TPML_PCR_SELECTION pcr_selection;
tpm2_pcr_mask_to_selection(1 << TPM_PCR_INDEX_KERNEL_IMAGE, tpmalg, &pcr_selection);
tpm2_tpml_pcr_selection_from_mask(1 << TPM_PCR_INDEX_KERNEL_IMAGE,
tpmalg,
&pcr_selection);
rc = sym_Esys_PolicyPCR(
c->esys_context,