diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-28 23:59:36 +0800 |
---|---|---|
committer | Todd Short <todd.short@me.com> | 2022-06-02 10:54:17 -0400 |
commit | 9611bc61795a818d0acb3b535aa818387d6e1453 (patch) | |
tree | a860cfeebd9a8da4f55522b86ddb3b0bc3b16ef0 /test | |
parent | 1f4d3ea561909c3aa905ae58efd5963e8852d689 (diff) |
Fix the checks of EVP_PKEY_private_check
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/18424)
(cherry picked from commit babc818c3f669214fa192229003953e3dead1926)
Diffstat (limited to 'test')
-rw-r--r-- | test/evp_pkey_provided_test.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/evp_pkey_provided_test.c b/test/evp_pkey_provided_test.c index 6ec473821f..8faf0838d0 100644 --- a/test/evp_pkey_provided_test.c +++ b/test/evp_pkey_provided_test.c @@ -398,7 +398,7 @@ static int test_fromdata_rsa(void) if (!TEST_int_gt(EVP_PKEY_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_public_check(key_ctx), 0) - || !TEST_true(EVP_PKEY_private_check(key_ctx)) + || !TEST_int_gt(EVP_PKEY_private_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_pairwise_check(key_ctx), 0)) goto err; @@ -662,7 +662,7 @@ static int test_fromdata_dh_named_group(void) if (!TEST_int_gt(EVP_PKEY_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_public_check(key_ctx), 0) - || !TEST_true(EVP_PKEY_private_check(key_ctx)) + || !TEST_int_gt(EVP_PKEY_private_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_pairwise_check(key_ctx), 0)) goto err; EVP_PKEY_CTX_free(key_ctx); @@ -843,7 +843,7 @@ static int test_fromdata_dh_fips186_4(void) if (!TEST_int_gt(EVP_PKEY_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_public_check(key_ctx), 0) - || !TEST_true(EVP_PKEY_private_check(key_ctx)) + || !TEST_int_gt(EVP_PKEY_private_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_pairwise_check(key_ctx), 0)) goto err; EVP_PKEY_CTX_free(key_ctx); @@ -1114,7 +1114,7 @@ static int test_fromdata_ecx(int tst) } else { /* The private key check should fail if there is only a public key */ if (!TEST_int_gt(EVP_PKEY_public_check(ctx2), 0) - || !TEST_false(EVP_PKEY_private_check(ctx2)) + || !TEST_int_le(EVP_PKEY_private_check(ctx2), 0) || !TEST_int_le(EVP_PKEY_check(ctx2), 0)) goto err; } @@ -1608,7 +1608,7 @@ static int test_fromdata_dsa_fips186_4(void) if (!TEST_int_gt(EVP_PKEY_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_public_check(key_ctx), 0) - || !TEST_true(EVP_PKEY_private_check(key_ctx)) + || !TEST_int_gt(EVP_PKEY_private_check(key_ctx), 0) || !TEST_int_gt(EVP_PKEY_pairwise_check(key_ctx), 0)) goto err; EVP_PKEY_CTX_free(key_ctx); @@ -1662,7 +1662,7 @@ static int test_check_dsa(void) if (!TEST_ptr(ctx = EVP_PKEY_CTX_new_from_name(NULL, "DSA", NULL)) || !TEST_int_le(EVP_PKEY_check(ctx), 0) || !TEST_int_le(EVP_PKEY_public_check(ctx), 0) - || !TEST_false(EVP_PKEY_private_check(ctx)) + || !TEST_int_le(EVP_PKEY_private_check(ctx), 0) || !TEST_int_le(EVP_PKEY_pairwise_check(ctx), 0)) goto err; |