summaryrefslogtreecommitdiff
path: root/include/efi_tcg2.h
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2021-09-03 04:55:52 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-09-04 13:03:57 +0300
commit538c0f2d3798261161a28a05e445d0c85af56276 (patch)
treeee54a608a53f646f1a0366a3fd797aae33e27fb7 /include/efi_tcg2.h
parentdb3ed2cf9c67ed6a0da0bab6e43edae90ced4bf2 (diff)
downloadu-boot-538c0f2d3798261161a28a05e445d0c85af56276.tar.xz
efi_loader: fix efi_tcg2_hash_log_extend_event() parameter check
TCG EFI Protocol Specification defines that PCRIndex parameter passed from caller must be 0 to 23. TPM2_MAX_PCRS is currently used to check the range of PCRIndex, but TPM2_MAX_PCRS is tpm2 device dependent and may have larger value. This commit newly adds EFI_TCG2_MAX_PCR_INDEX macro, it is used to check the range of PCRIndex parameter. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'include/efi_tcg2.h')
-rw-r--r--include/efi_tcg2.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/efi_tcg2.h b/include/efi_tcg2.h
index a8c43e415f..c99384fb00 100644
--- a/include/efi_tcg2.h
+++ b/include/efi_tcg2.h
@@ -28,6 +28,8 @@
#define EFI_TCG2_EXTEND_ONLY 0x0000000000000001
#define PE_COFF_IMAGE 0x0000000000000010
+#define EFI_TCG2_MAX_PCR_INDEX 23
+
/* Algorithm Registry */
#define EFI_TCG2_BOOT_HASH_ALG_SHA1 0x00000001
#define EFI_TCG2_BOOT_HASH_ALG_SHA256 0x00000002