From bd7bccfb2c9f1e8e7fc579eeada0cd974fc86288 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sat, 1 Jul 2023 08:15:31 +0000 Subject: Simplify ASN1_bn_print() usage in ec/ ASN1_bn_print() doesn't print anything if the BIGNUM passed in is NULL. Also simplify the handling of the point conversion form of the generator. ok jsing --- src/lib/libcrypto/ec/ec_ameth.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/lib/libcrypto/ec/ec_ameth.c') diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index e47dcbc7c0..45f51e9dd8 100644 --- a/src/lib/libcrypto/ec/ec_ameth.c +++ b/src/lib/libcrypto/ec/ec_ameth.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ec_ameth.c,v 1.38 2023/03/07 07:01:35 tb Exp $ */ +/* $OpenBSD: ec_ameth.c,v 1.39 2023/07/01 08:15:31 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2006. */ @@ -500,11 +500,9 @@ do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) BN_num_bits(order)) <= 0) goto err; - if ((priv_key != NULL) && !ASN1_bn_print(bp, "priv:", priv_key, - buffer, off)) + if (!ASN1_bn_print(bp, "priv:", priv_key, buffer, off)) goto err; - if ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key, - buffer, off)) + if (!ASN1_bn_print(bp, "pub: ", pub_key, buffer, off)) goto err; if (!ECPKParameters_print(bp, group, off)) goto err; -- cgit v1.2.3-55-g6feb