diff options
Diffstat (limited to 'src/lib/libcrypto/ec/ec_ameth.c')
-rw-r--r-- | src/lib/libcrypto/ec/ec_ameth.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c index 8d0cdb733b..0932f1e3c9 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.18 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: ec_ameth.c,v 1.19 2018/03/12 13:14:21 inoguchi 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 | */ |
@@ -433,13 +433,15 @@ do_EC_KEY_print(BIO * bp, const EC_KEY * x, int off, int ktype) | |||
433 | } | 433 | } |
434 | if (ktype > 0) { | 434 | if (ktype > 0) { |
435 | public_key = EC_KEY_get0_public_key(x); | 435 | public_key = EC_KEY_get0_public_key(x); |
436 | if ((pub_key = EC_POINT_point2bn(group, public_key, | 436 | if (public_key != NULL) { |
437 | if ((pub_key = EC_POINT_point2bn(group, public_key, | ||
437 | EC_KEY_get_conv_form(x), NULL, ctx)) == NULL) { | 438 | EC_KEY_get_conv_form(x), NULL, ctx)) == NULL) { |
438 | reason = ERR_R_EC_LIB; | 439 | reason = ERR_R_EC_LIB; |
439 | goto err; | 440 | goto err; |
441 | } | ||
442 | if (pub_key) | ||
443 | buf_len = (size_t) BN_num_bytes(pub_key); | ||
440 | } | 444 | } |
441 | if (pub_key) | ||
442 | buf_len = (size_t) BN_num_bytes(pub_key); | ||
443 | } | 445 | } |
444 | if (ktype == 2) { | 446 | if (ktype == 2) { |
445 | priv_key = EC_KEY_get0_private_key(x); | 447 | priv_key = EC_KEY_get0_private_key(x); |