aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2016-09-14 18:02:49 -0400
committerJack Lloyd <[email protected]>2016-10-07 19:27:58 -0400
commitfc03b27a44e83901a6fe319d783e2af41e162367 (patch)
tree6649d8a8aa20ca6758eab752f9383c83f9defd25 /src
parent239bdf36a617df86dc97efb11ec96d7c6d357534 (diff)
OpenSSL fixes
Diffstat (limited to 'src')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp6
-rw-r--r--src/lib/prov/openssl/openssl_rsa.cpp2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
index 6593ba129..e127d749b 100644
--- a/src/lib/prov/openssl/openssl_ec.cpp
+++ b/src/lib/prov/openssl/openssl_ec.cpp
@@ -273,12 +273,12 @@ std::unique_ptr<PK_Ops::Key_Agreement>
make_openssl_ecdh_ka_op(const ECDH_PrivateKey& key, const std::string& params)
{
const int nid = OpenSSL_EC_nid_for(key.domain().get_oid());
- if(nid > 0)
+ if(nid == 0)
{
- return std::unique_ptr<PK_Ops::Key_Agreement>(new OpenSSL_ECDH_KA_Operation(key, params));
+ throw Lookup_Error("OpenSSL ECDH does not support this curve");
}
- return {};
+ return std::unique_ptr<PK_Ops::Key_Agreement>(new OpenSSL_ECDH_KA_Operation(key, params));
}
#endif
diff --git a/src/lib/prov/openssl/openssl_rsa.cpp b/src/lib/prov/openssl/openssl_rsa.cpp
index defa566f0..ae3f1cce2 100644
--- a/src/lib/prov/openssl/openssl_rsa.cpp
+++ b/src/lib/prov/openssl/openssl_rsa.cpp
@@ -31,7 +31,7 @@ std::pair<int, size_t> get_openssl_enc_pad(const std::string& eme)
return std::make_pair(RSA_NO_PADDING, 0);
else if(eme == "EME-PKCS1-v1_5")
return std::make_pair(RSA_PKCS1_PADDING, 11);
- else if(eme == "OAEP(SHA-1)")
+ else if(eme == "OAEP(SHA-1)" || eme == "EME1(SHA-1)")
return std::make_pair(RSA_PKCS1_OAEP_PADDING, 41);
else
throw Lookup_Error("OpenSSL RSA does not support EME " + eme);