]> git.ipfire.org Git - thirdparty/openssl.git/commit
apps/rehash.c: Add the check for the EVP_MD_get_size()
authorJiasheng Jiang <jiashengjiangcool@outlook.com>
Fri, 5 Jul 2024 18:05:35 +0000 (18:05 +0000)
committerTomas Mraz <tomas@openssl.org>
Wed, 10 Jul 2024 16:23:44 +0000 (18:23 +0200)
commit45cada1339bacc81765b02367bdbaf878445081d
tree669934dad5c0ffedd845d5d1898ef728277a0305
parenteaf577c865c41946b478b4da5f8c477e132d470d
apps/rehash.c: Add the check for the EVP_MD_get_size()

Add the check for the return value of EVP_MD_get_size() to avoid invalid negative
numbers and then explicitly cast from int to size_t.

Add the check to prevent that EVP_MD_get_size() returns a value greater
than EVP_MAX_MD_SIZE.

Signed-off-by: Jiasheng Jiang <jiashengjiangcool@outlook.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24802)
apps/rehash.c