diff options
Diffstat (limited to 'test/evp_pkey_provided_test.c')
-rw-r--r-- | test/evp_pkey_provided_test.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 6f7f3986e9..c395f185dd 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -331,7 +331,7 @@ static int test_fromdata_rsa(void) static int test_fromdata_dh(void) { int ret = 0; - EVP_PKEY_CTX *ctx = NULL; + EVP_PKEY_CTX *ctx = NULL, *key_ctx = NULL; EVP_PKEY *pk = NULL; /* * 32-bit DH key, extracted from this command, @@ -367,9 +367,19 @@ static int test_fromdata_dh(void) ret = test_print_key_using_pem("DH", pk) && test_print_key_using_serializer("DH", pk); + if (!TEST_ptr(key_ctx = EVP_PKEY_CTX_new_from_pkey(NULL, pk, ""))) + goto err; + + if (!TEST_false(EVP_PKEY_check(key_ctx)) + || !TEST_true(EVP_PKEY_public_check(key_ctx)) + || !TEST_false(EVP_PKEY_private_check(key_ctx)) /* Need a q */ + || !TEST_true(EVP_PKEY_pairwise_check(key_ctx))) + goto err; + err: EVP_PKEY_free(pk); EVP_PKEY_CTX_free(ctx); + EVP_PKEY_CTX_free(key_ctx); return ret; } @@ -552,7 +562,6 @@ err: #endif /* OPENSSL_NO_EC */ - int setup_tests(void) { if (!test_skip_common_options()) { |