aboutsummaryrefslogtreecommitdiff
path: root/src/tcgbios.c
diff options
context:
space:
mode:
authorStefan Berger <stefanb@linux.vnet.ibm.com>2020-03-30 07:55:57 -0400
committerKevin O'Connor <kevin@koconnor.net>2020-04-19 11:35:34 -0400
commiteaaf726038cb9b2d01312d6430b4e93842aa96eb (patch)
tree9d9937caa8f0114b096377bb9bfeede34f9f60c5 /src/tcgbios.c
parentadaf988b227533cf1cbbac84de17d8f07be81833 (diff)
downloadseabios-hppa-eaaf726038cb9b2d01312d6430b4e93842aa96eb.zip
seabios-hppa-eaaf726038cb9b2d01312d6430b4e93842aa96eb.tar.gz
seabios-hppa-eaaf726038cb9b2d01312d6430b4e93842aa96eb.tar.bz2
tcgbios: Add support for SHA3 type of algorithms
Add support for SHA3 type of algorithms that a TPM2 may support some time in the future. Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'src/tcgbios.c')
-rw-r--r--src/tcgbios.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/src/tcgbios.c b/src/tcgbios.c
index 6a3a613..82894f5 100644
--- a/src/tcgbios.c
+++ b/src/tcgbios.c
@@ -156,9 +156,10 @@ static struct tpml_pcr_selection *tpm20_pcr_selection;
struct tpm_log_entry {
struct tpm_log_header hdr;
u8 pad[sizeof(struct tpm2_digest_values)
- + 5 * sizeof(struct tpm2_digest_value)
+ + 8 * sizeof(struct tpm2_digest_value)
+ SHA1_BUFSIZE + SHA256_BUFSIZE + SHA384_BUFSIZE
- + SHA512_BUFSIZE + SM3_256_BUFSIZE];
+ + SHA512_BUFSIZE + SM3_256_BUFSIZE + SHA3_256_BUFSIZE
+ + SHA3_384_BUFSIZE + SHA3_512_BUFSIZE];
} PACKED;
static const struct hash_parameters {
@@ -192,6 +193,21 @@ static const struct hash_parameters {
.hashalg_flag = TPM2_ALG_SM3_256_FLAG,
.hash_buffersize = SM3_256_BUFSIZE,
.name = "SM3-256",
+ }, {
+ .hashalg = TPM2_ALG_SHA3_256,
+ .hashalg_flag = TPM2_ALG_SHA3_256_FLAG,
+ .hash_buffersize = SHA3_256_BUFSIZE,
+ .name = "SHA3-256",
+ }, {
+ .hashalg = TPM2_ALG_SHA3_384,
+ .hashalg_flag = TPM2_ALG_SHA3_384_FLAG,
+ .hash_buffersize = SHA3_384_BUFSIZE,
+ .name = "SHA3-384",
+ }, {
+ .hashalg = TPM2_ALG_SHA3_512,
+ .hashalg_flag = TPM2_ALG_SHA3_512_FLAG,
+ .hash_buffersize = SHA3_512_BUFSIZE,
+ .name = "SHA3-512",
}
};
@@ -252,7 +268,7 @@ tpm20_write_EfiSpecIdEventStruct(void)
struct {
struct TCG_EfiSpecIdEventStruct hdr;
- u8 pad[256];
+ u8 pad[sizeof(struct tpm_log_entry) + sizeof(u8)];
} event = {
.hdr.signature = "Spec ID Event03",
.hdr.platformClass = TPM_TCPA_ACPI_CLASS_CLIENT,