aboutsummaryrefslogtreecommitdiff
path: root/test/evp_extra_test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r--test/evp_extra_test.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index 7e97e2d34d5d..c5fbbf8a8309 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -5351,6 +5351,25 @@ static int test_aes_rc4_keylen_change_cve_2023_5363(void)
}
#endif
+static int test_invalid_ctx_for_digest(void)
+{
+ int ret;
+ EVP_MD_CTX *mdctx;
+
+ mdctx = EVP_MD_CTX_new();
+ if (!TEST_ptr(mdctx))
+ return 0;
+
+ if (!TEST_int_eq(EVP_DigestUpdate(mdctx, "test", sizeof("test") - 1), 0))
+ ret = 0;
+ else
+ ret = 1;
+
+ EVP_MD_CTX_free(mdctx);
+
+ return ret;
+}
+
int setup_tests(void)
{
OPTION_CHOICE o;
@@ -5514,6 +5533,8 @@ int setup_tests(void)
ADD_TEST(test_aes_rc4_keylen_change_cve_2023_5363);
#endif
+ ADD_TEST(test_invalid_ctx_for_digest);
+
return 1;
}