diff options
| author | tb <> | 2023-07-01 08:15:31 +0000 |
|---|---|---|
| committer | tb <> | 2023-07-01 08:15:31 +0000 |
| commit | bd7bccfb2c9f1e8e7fc579eeada0cd974fc86288 (patch) | |
| tree | 8162c514896bec506dd2ac9a1aeafe802bd4b38d /src/lib/libcrypto/ec/ec_ameth.c | |
| parent | 42667117575942e586641155aedeb571db5e3d43 (diff) | |
| download | openbsd-bd7bccfb2c9f1e8e7fc579eeada0cd974fc86288.tar.gz openbsd-bd7bccfb2c9f1e8e7fc579eeada0cd974fc86288.tar.bz2 openbsd-bd7bccfb2c9f1e8e7fc579eeada0cd974fc86288.zip | |
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 'src/lib/libcrypto/ec/ec_ameth.c')
| -rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 8 |
1 files changed, 3 insertions, 5 deletions
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 @@ | |||
| 1 | /* $OpenBSD: ec_ameth.c,v 1.38 2023/03/07 07:01:35 tb Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.39 2023/07/01 08:15:31 tb Exp $ */ |
| 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
| 3 | * project 2006. | 3 | * project 2006. |
| 4 | */ | 4 | */ |
| @@ -500,11 +500,9 @@ do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype) | |||
| 500 | BN_num_bits(order)) <= 0) | 500 | BN_num_bits(order)) <= 0) |
| 501 | goto err; | 501 | goto err; |
| 502 | 502 | ||
| 503 | if ((priv_key != NULL) && !ASN1_bn_print(bp, "priv:", priv_key, | 503 | if (!ASN1_bn_print(bp, "priv:", priv_key, buffer, off)) |
| 504 | buffer, off)) | ||
| 505 | goto err; | 504 | goto err; |
| 506 | if ((pub_key != NULL) && !ASN1_bn_print(bp, "pub: ", pub_key, | 505 | if (!ASN1_bn_print(bp, "pub: ", pub_key, buffer, off)) |
| 507 | buffer, off)) | ||
| 508 | goto err; | 506 | goto err; |
| 509 | if (!ECPKParameters_print(bp, group, off)) | 507 | if (!ECPKParameters_print(bp, group, off)) |
| 510 | goto err; | 508 | goto err; |
