aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl/openssl_ec.cpp
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-10-24 12:37:35 -0400
committerJack Lloyd <[email protected]>2016-10-24 12:37:35 -0400
commitc7e76399055c792b84071f22c490906576bd4027 (patch)
tree1e70ece726c42755573b876eae9b060337ef0e80 /src/lib/prov/openssl/openssl_ec.cpp
parentde54f69aa74d98664fb13b0097f61e17322bca04 (diff)
parent331f7d28de21170e74febae53a7f49732ad40256 (diff)
Merge GH #668: Remove Algo_Registry and associated global locks
Diffstat (limited to 'src/lib/prov/openssl/openssl_ec.cpp')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp25
1 files changed, 13 insertions, 12 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
index aee31ce71..7b20b1c73 100644
--- a/src/lib/prov/openssl/openssl_ec.cpp
+++ b/src/lib/prov/openssl/openssl_ec.cpp
@@ -67,19 +67,20 @@ int OpenSSL_EC_nid_for(const OID& oid)
if(oid.empty())
return -1;
- static const std::map<std::string, int> nid_map = {
- { "secp192r1", NID_X9_62_prime192v1 },
- { "secp224r1", NID_secp224r1 },
- { "secp256r1", NID_X9_62_prime256v1 },
- { "secp384r1", NID_secp384r1 },
- { "secp521r1", NID_secp521r1 },
- // TODO: OpenSSL 1.0.2 added brainpool curves
- };
-
const std::string name = OIDS::lookup(oid);
- auto i = nid_map.find(name);
- if(i != nid_map.end())
- return i->second;
+
+ if(name == "secp192r1")
+ return NID_X9_62_prime192v1;
+ if(name == "secp224r1")
+ return NID_secp224r1;
+ if(name == "secp256r1")
+ return NID_X9_62_prime256v1;
+ if(name == "secp384r1")
+ return NID_secp384r1;
+ if(name == "secp521r1")
+ return NID_secp521r1;
+
+ // TODO: OpenSSL 1.0.2 added brainpool curves
return -1;
}