From: Mat Berchtold Date: Wed, 22 Apr 2020 00:30:40 +0000 (-0500) Subject: Add a test for EVP_PKEY_*_check functions for "DSA" keys X-Git-Tag: openssl-3.0.0-alpha2~106 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=90113096186e185cd07ee1c4c7267d0e68e67793;p=oweals%2Fopenssl.git Add a test for EVP_PKEY_*_check functions for "DSA" keys Reviewed-by: Tomas Mraz Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/11598) --- diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 1ded0d9f9e..2c07ed0282 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -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