summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjsing <>2015-06-20 14:19:39 +0000
committerjsing <>2015-06-20 14:19:39 +0000
commite7d127f236d90dac15f77aaf82102435d5789117 (patch)
treef3f5da23e1738b131b2e0023091884eb0486ad12
parenta3c861524df1287716573ed93beb78825e335694 (diff)
downloadopenbsd-e7d127f236d90dac15f77aaf82102435d5789117.tar.gz
openbsd-e7d127f236d90dac15f77aaf82102435d5789117.tar.bz2
openbsd-e7d127f236d90dac15f77aaf82102435d5789117.zip
Handle NIST curve names.
From OpenSSL. ok miod@ (a while ago)
-rw-r--r--src/lib/libcrypto/ec/ec_pmeth.c6
-rw-r--r--src/lib/libssl/src/crypto/ec/ec_pmeth.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ec/ec_pmeth.c b/src/lib/libcrypto/ec/ec_pmeth.c
index 07933dc5fd..a52bff1f2f 100644
--- a/src/lib/libcrypto/ec/ec_pmeth.c
+++ b/src/lib/libcrypto/ec/ec_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_pmeth.c,v 1.8 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: ec_pmeth.c,v 1.9 2015/06/20 14:19:39 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -248,7 +248,9 @@ pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx,
248{ 248{
249 if (!strcmp(type, "ec_paramgen_curve")) { 249 if (!strcmp(type, "ec_paramgen_curve")) {
250 int nid; 250 int nid;
251 nid = OBJ_sn2nid(value); 251 nid = EC_curve_nist2nid(value);
252 if (nid == NID_undef)
253 nid = OBJ_sn2nid(value);
252 if (nid == NID_undef) 254 if (nid == NID_undef)
253 nid = OBJ_ln2nid(value); 255 nid = OBJ_ln2nid(value);
254 if (nid == NID_undef) { 256 if (nid == NID_undef) {
diff --git a/src/lib/libssl/src/crypto/ec/ec_pmeth.c b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
index 07933dc5fd..a52bff1f2f 100644
--- a/src/lib/libssl/src/crypto/ec/ec_pmeth.c
+++ b/src/lib/libssl/src/crypto/ec/ec_pmeth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_pmeth.c,v 1.8 2014/07/12 16:03:37 miod Exp $ */ 1/* $OpenBSD: ec_pmeth.c,v 1.9 2015/06/20 14:19:39 jsing Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -248,7 +248,9 @@ pkey_ec_ctrl_str(EVP_PKEY_CTX * ctx,
248{ 248{
249 if (!strcmp(type, "ec_paramgen_curve")) { 249 if (!strcmp(type, "ec_paramgen_curve")) {
250 int nid; 250 int nid;
251 nid = OBJ_sn2nid(value); 251 nid = EC_curve_nist2nid(value);
252 if (nid == NID_undef)
253 nid = OBJ_sn2nid(value);
252 if (nid == NID_undef) 254 if (nid == NID_undef)
253 nid = OBJ_ln2nid(value); 255 nid = OBJ_ln2nid(value);
254 if (nid == NID_undef) { 256 if (nid == NID_undef) {