aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-08-29 07:55:30 -0400
committerJack Lloyd <[email protected]>2015-08-29 07:55:30 -0400
commitd9de3157bc1d06c4f5f250b5b7ef635474973c85 (patch)
tree405f1dd8f59466b65a9901a8595a5c6a4599c1bd
parent6efa5a930c3f75b9203c27303448e602f8bc781c (diff)
Fix minimized builds and amalgamation builds
No need to include the pk_utils.h header until we know ECDSA is enabled in the build. Move OpenSSL_Error to an internal header, was previously defined twice when all sources were combined.
-rw-r--r--src/lib/vendor/openssl/info.txt4
-rw-r--r--src/lib/vendor/openssl/openssl.h28
-rw-r--r--src/lib/vendor/openssl/openssl_ecdsa.cpp15
-rw-r--r--src/lib/vendor/openssl/openssl_rsa.cpp9
4 files changed, 35 insertions, 21 deletions
diff --git a/src/lib/vendor/openssl/info.txt b/src/lib/vendor/openssl/info.txt
index a1faac3e3..0ca78a88e 100644
--- a/src/lib/vendor/openssl/info.txt
+++ b/src/lib/vendor/openssl/info.txt
@@ -1,5 +1,9 @@
load_on vendor
+<header:internal>
+openssl.h
+</header:internal>
+
<libs>
all -> crypto
</libs>
diff --git a/src/lib/vendor/openssl/openssl.h b/src/lib/vendor/openssl/openssl.h
new file mode 100644
index 000000000..1ffaed519
--- /dev/null
+++ b/src/lib/vendor/openssl/openssl.h
@@ -0,0 +1,28 @@
+/*
+* Utils for calling OpenSSL
+* (C) 2015 Jack Lloyd
+*
+* Botan is released under the Simplified BSD License (see license.txt)
+*/
+
+#ifndef BOTAN_CALL_OPENSSL_H__
+#define BOTAN_CALL_OPENSSL_H__
+
+#include <botan/secmem.h>
+#include <botan/exceptn.h>
+#include <memory>
+
+#include <openssl/err.h>
+
+namespace Botan {
+
+class OpenSSL_Error : public Exception
+ {
+ public:
+ OpenSSL_Error(const std::string& what) :
+ Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {}
+ };
+
+}
+
+#endif
diff --git a/src/lib/vendor/openssl/openssl_ecdsa.cpp b/src/lib/vendor/openssl/openssl_ecdsa.cpp
index 9016986da..9031944d4 100644
--- a/src/lib/vendor/openssl/openssl_ecdsa.cpp
+++ b/src/lib/vendor/openssl/openssl_ecdsa.cpp
@@ -5,13 +5,8 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/build.h>
-#include <botan/internal/pk_utils.h>
-#include <functional>
-#include <memory>
-
+#include <botan/internal/openssl.h>
#include <openssl/x509.h>
-#include <openssl/err.h>
#if defined(BOTAN_HAS_ECDSA) && !defined(OPENSSL_NO_ECDSA)
@@ -19,6 +14,7 @@
#include <botan/ecdsa.h>
#include <botan/pkcs8.h>
#include <botan/oids.h>
+#include <botan/internal/pk_utils.h>
#include <openssl/ecdsa.h>
#include <openssl/ec.h>
@@ -47,13 +43,6 @@ secure_vector<byte> PKCS8_for_openssl(const EC_PrivateKey& ec)
.get_contents();
}
-class OpenSSL_Error : public Exception
- {
- public:
- OpenSSL_Error(const std::string& what) :
- Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {}
- };
-
int OpenSSL_EC_nid_for(const OID& oid)
{
if(oid.empty())
diff --git a/src/lib/vendor/openssl/openssl_rsa.cpp b/src/lib/vendor/openssl/openssl_rsa.cpp
index ef86bf91a..ad2e47683 100644
--- a/src/lib/vendor/openssl/openssl_rsa.cpp
+++ b/src/lib/vendor/openssl/openssl_rsa.cpp
@@ -5,7 +5,7 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/build.h>
+#include <botan/internal/openssl.h>
#if defined(BOTAN_HAS_RSA)
@@ -34,13 +34,6 @@ std::pair<int, size_t> get_openssl_enc_pad(const std::string& eme)
throw Lookup_Error("OpenSSL RSA does not support EME " + eme);
}
-class OpenSSL_Error : public Exception
- {
- public:
- OpenSSL_Error(const std::string& what) :
- Exception(what + " failed: " + ERR_error_string(ERR_get_error(), nullptr)) {}
- };
-
class OpenSSL_RSA_Encryption_Operation : public PK_Ops::Encryption
{
public: