summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorMasahisa Kojima <masahisa.kojima@linaro.org>2021-04-14 11:55:49 +0900
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2021-04-17 20:01:32 +0200
commitb1a7a5e0b8822a0868ee9318d8d3fa9645efc12d (patch)
tree02db639be3785a1edd0bc552783a66fe88101c6c /lib/efi_loader
parente8287b0fb2be8acf8d0412be3b4174768fef348c (diff)
efi_loader: fix possible buffer overflow
Variable "final" will have SHA512 digest, but currently the array size is not sufficient. Let's fix it. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_tcg2.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index ed86a220fb..d5eca68769 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -515,7 +515,7 @@ static efi_status_t tcg2_create_digest(const u8 *input, u32 length,
sha1_context ctx;
sha256_context ctx_256;
sha512_context ctx_512;
- u8 final[TPM2_ALG_SHA512];
+ u8 final[TPM2_SHA512_DIGEST_SIZE];
efi_status_t ret;
u32 active;
int i;