Add a test for EVP_PKEY_*_check functions for "DSA" keys

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/11598)
This commit is contained in:
Mat Berchtold 2020-04-21 19:30:40 -05:00 committed by Richard Levitte
parent 2fc2e37b28
commit 9011309618

View File

@ -1211,6 +1211,25 @@ static int test_fromdata_dsa_fips186_4(void)
return ret;
}
static int test_check_dsa(void)
{
int ret = 0;
EVP_PKEY_CTX *ctx = NULL;
if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL))
|| !TEST_false(EVP_PKEY_check(ctx))
|| !TEST_false(EVP_PKEY_public_check(ctx))
|| !TEST_false(EVP_PKEY_private_check(ctx))
|| !TEST_false(EVP_PKEY_pairwise_check(ctx)))
goto err;
ret = 1;
err:
EVP_PKEY_CTX_free(ctx);
return ret;
}
#endif /* OPENSSL_NO_DSA */
@ -1231,6 +1250,7 @@ int setup_tests(void)
ADD_TEST(test_fromdata_dh_named_group);
#endif
#ifndef OPENSSL_NO_DSA
ADD_TEST(test_check_dsa);
ADD_TEST(test_fromdata_dsa_fips186_4);
#endif
#ifndef OPENSSL_NO_EC