|
@@ -512,7 +512,8 @@ static int ec_to_text(BIO *out, const void *key, int selection)
|
|
|
else if ((selection & OSSL_KEYMGMT_SELECT_PUBLIC_KEY) != 0)
|
|
|
type_label = "Public-Key";
|
|
|
else if ((selection & OSSL_KEYMGMT_SELECT_DOMAIN_PARAMETERS) != 0)
|
|
|
- type_label = "EC-Parameters";
|
|
|
+ if (EC_GROUP_get_curve_name(group) != NID_sm2)
|
|
|
+ type_label = "EC-Parameters";
|
|
|
|
|
|
if ((selection & OSSL_KEYMGMT_SELECT_PRIVATE_KEY) != 0) {
|
|
|
const BIGNUM *priv_key = EC_KEY_get0_private_key(ec);
|
|
@@ -538,8 +539,9 @@ static int ec_to_text(BIO *out, const void *key, int selection)
|
|
|
goto err;
|
|
|
}
|
|
|
|
|
|
- if (BIO_printf(out, "%s: (%d bit)\n", type_label,
|
|
|
- EC_GROUP_order_bits(group)) <= 0)
|
|
|
+ if (type_label != NULL
|
|
|
+ && BIO_printf(out, "%s: (%d bit)\n", type_label,
|
|
|
+ EC_GROUP_order_bits(group)) <= 0)
|
|
|
goto err;
|
|
|
if (priv != NULL
|
|
|
&& !print_labeled_buf(out, "priv:", priv, priv_len))
|