diff options
author | Masahisa Kojima <masahisa.kojima@linaro.org> | 2021-04-14 11:55:49 +0900 |
---|---|---|
committer | Heinrich Schuchardt <xypron.glpk@gmx.de> | 2021-04-17 20:01:32 +0200 |
commit | b1a7a5e0b8822a0868ee9318d8d3fa9645efc12d (patch) | |
tree | 02db639be3785a1edd0bc552783a66fe88101c6c | |
parent | e8287b0fb2be8acf8d0412be3b4174768fef348c (diff) | |
download | u-boot-b1a7a5e0b8822a0868ee9318d8d3fa9645efc12d.tar.gz u-boot-b1a7a5e0b8822a0868ee9318d8d3fa9645efc12d.tar.xz u-boot-b1a7a5e0b8822a0868ee9318d8d3fa9645efc12d.zip |
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>
-rw-r--r-- | lib/efi_loader/efi_tcg2.c | 2 |
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; |