mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
EVP_PKEY_paramgen_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/17030)
This commit is contained in:
parent
e2e5e72d5a
commit
6e0b05f300
@ -194,7 +194,7 @@ int dhparam_main(int argc, char **argv)
|
||||
"Generating %s parameters, %d bit long %sprime\n",
|
||||
alg, num, dsaparam ? "" : "safe ");
|
||||
|
||||
if (!EVP_PKEY_paramgen_init(ctx)) {
|
||||
if (EVP_PKEY_paramgen_init(ctx) <= 0) {
|
||||
BIO_printf(bio_err,
|
||||
"Error, unable to initialise %s parameters\n",
|
||||
alg);
|
||||
|
@ -340,7 +340,7 @@ static EVP_PKEY *dsa_paramgen(int L, int N)
|
||||
EVP_PKEY *param_key = NULL;
|
||||
|
||||
if (!TEST_ptr(paramgen_ctx = EVP_PKEY_CTX_new_from_name(libctx, "DSA", NULL))
|
||||
|| !TEST_true(EVP_PKEY_paramgen_init(paramgen_ctx))
|
||||
|| !TEST_int_gt(EVP_PKEY_paramgen_init(paramgen_ctx), 0)
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_bits(paramgen_ctx, L))
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_q_bits(paramgen_ctx, N))
|
||||
|| !TEST_true(EVP_PKEY_paramgen(paramgen_ctx, ¶m_key)))
|
||||
@ -416,7 +416,7 @@ static int dsa_paramgen_test(int id)
|
||||
const struct dsa_paramgen_st *tst = &dsa_paramgen_data[id];
|
||||
|
||||
if (!TEST_ptr(paramgen_ctx = EVP_PKEY_CTX_new_from_name(libctx, "DSA", NULL))
|
||||
|| !TEST_true(EVP_PKEY_paramgen_init(paramgen_ctx))
|
||||
|| !TEST_int_gt(EVP_PKEY_paramgen_init(paramgen_ctx), 0)
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_bits(paramgen_ctx, tst->L))
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_dsa_paramgen_q_bits(paramgen_ctx, tst->N))
|
||||
|| !TEST_true(EVP_PKEY_paramgen(paramgen_ctx, ¶m_key))
|
||||
|
@ -1695,7 +1695,7 @@ static int test_EC_keygen_with_enc(int idx)
|
||||
|
||||
/* Create key parameters */
|
||||
if (!TEST_ptr(pctx = EVP_PKEY_CTX_new_from_name(testctx, "EC", NULL))
|
||||
|| !TEST_true(EVP_PKEY_paramgen_init(pctx))
|
||||
|| !TEST_int_gt(EVP_PKEY_paramgen_init(pctx), 0)
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_group_name(pctx, "P-256"))
|
||||
|| !TEST_true(EVP_PKEY_CTX_set_ec_param_enc(pctx, enc))
|
||||
|| !TEST_true(EVP_PKEY_paramgen(pctx, ¶ms))
|
||||
|
Loading…
Reference in New Issue
Block a user