summaryrefslogtreecommitdiffstats
path: root/test/evp_extra_test2.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/evp_extra_test2.c')
-rw-r--r--test/evp_extra_test2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/evp_extra_test2.c b/test/evp_extra_test2.c
index b70c168d9d..287f3d1443 100644
--- a/test/evp_extra_test2.c
+++ b/test/evp_extra_test2.c
@@ -853,6 +853,21 @@ static int test_rsa_pss_sign(void)
return ret;
}
+static int test_evp_md_ctx_dup(void)
+{
+ EVP_MD_CTX *mdctx;
+ EVP_MD_CTX *copyctx = NULL;
+ int ret;
+
+ /* test copying freshly initialized context */
+ ret = TEST_ptr(mdctx = EVP_MD_CTX_new())
+ && TEST_ptr(copyctx = EVP_MD_CTX_dup(mdctx));
+
+ EVP_MD_CTX_free(mdctx);
+ EVP_MD_CTX_free(copyctx);
+ return ret;
+}
+
static int test_evp_md_ctx_copy(void)
{
EVP_MD_CTX *mdctx = NULL;
@@ -895,6 +910,7 @@ int setup_tests(void)
#endif
ADD_ALL_TESTS(test_PEM_read_bio_negative, OSSL_NELEM(keydata));
ADD_TEST(test_rsa_pss_sign);
+ ADD_TEST(test_evp_md_ctx_dup);
ADD_TEST(test_evp_md_ctx_copy);
return 1;
}