diff options
author | Peiwei Hu <jlu.hpw@foxmail.com> | 2022-05-24 23:57:33 +0800 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2022-06-02 11:06:41 +0200 |
commit | 2cba2e160d5b028e4a777e8038744a8bc4280629 (patch) | |
tree | 806dd88d75132a8b1b91c29c171f600885a75efe /apps | |
parent | 00d5193b688019a85d1bd0196f2837a4476394bb (diff) |
Fix the checks of EVP_PKEY_CTX_set/get_* functions
Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18399)
Diffstat (limited to 'apps')
-rw-r--r-- | apps/dhparam.c | 6 | ||||
-rw-r--r-- | apps/dsaparam.c | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/apps/dhparam.c b/apps/dhparam.c index b9ce418c61..764f7929d4 100644 --- a/apps/dhparam.c +++ b/apps/dhparam.c @@ -217,16 +217,16 @@ int dhparam_main(int argc, char **argv) } if (dsaparam) { - if (!EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num)) { + if (EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num) <= 0) { BIO_printf(bio_err, "Error, unable to set DSA prime length\n"); goto end; } } else { - if (!EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, num)) { + if (EVP_PKEY_CTX_set_dh_paramgen_prime_len(ctx, num) <= 0) { BIO_printf(bio_err, "Error, unable to set DH prime length\n"); goto end; } - if (!EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, g)) { + if (EVP_PKEY_CTX_set_dh_paramgen_generator(ctx, g) <= 0) { BIO_printf(bio_err, "Error, unable to set generator\n"); goto end; } diff --git a/apps/dsaparam.c b/apps/dsaparam.c index 7879db3866..1bc48fa7da 100644 --- a/apps/dsaparam.c +++ b/apps/dsaparam.c @@ -173,7 +173,7 @@ int dsaparam_main(int argc, char **argv) "Error, DSA key generation paramgen init failed\n"); goto end; } - if (!EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num)) { + if (EVP_PKEY_CTX_set_dsa_paramgen_bits(ctx, num) <= 0) { BIO_printf(bio_err, "Error, DSA key generation setting bit length failed\n"); goto end; |