summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_ameth.c
diff options
context:
space:
mode:
authorTim Hudson <tjh@openssl.org>2016-09-10 06:53:33 +1000
committerTim Hudson <tjh@openssl.org>2016-09-10 07:04:42 +1000
commit718951c2f2bd0065425e560584eee89ec65d22a5 (patch)
tree2965c7e8190eb8047e8f39c54f5f01f520df9f49 /crypto/ec/ec_ameth.c
parent0adfd49e47b08df699c941efef01b88d12b4a060 (diff)
Fix EC_KEY_print so it prints out private key information
even when the public key is not present in an EC_KEY Reviewed-by: Stephen Henson <steve@openssl.org> (cherry picked from commit 82f52631b21b021787f344733e08bb53f1e7f0ec)
Diffstat (limited to 'crypto/ec/ec_ameth.c')
-rw-r--r--crypto/ec/ec_ameth.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ec/ec_ameth.c b/crypto/ec/ec_ameth.c
index 9792007a20..66437e0da5 100644
--- a/crypto/ec/ec_ameth.c
+++ b/crypto/ec/ec_ameth.c
@@ -345,7 +345,7 @@ static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, ec_print_t ktype)
return 0;
}
- if (ktype != EC_KEY_PRINT_PARAM) {
+ if (ktype != EC_KEY_PRINT_PARAM && EC_KEY_get0_public_key(x) != NULL) {
publen = EC_KEY_key2buf(x, EC_KEY_get_conv_form(x), &pub, NULL);
if (publen == 0)
goto err;