summaryrefslogtreecommitdiffstats
path: root/crypto/ec/ec_pmeth.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/ec_pmeth.c
parent206310c3056847fef7e657879f05a09763c2131e (diff)
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/ec_pmeth.c')
-rw-r--r--crypto/ec/ec_pmeth.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/ec/ec_pmeth.c b/crypto/ec/ec_pmeth.c
index 66ee397d86..b85f772be3 100644
--- a/crypto/ec/ec_pmeth.c
+++ b/crypto/ec/ec_pmeth.c
@@ -252,7 +252,9 @@ static int pkey_ec_ctrl_str(EVP_PKEY_CTX *ctx,
if (!strcmp(type, "ec_paramgen_curve"))
{
int nid;
- nid = OBJ_sn2nid(value);
+ nid = EC_curve_nist2nid(value);
+ if (nid == NID_undef)
+ nid = OBJ_sn2nid(value);
if (nid == NID_undef)
nid = OBJ_ln2nid(value);
if (nid == NID_undef)