aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/prov/openssl
diff options
context:
space:
mode:
authorAlexander Bluhm <[email protected]>2017-05-24 19:03:25 +0200
committerAlexander Bluhm <[email protected]>2017-05-24 19:19:15 +0200
commitfb22884637cd15e746dbb53864284a7ee71b6a77 (patch)
treea026a2910022b79f69493cd2c33a5983dd9721ef /src/lib/prov/openssl
parent51abe0773f6e96f19500ab6e6c25464e3ef8122f (diff)
Make Botan compile with LibreSSL again.
Add some #ifdef LIBRESSL_VERSION_NUMBER in addition to the OPENSSL_VERSION_NUMBER switch. Narrow down API compatiblity between LibreSSL and OpenSSL version in docs.
Diffstat (limited to 'src/lib/prov/openssl')
-rw-r--r--src/lib/prov/openssl/openssl_ec.cpp4
-rw-r--r--src/lib/prov/openssl/openssl_hash.cpp4
-rw-r--r--src/lib/prov/openssl/openssl_rsa.cpp4
3 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/prov/openssl/openssl_ec.cpp b/src/lib/prov/openssl/openssl_ec.cpp
index 0b23fa5e3..1d434e6f6 100644
--- a/src/lib/prov/openssl/openssl_ec.cpp
+++ b/src/lib/prov/openssl/openssl_ec.cpp
@@ -153,7 +153,7 @@ class OpenSSL_ECDSA_Verification_Operation : public PK_Ops::Verification_with_EM
if(r == nullptr || s == nullptr)
throw OpenSSL_Error("BN_bin2bn sig s");
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
sig->r = r;
sig->s = s;
#else
@@ -199,7 +199,7 @@ class OpenSSL_ECDSA_Signing_Operation : public PK_Ops::Signature_with_EMSA
const size_t order_bytes = (m_order_bits + 7) / 8;
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
const BIGNUM* r = sig->r;
const BIGNUM* s = sig->s;
#else
diff --git a/src/lib/prov/openssl/openssl_hash.cpp b/src/lib/prov/openssl/openssl_hash.cpp
index 4b3e01ac5..d7a8014a8 100644
--- a/src/lib/prov/openssl/openssl_hash.cpp
+++ b/src/lib/prov/openssl/openssl_hash.cpp
@@ -52,7 +52,7 @@ class OpenSSL_HashFunction : public HashFunction
OpenSSL_HashFunction(const std::string& name, const EVP_MD* md) : m_name(name)
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
m_md = EVP_MD_CTX_create();
#else
m_md = EVP_MD_CTX_new();
@@ -69,7 +69,7 @@ class OpenSSL_HashFunction : public HashFunction
~OpenSSL_HashFunction()
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
EVP_MD_CTX_destroy(m_md);
#else
EVP_MD_CTX_free(m_md);
diff --git a/src/lib/prov/openssl/openssl_rsa.cpp b/src/lib/prov/openssl/openssl_rsa.cpp
index f8b2b82d6..58a09cb0d 100644
--- a/src/lib/prov/openssl/openssl_rsa.cpp
+++ b/src/lib/prov/openssl/openssl_rsa.cpp
@@ -154,7 +154,7 @@ class OpenSSL_RSA_Verification_Operation : public PK_Ops::Verification_with_EMSA
size_t max_input_bits() const override
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
return ::BN_num_bits(m_openssl_rsa->n) - 1;
#else
return ::RSA_bits(m_openssl_rsa.get()) - 1;
@@ -224,7 +224,7 @@ class OpenSSL_RSA_Signing_Operation : public PK_Ops::Signature_with_EMSA
size_t max_input_bits() const override
{
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
return ::BN_num_bits(m_openssl_rsa->n) - 1;
#else
return ::RSA_bits(m_openssl_rsa.get()) - 1;