diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2021-11-15 00:05:04 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2021-11-16 17:33:14 +0100 |
commit | bf4ceeded1497c79e72fba4f9ff15febae58108d (patch) | |
tree | 43f9440ff190f53d5a5f3f89d7055f358613eb1b /test/evp_extra_test.c | |
parent | 6e0b05f3008a3f22105fd2bed9314b0bfa381f93 (diff) |
EVP_PKEY_keygen_init: fix return check
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17031)
Diffstat (limited to 'test/evp_extra_test.c')
-rw-r--r-- | test/evp_extra_test.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/evp_extra_test.c b/test/evp_extra_test.c index 8d053ddc93..7026753965 100644 --- a/test/evp_extra_test.c +++ b/test/evp_extra_test.c @@ -1704,7 +1704,7 @@ static int test_EC_keygen_with_enc(int idx) /* Create key */ if (!TEST_ptr(kctx = EVP_PKEY_CTX_new_from_pkey(testctx, params, NULL)) - || !TEST_true(EVP_PKEY_keygen_init(kctx)) + || !TEST_int_gt(EVP_PKEY_keygen_init(kctx), 0) || !TEST_true(EVP_PKEY_keygen(kctx, &key)) || !TEST_ptr(key)) goto done; @@ -1844,7 +1844,7 @@ static int test_EVP_SM2(void) pkeyparams, testpropq))) goto done; - if (!TEST_true(EVP_PKEY_keygen_init(kctx))) + if (!TEST_int_gt(EVP_PKEY_keygen_init(kctx), 0)) goto done; if (!TEST_true(EVP_PKEY_keygen(kctx, &pkey))) @@ -3218,7 +3218,7 @@ static int test_ecpub(int idx) ctx = EVP_PKEY_CTX_new_id(EVP_PKEY_EC, NULL); if (!TEST_ptr(ctx) - || !TEST_true(EVP_PKEY_keygen_init(ctx)) + || !TEST_int_gt(EVP_PKEY_keygen_init(ctx), 0) || !TEST_true(EVP_PKEY_CTX_set_ec_paramgen_curve_nid(ctx, nid)) || !TEST_true(EVP_PKEY_keygen(ctx, &pkey))) goto done; @@ -3272,7 +3272,7 @@ static int test_EVP_rsa_pss_with_keygen_bits(void) md = EVP_MD_fetch(testctx, "sha256", testpropq); ret = TEST_ptr(md) && TEST_ptr((ctx = EVP_PKEY_CTX_new_from_name(testctx, "RSA", testpropq))) - && TEST_true(EVP_PKEY_keygen_init(ctx)) + && TEST_int_gt(EVP_PKEY_keygen_init(ctx), 0) && TEST_int_gt(EVP_PKEY_CTX_set_rsa_keygen_bits(ctx, 512), 0) && TEST_true(EVP_PKEY_CTX_set_rsa_pss_keygen_md(ctx, md)) && TEST_true(EVP_PKEY_keygen(ctx, &pkey)); |