]> git.ipfire.org Git - thirdparty/openssl.git/commit
test/bad_dtls_test.c: Add checks for the EVP_MD_CTX_get_size()
authorJiasheng Jiang <jiasheng@purdue.edu>
Fri, 22 Mar 2024 23:05:00 +0000 (23:05 +0000)
committerNeil Horman <nhorman@openssl.org>
Mon, 1 Apr 2024 17:13:46 +0000 (13:13 -0400)
commitef9ac2f9b8b648406424c7c002fb94b0fae0434a
tree0c166c3889d4de01e22dde3b0c6f335ab79758d9
parent99fe4c10664c2287d34145457823edff3782e413
test/bad_dtls_test.c: Add checks for the EVP_MD_CTX_get_size()

Add the check for the EVP_MD_CTX_get_size() to avoid integer overflow when it is implicitly casted from int to size_t in evp_pkey_ctx_store_cached_data().
The call path is do_PRF() -> EVP_PKEY_CTX_add1_tls1_prf_seed() -> evp_pkey_ctx_set1_octet_string() -> EVP_PKEY_CTX_ctrl() -> evp_pkey_ctx_store_cached_data().

Fixes: 16938284cf ("Add basic test for Cisco DTLS1_BAD_VER and record replay handling")
Signed-off-by: Jiasheng Jiang <jiasheng@purdue.edu>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23952)
test/bad_dtls_test.c