From: Tim Hudson Date: Fri, 9 Sep 2016 20:53:33 +0000 (+1000) Subject: Fix EC_KEY_print so it prints out private key information X-Git-Tag: OpenSSL_1_1_1-pre1~3574 X-Git-Url: https://git.openssl.org/?p=openssl.git;a=commitdiff_plain;h=82f52631b21b021787f344733e08bb53f1e7f0ec 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 --- 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;