EC: Refactor ec_curve_name2nid() to accept NIST curve names
authorRichard Levitte <levitte@openssl.org>
Tue, 24 Mar 2020 10:18:50 +0000 (11:18 +0100)
committerRichard Levitte <levitte@openssl.org>
Wed, 25 Mar 2020 13:31:48 +0000 (14:31 +0100)
commit5036dc67d0f61a5c62ed3c45405648e7dc0d4d0a
tree44e85e14a366b994afdca57ce13f287154c053a0
parent7e765f46a6b3a5b2fc48e10657bea7016e5c5e4b
EC: Refactor ec_curve_name2nid() to accept NIST curve names

We can find no reason why everyone should have to call both
EC_curve_nist2nid() and ec_curve_name2nid() to find the NID for a
name, and it's too easy to forget EC_curve_nist2nid(), so we make life
simpler.

One could argue that FIPS only allows a limited set of names, but that
now gets handled internally, and those who really want to be really
sure to only get the NIST names can still do so with EC_curve_nist2nid()

Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/11391)
crypto/ec/ec_curve.c