aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Lloyd <[email protected]>2015-10-19 19:25:28 -0400
committerJack Lloyd <[email protected]>2015-10-19 19:25:28 -0400
commitdbe3754faf68687ccf58743d6f500d36e6419e77 (patch)
tree7e9e0a0849fc7c3f1b7e90c8723130cbe08d4f82
parentb1afb8dbc759653fb53631ff92f7afce6cc9de98 (diff)
Break up openssl provider
For RSA, RC4, and ECDSA put the openssl versions in the same directory as the base version. They just rely on a macro check for the openssl module to test for the desire to use OpenSSL.
-rw-r--r--src/lib/block/openssl_block/info.txt5
-rw-r--r--src/lib/block/openssl_block/openssl_block.cpp (renamed from src/lib/vendor/openssl/openssl_block.cpp)2
-rw-r--r--src/lib/hash/openssl_hash/info.txt5
-rw-r--r--src/lib/hash/openssl_hash/openssl_hash.cpp (renamed from src/lib/vendor/openssl/openssl_hash.cpp)0
-rw-r--r--src/lib/pubkey/ecdsa/openssl_ecdsa.cpp (renamed from src/lib/vendor/openssl/openssl_ecdsa.cpp)10
-rw-r--r--src/lib/pubkey/rsa/openssl_rsa.cpp (renamed from src/lib/vendor/openssl/openssl_rsa.cpp)10
-rw-r--r--src/lib/stream/rc4/openssl_rc4.cpp (renamed from src/lib/vendor/openssl/openssl_rc4.cpp)5
-rw-r--r--src/lib/utils/openssl/info.txt16
-rw-r--r--src/lib/utils/openssl/openssl.h (renamed from src/lib/vendor/openssl/openssl.h)5
-rw-r--r--src/lib/vendor/openssl/info.txt11
10 files changed, 46 insertions, 23 deletions
diff --git a/src/lib/block/openssl_block/info.txt b/src/lib/block/openssl_block/info.txt
new file mode 100644
index 000000000..62feaac95
--- /dev/null
+++ b/src/lib/block/openssl_block/info.txt
@@ -0,0 +1,5 @@
+define OPENSSL_BLOCK_CIPHER 20151019
+
+<requires>
+openssl
+</requires>
diff --git a/src/lib/vendor/openssl/openssl_block.cpp b/src/lib/block/openssl_block/openssl_block.cpp
index 5c28f46b1..a35919e3a 100644
--- a/src/lib/vendor/openssl/openssl_block.cpp
+++ b/src/lib/block/openssl_block/openssl_block.cpp
@@ -167,8 +167,6 @@ make_evp_block_maker_keylen(const EVP_CIPHER* cipher, const char* algo,
};
}
-#define BOTAN_OPENSSL_BLOCK_PRIO 150
-
#define BOTAN_REGISTER_OPENSSL_EVP_BLOCK(NAME, EVP) \
BOTAN_REGISTER_TYPE(BlockCipher, EVP_BlockCipher ## EVP, NAME, \
make_evp_block_maker(EVP(), NAME), "openssl", BOTAN_OPENSSL_BLOCK_PRIO);
diff --git a/src/lib/hash/openssl_hash/info.txt b/src/lib/hash/openssl_hash/info.txt
new file mode 100644
index 000000000..c375d272e
--- /dev/null
+++ b/src/lib/hash/openssl_hash/info.txt
@@ -0,0 +1,5 @@
+define OPENSSL_HASH_FUNCTION 20151019
+
+<requires>
+openssl
+</requires>
diff --git a/src/lib/vendor/openssl/openssl_hash.cpp b/src/lib/hash/openssl_hash/openssl_hash.cpp
index c89dd777d..c89dd777d 100644
--- a/src/lib/vendor/openssl/openssl_hash.cpp
+++ b/src/lib/hash/openssl_hash/openssl_hash.cpp
diff --git a/src/lib/vendor/openssl/openssl_ecdsa.cpp b/src/lib/pubkey/ecdsa/openssl_ecdsa.cpp
index 0651cc280..502702804 100644
--- a/src/lib/vendor/openssl/openssl_ecdsa.cpp
+++ b/src/lib/pubkey/ecdsa/openssl_ecdsa.cpp
@@ -5,10 +5,14 @@
* Botan is released under the Simplified BSD License (see license.txt)
*/
+#include <botan/build.h>
+
+#if defined(BOTAN_HAS_OPENSSL)
+
#include <botan/internal/openssl.h>
#include <openssl/x509.h>
-#if defined(BOTAN_HAS_ECDSA) && !defined(OPENSSL_NO_ECDSA)
+#if !defined(OPENSSL_NO_ECDSA)
#include <botan/der_enc.h>
#include <botan/ecdsa.h>
@@ -204,4 +208,6 @@ BOTAN_REGISTER_TYPE(PK_Ops::Signature, OpenSSL_ECDSA_Signing_Operation, "ECDSA",
}
-#endif // BOTAN_HAS_ECDSA && !OPENSSL_NO_ECDSA
+#endif
+
+#endif
diff --git a/src/lib/vendor/openssl/openssl_rsa.cpp b/src/lib/pubkey/rsa/openssl_rsa.cpp
index 3a7cd0dcf..f2825634a 100644
--- a/src/lib/vendor/openssl/openssl_rsa.cpp
+++ b/src/lib/pubkey/rsa/openssl_rsa.cpp
@@ -1,15 +1,15 @@
/*
-* OpenSSL RSA interface
+* RSA operations provided by OpenSSL
* (C) 2015 Jack Lloyd
*
* Botan is released under the Simplified BSD License (see license.txt)
*/
-#include <botan/internal/openssl.h>
+#include <botan/rsa.h>
-#if defined(BOTAN_HAS_RSA)
+#if defined(BOTAN_HAS_OPENSSL)
-#include <botan/rsa.h>
+#include <botan/internal/openssl.h>
#include <botan/internal/pk_utils.h>
#include <functional>
#include <memory>
@@ -294,4 +294,4 @@ BOTAN_REGISTER_TYPE(PK_Ops::Decryption, OpenSSL_RSA_Decryption_Operation, "RSA",
}
-#endif // BOTAN_HAS_RSA
+#endif // BOTAN_HAS_OPENSSL
diff --git a/src/lib/vendor/openssl/openssl_rc4.cpp b/src/lib/stream/rc4/openssl_rc4.cpp
index 1f5675095..e4f180a9b 100644
--- a/src/lib/vendor/openssl/openssl_rc4.cpp
+++ b/src/lib/stream/rc4/openssl_rc4.cpp
@@ -6,6 +6,9 @@
*/
#include <botan/stream_cipher.h>
+
+#if defined(BOTAN_HAS_OPENSSL)
+
#include <botan/internal/algo_registry.h>
#include <botan/internal/openssl.h>
#include <botan/parsing.h>
@@ -54,3 +57,5 @@ BOTAN_REGISTER_TYPE(StreamCipher, OpenSSL_RC4, "RC4", (make_new_T_1len<OpenSSL_R
"openssl", BOTAN_OPENSSL_RC4_PRIO);
}
+
+#endif
diff --git a/src/lib/utils/openssl/info.txt b/src/lib/utils/openssl/info.txt
new file mode 100644
index 000000000..13ea92cbf
--- /dev/null
+++ b/src/lib/utils/openssl/info.txt
@@ -0,0 +1,16 @@
+define OPENSSL 20150829
+
+# This base module doesn't have any code, but other code using openssl
+# rely on it either macro check for BOTAN_HAS_OPENSSL or a module
+# dependency on openssl to test for the existence of and desire to use
+# OpenSSL for certain operations.
+
+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/utils/openssl/openssl.h
index 86cc8fd35..022db6223 100644
--- a/src/lib/vendor/openssl/openssl.h
+++ b/src/lib/utils/openssl/openssl.h
@@ -27,9 +27,8 @@ class OpenSSL_Error : public Exception
#define BOTAN_OPENSSL_HASH_PRIO 150
#define BOTAN_OPENSSL_RC4_PRIO 150
-#define BOTAN_OPENSSL_RSA_PRIO 90
-#define BOTAN_OPENSSL_ECDSA_PRIO 90
-
+#define BOTAN_OPENSSL_RSA_PRIO 150
+#define BOTAN_OPENSSL_ECDSA_PRIO 150
}
diff --git a/src/lib/vendor/openssl/info.txt b/src/lib/vendor/openssl/info.txt
deleted file mode 100644
index 1381e2019..000000000
--- a/src/lib/vendor/openssl/info.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-define OPENSSL 20150829
-
-load_on vendor
-
-<header:internal>
-openssl.h
-</header:internal>
-
-<libs>
-all -> crypto
-</libs>