diff options
author | Jack Lloyd <[email protected]> | 2015-10-19 19:25:28 -0400 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2015-10-19 19:25:28 -0400 |
commit | dbe3754faf68687ccf58743d6f500d36e6419e77 (patch) | |
tree | 7e9e0a0849fc7c3f1b7e90c8723130cbe08d4f82 /src/lib/utils | |
parent | b1afb8dbc759653fb53631ff92f7afce6cc9de98 (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.
Diffstat (limited to 'src/lib/utils')
-rw-r--r-- | src/lib/utils/openssl/info.txt | 16 | ||||
-rw-r--r-- | src/lib/utils/openssl/openssl.h | 35 |
2 files changed, 51 insertions, 0 deletions
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/utils/openssl/openssl.h b/src/lib/utils/openssl/openssl.h new file mode 100644 index 000000000..022db6223 --- /dev/null +++ b/src/lib/utils/openssl/openssl.h @@ -0,0 +1,35 @@ +/* +* Utils for calling OpenSSL +* (C) 2015 Jack Lloyd +* +* Botan is released under the Simplified BSD License (see license.txt) +*/ + +#ifndef BOTAN_OPENSSL_H__ +#define BOTAN_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)) {} + }; + +#define BOTAN_OPENSSL_BLOCK_PRIO 150 +#define BOTAN_OPENSSL_HASH_PRIO 150 +#define BOTAN_OPENSSL_RC4_PRIO 150 + +#define BOTAN_OPENSSL_RSA_PRIO 150 +#define BOTAN_OPENSSL_ECDSA_PRIO 150 + +} + +#endif |