diff options
author | Bodo Möller <bodo@openssl.org> | 2003-01-16 17:05:23 +0100 |
---|---|---|
committer | Bodo Möller <bodo@openssl.org> | 2003-01-16 17:05:23 +0100 |
commit | d745af4b0cc5d37ffa662aa04dcbfb2855c0f034 (patch) | |
tree | d494f1940d1ae6c4691144e6a3169da692165b01 /apps | |
parent | make update (diff) | |
download | openssl-d745af4b0cc5d37ffa662aa04dcbfb2855c0f034.tar.xz openssl-d745af4b0cc5d37ffa662aa04dcbfb2855c0f034.zip |
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')
-rw-r--r-- | apps/ecparam.c | 21 |
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) { |