aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-12-17 21:10:16 -0500
committerJack Lloyd <[email protected]>2016-12-17 21:10:16 -0500
commit228d325af7bc42b45b24d98c4b05a449617deacc (patch)
treec96b92265baa0d9b9ea54af501cf2bfed304cac9 /src
parent04da65d697dd0e967153cf0c24302107591a13f5 (diff)
parentc739f26d315fc5b2e5fddcf094d0dfd4b9e36f70 (diff)
Merge GH #776 Support brainpool curves in OpenSSL provider
Diffstat (limited to 'src')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
index 51d24a119..5fe7865a1 100644
--- a/src/lib/prov/openssl/openssl_ec.cpp
+++ b/src/lib/prov/openssl/openssl_ec.cpp
@@ -80,7 +80,23 @@ int OpenSSL_EC_nid_for(const OID& oid)
if(name == "secp521r1")
return NID_secp521r1;
- // TODO: OpenSSL 1.0.2 added brainpool curves
+ // OpenSSL 1.0.2 added brainpool curves
+#if OPENSSL_VERSION_NUMBER >= 0x1000200fL
+ if(name == "brainpool160r1")
+ return NID_brainpoolP160r1;
+ if(name == "brainpool192r1")
+ return NID_brainpoolP192r1;
+ if(name == "brainpool224r1")
+ return NID_brainpoolP224r1;
+ if(name == "brainpool256r1")
+ return NID_brainpoolP256r1;
+ if(name == "brainpool320r1")
+ return NID_brainpoolP320r1;
+ if(name == "brainpool384r1")
+ return NID_brainpoolP384r1;
+ if(name == "brainpool512r1")
+ return NID_brainpoolP512r1;
+#endif
return -1;
}