diff options
author | Stefan Berger <stefanb@linux.ibm.com> | 2021-11-28 07:10:51 +0300 |
---|---|---|
committer | Jarkko Sakkinen <jarkko@kernel.org> | 2022-03-08 11:33:17 +0300 |
commit | 0d060f230fa06c32d91e67978a3088be9635848e (patch) | |
tree | 467f3b7b71b8912a14cbc6a224b80f3dcea115cc /drivers/char/tpm/tpm-dev-common.c | |
parent | ea4424be16887a37735d6550cfd0611528dbe5d9 (diff) | |
download | linux-0d060f230fa06c32d91e67978a3088be9635848e.tar.xz |
selftests: tpm2: Determine available PCR bank
Determine an available PCR bank to be used by a test case by querying the
capability TPM2_GET_CAP. The TPM2 returns TPML_PCR_SELECTIONS that
contains an array of TPMS_PCR_SELECTIONs indicating available PCR banks
and the bitmasks that show which PCRs are enabled in each bank. Collect
the data in a dictionary. From the dictionary determine the PCR bank that
has the PCRs enabled that the test needs. This avoids test failures with
TPM2's that either to not have a SHA-1 bank or whose SHA-1 bank is
disabled.
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
Diffstat (limited to 'drivers/char/tpm/tpm-dev-common.c')
0 files changed, 0 insertions, 0 deletions