aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl
diff options
context:
space:
mode:
authorRenĂ© Korthaus <[email protected]>2016-12-17 21:49:46 +0100
committerRenĂ© Korthaus <[email protected]>2016-12-17 21:49:46 +0100
commitc739f26d315fc5b2e5fddcf094d0dfd4b9e36f70 (patch)
tree0f7045e7bdb1898354150209a245af74b34c1a77 /src/lib/prov/openssl
parentb1c7393afebad5c6dad767b939c2861b186e469c (diff)
Add support for brainpool curves in openssl provider
OpenSSL 1.0.2 added support for brainpool curves, so we can use it provided the version check succeeds.
Diffstat (limited to 'src/lib/prov/openssl')
-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;
}