Merge #397419 from ~ivan.hu/plainbox-provider-tpm2:sha1PCR
Recently, most platforms which default don't support sha1 pcr band and can be changed on the bios setup menu. Sha1 PCR band is not mandatory from the TCG TPM spec. So, modify some tests for not getting lots of failures on those platforms which sha1 PCR band is not default supported.
* helpers.sh: add helper function for check sha1 pcr support
* skip/modify tests related to sha1 pcr band
pm2.0_4.1.1: modify some tests for the platforms without sha1 pcr band
Most platforms which default don't support sha1 pcr band and can be
changed on the bios setup menu. Sha1 pcr band is not mandatory from
the TCG TPM spec. So, modify some tests for not getting lots of failures
on those platforms which sha1 pcr band is not default supported.
* helpers.sh: add helper function for check sha1 pcr support
* skip/modify tests related to sha1 pcr band.
Merge #396121 from ~ivan.hu/plainbox-provider-tpm2:checkgapmax
From the TCG spec "Trusted Platform Module Library Part 2: Structures", TPM_PT_CONTEXT_GAP_MAX the maximum allowed difference (unsigned) between the contextID values of two saved session contexts.
This value shall be 2^n-1, where n is at least 16. Which means the value should be at least 0xFFFF
Currently, there are lots of machines which TPM hasn't followed the specification, and only has the value 0xFF.
tpm2.0_4.1.1: add checking the TPM_PT_CONTEXT_GAP_MAX value
From the TCG spec "Trusted Platform Module Library Part 2: Structures",
TPM_PT_CONTEXT_GAP_MAX the maximum allowed difference (unsigned) between
the contextID values of two saved session contexts.
This value shall be 2^n-1, where n is at least 16.
Which means the value should be at least 0xFFFF
Currently, there are lots of machines which TPM hasn't followed the
specification, and only has the value 0xFF.
Merge #395888 from ~ivan.hu/plainbox-provider-tpm2:flushcontext
Some machines which only support TPM_PT_CONTEXT_GAP_MAX to 0xFF.
It causes the tpm2 context reached the limitation value.
And got tests freeze or got lots failures returned.
Adding flushcontext to avoid reached the limitaiton.