diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-01 08:15:32 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2023-07-01 08:15:32 +0000 |
commit | 7dd6a9d419211372f3cd47bc6b8e1e85de8e689a (patch) | |
tree | 8e2f87deaa270842a228239ddef0f9ba27db1af7 /lib/libcrypto/ec/ec_ameth.c | |
parent | 72793c499ea3de5123397d96a26aa95885f22b5e (diff) |
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
Diffstat (limited to 'lib/libcrypto/ec/ec_ameth.c')
-rw-r--r-- | lib/libcrypto/ec/ec_ameth.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c index e47dcbc7c05..45f51e9dd8e 100644 --- a/lib/libcrypto/ec/ec_ameth.c +++ b/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; |