extending PCRs in TPM with pcr_extend of pytss

65 views Asked by At

I am trying to extend PCRs on my Raspberry Pi with external TPM installed and using guidance from here.

The code is following:

def decode_objects(selection_obj.pcrSelections):
   for index, pcr_sel in enumerate(selection_obj.pcrselections):
   print('index is', index)
   print(pcr_sel.pcrSelect)

for index,pcr_value in enumerate(digest_obj.digests):
   print(f'PCR value {index}: {pcr_value}')

value =40

digest_values = TPML_DIGEST_VALUES(value)


pcr_values = tpm.pcr_read("sha256:23,24,25,26")
decode_objects(pcr_values[1],pcr_values[2])
extend_values = tpm.pcr_extend(ESYS_TR.PCR23,digest_values)
pcr_values = tpm.pcr_read("sha256:23,24,25,26")
decode_objects(pcr_values[1],pcr_values[2])

The problem is, when I read PCRs again, nothing is changed. Please help me, where I am doing mistake.

0

There are 0 answers