X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=apps%2Fecparam.c;h=010e214e5711bb616ea08ff24a979333cf30f9ae;hp=3bd0a974873b32cc7b101ccc76ba7ce16586c1f6;hb=d745af4b0cc5d37ffa662aa04dcbfb2855c0f034;hpb=44ea41cfff77ede56a56931d7851e5a806fb44b1 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) {