PCR Initialization looks incomplete
Why don't we initialize the full PCR selection to 0's and test for things like pcr selection including 24? See: https://github.com/tpm2-software/tpm2-tools/blob/master/lib/pcr.c#L49
@williamcroberts can you please elaborate?
Right now we initialize a TPML_PCR_SELECTION to:
pcr_select->sizeofSelect = 3;
pcr_select->pcrSelect[0] = 0;
pcr_select->pcrSelect[1] = 0;
pcr_select->pcrSelect[2] = 0;
And then fill in the bits from there. So right now we only support bits 0-23 set. However, the selection can have up to 16 bytes of selection bits. Currently no TPM is using them I am aware of, everything is set to 3 bytes and those bits. But Im thinking if we wanted to future proof this code we could. "all" should continue to be sizeofSelect 3 with three bytes of 0xFF as thats how all TPM's currently work.
For the code, I think the initialization could be simplified to a memset 0 over filling in each byte, then just set the sizeofSelect to 3.