summaryrefslogtreecommitdiffstats
path: root/test/evp_extra_test.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2021-12-10 13:18:42 +0100
committerRichard Levitte <levitte@openssl.org>2021-12-13 07:52:53 +0100
commitedc8566f475d63278d5f85cd25f324cf2fe9aaf9 (patch)
tree61e7146497885e993cfdd0d208d2e943c678d8ef /test/evp_extra_test.c
parent5fbe15fd3b7c90a0cfb9f00be16225d8ed18b0dd (diff)
test/evp_extra_test.c: Add EVP_PKEY comparisons in test_EC_priv_pub()
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/16765)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r--test/evp_extra_test.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c
index bd6ff414d0..0d5bd5e3f7 100644
--- a/test/evp_extra_test.c
+++ b/test/evp_extra_test.c
@@ -980,6 +980,20 @@ static int test_EC_priv_pub(void)
if (!test_selection(params_and_keypair, EVP_PKEY_KEYPAIR))
goto err;
+ /* Try key equality */
+ if (!TEST_int_gt(EVP_PKEY_parameters_eq(just_params, just_params), 0)
+ || !TEST_int_gt(EVP_PKEY_parameters_eq(just_params, params_and_pub),
+ 0)
+ || !TEST_int_gt(EVP_PKEY_parameters_eq(just_params, params_and_priv),
+ 0)
+ || !TEST_int_gt(EVP_PKEY_parameters_eq(just_params, params_and_keypair),
+ 0)
+ || !TEST_int_gt(EVP_PKEY_eq(params_and_pub, params_and_pub), 0)
+ || !TEST_int_gt(EVP_PKEY_eq(params_and_priv, params_and_priv), 0)
+ || !TEST_int_gt(EVP_PKEY_eq(params_and_keypair, params_and_pub), 0)
+ || !TEST_int_gt(EVP_PKEY_eq(params_and_keypair, params_and_priv), 0))
+ goto err;
+
ret = 1;
err:
OSSL_PARAM_free(params);