macs/kmac_prov.c: Add checks for the EVP_MD_get_size()
authorJiasheng Jiang <jiasheng@purdue.edu>
Fri, 22 Mar 2024 20:21:46 +0000 (20:21 +0000)
committerNeil Horman <nhorman@openssl.org>
Mon, 1 Apr 2024 19:16:44 +0000 (15:16 -0400)
commite97f468589e807e7f4722b150458edd53f374cd0
tree91a34101497fc9040562a386bb80f6e5cfd02af3
parent6c0f154750a3380cced8ddab44d7ad100b6ab984
macs/kmac_prov.c: Add checks for the EVP_MD_get_size()

Add checks for the EVP_MD_get_size() to avoid integer overflow and then explicitly cast from int to size_t.

Fixes: 6e624a6453 ("KMAC implementation using EVP_MAC")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23946)
providers/implementations/macs/kmac_prov.c