summaryrefslogtreecommitdiffstats
path: root/apps/ecparam.c
diff options
context:
space:
mode:
authorBodo Möller <bodo@openssl.org>2003-01-16 16:05:23 +0000
committerBodo Möller <bodo@openssl.org>2003-01-16 16:05:23 +0000
commitd745af4b0cc5d37ffa662aa04dcbfb2855c0f034 (patch)
treed494f1940d1ae6c4691144e6a3169da692165b01 /apps/ecparam.c
parent44ea41cfff77ede56a56931d7851e5a806fb44b1 (diff)
avoid potential confusion about curves (prime192v1 and prime256v1 are
also known as secp192r1 and secp256r1, respectively) Submitted by: Nils Larsch, Bodo Moeller
Diffstat (limited to 'apps/ecparam.c')
-rw-r--r--apps/ecparam.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/apps/ecparam.c b/apps/ecparam.c
index 3bd0a97487..010e214e57 100644
--- a/apps/ecparam.c
+++ b/apps/ecparam.c
@@ -383,7 +383,26 @@ bad:
if (curve_name != NULL)
{
- int nid = OBJ_sn2nid(curve_name);
+ int nid;
+
+ /* workaround for the SECG curve names secp192r1
+ * and secp256r1 (which are the same as the curves
+ * prime192v1 and prime256v1 defined in X9.62)
+ */
+ if (!strcmp(curve_name, "secp192r1"))
+ {
+ BIO_printf(bio_err, "using curve name prime192v1 "
+ "instead of secp192r1\n");
+ nid = NID_X9_62_prime192v1;
+ }
+ else if (!strcmp(curve_name, "secp256r1"))
+ {
+ BIO_printf(bio_err, "using curve name prime256v1 "
+ "instead of secp256r1\n");
+ nid = NID_X9_62_prime256v1;
+ }
+ else
+ nid = OBJ_sn2nid(curve_name);
if (nid == 0)
{