]> git.ipfire.org Git - thirdparty/openssl.git/commit
rands/drbg_hmac.c: Add checks for the EVP_MD_get_size()
authorJiasheng Jiang <jiasheng@purdue.edu>
Fri, 22 Mar 2024 20:01:52 +0000 (20:01 +0000)
committerNeil Horman <nhorman@openssl.org>
Mon, 1 Apr 2024 20:02:08 +0000 (16:02 -0400)
commit81f2b0420abab47a7fd9fc9ef69309578115d342
tree20b8c2fec0c8dc369f8673f94946278c322f55fc
parente97f468589e807e7f4722b150458edd53f374cd0
rands/drbg_hmac.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: 8bf3665196 ("Added DRBG_HMAC & DRBG_HASH + Added defaults for setting DRBG for master/public/private + renamed generate_counter back to reseed_counter + generated new cavs data tests")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23945)
providers/implementations/rands/drbg_hmac.c