efi_loader: fix efi_tcg2_hash_log_extend_event() parameter check
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Fri, 3 Sep 2021 01:55:52 +0000 (10:55 +0900)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Sat, 4 Sep 2021 10:03:57 +0000 (12:03 +0200)
commit538c0f2d3798261161a28a05e445d0c85af56276
treeee54a608a53f646f1a0366a3fd797aae33e27fb7
parentdb3ed2cf9c67ed6a0da0bab6e43edae90ced4bf2
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>
include/efi_tcg2.h
lib/efi_loader/efi_tcg2.c