aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/ec/eck_prn.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2012-02-21 14:41:13 +0000
committerDr. Stephen Henson <steve@openssl.org>2012-02-21 14:41:13 +0000
commit64095ce9d7c0613b0b45fe8015b4514116afdec0 (patch)
treef4ca204e5d0192db238ab9e3fb164cd50e72318c /crypto/ec/eck_prn.c
parent206310c3056847fef7e657879f05a09763c2131e (diff)
downloadopenssl-64095ce9d7c0613b0b45fe8015b4514116afdec0.tar.gz
Add new APIs EC_curve_nist2nid and EC_curve_nid2nist which convert
between NIDs and the more common NIST names such as "P-256". Enhance ecparam utility and ECC method to recognise the NIST names for curves.
Diffstat (limited to 'crypto/ec/eck_prn.c')
-rw-r--r--crypto/ec/eck_prn.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/crypto/ec/eck_prn.c b/crypto/ec/eck_prn.c
index 06de8f3959..39ce97862d 100644
--- a/crypto/ec/eck_prn.c
+++ b/crypto/ec/eck_prn.c
@@ -177,6 +177,7 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
{
/* the curve parameter are given by an asn1 OID */
int nid;
+ const char *nname;
if (!BIO_indent(bp, off, 128))
goto err;
@@ -184,11 +185,18 @@ int ECPKParameters_print(BIO *bp, const EC_GROUP *x, int off)
nid = EC_GROUP_get_curve_name(x);
if (nid == 0)
goto err;
-
if (BIO_printf(bp, "ASN1 OID: %s", OBJ_nid2sn(nid)) <= 0)
goto err;
if (BIO_printf(bp, "\n") <= 0)
goto err;
+ nname = EC_curve_nid2nist(nid);
+ if (nname)
+ {
+ if (!BIO_indent(bp, off, 128))
+ goto err;
+ if (BIO_printf(bp, "NIST CURVE: %s\n", nname) <= 0)
+ goto err;
+ }
}
else
{