swtpm_bios: Use TPM2_ALG_SHA256 as parameter to TPM2_IncrementalSelfTest

Do not use TPM2_ALG_SHA1 anymore as parameter to TPM2_IncrementalSelfTest()
so that this also works when SHA1 support in libtpms is runtime-disabled.

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
This commit is contained in:
Stefan Berger 2022-06-13 14:02:48 -04:00 committed by Stefan Berger
parent 933ac94d5d
commit 9ebd925619
2 changed files with 3 additions and 3 deletions

View File

@ -422,7 +422,7 @@ static int TPM2_IncrementalSelfTest(int *tpm_errcode)
.to_test = {
.num_entries = htobe32(1),
.algids = {
htobe16(TPM2_ALG_SHA1),
htobe16(TPM2_ALG_SHA256),
},
},
};
@ -613,7 +613,7 @@ static int tpm2_bios(int contselftest, unsigned char startupparm,
ret = TPM2_IncrementalSelfTest(&tpm_errcode);
if (tpm_errcode != 0) {
tpm_error = 1;
printf("TPM2_ImcrementalSelfTest returned error "
printf("TPM2_IncrementalSelfTest returned error "
"code 0x%08x\n", tpm_errcode);
}
}

View File

@ -130,7 +130,7 @@ struct tpm_get_capability_permflags_res {
#define TPM2_SU_CLEAR 0x0000
#define TPM2_SU_STATE 0x0001
#define TPM2_ALG_SHA1 0x0004
#define TPM2_ALG_SHA256 0x000b
#define TPM2_RS_PW 0x40000009
#define TPM2_RH_PLATFORM 0x4000000c