From 1e3d66f8d3843b330ba0b31f700597113c54b3e0 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 22 Jun 2010 11:33:21 +0200 Subject: Fixing compilation of the OpenSSL plugin if ENGINE support is disabled. That is, enable compilation if OpenSSL was configured with OPENSSL_NO_ENGINE. --- src/libstrongswan/plugins/openssl/openssl_plugin.c | 10 ++++++++-- src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c index 2a97dbcc3..31697dcb8 100644 --- a/src/libstrongswan/plugins/openssl/openssl_plugin.c +++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c @@ -14,10 +14,12 @@ * for more details. */ -#include #include -#include +#include #include +#ifndef OPENSSL_NO_ENGINE +#include +#endif #include "openssl_plugin.h" @@ -200,7 +202,9 @@ static void destroy(private_openssl_plugin_t *this) lib->creds->remove_builder(lib->creds, (builder_function_t)openssl_crl_load); +#ifndef OPENSSL_NO_ENGINE ENGINE_cleanup(); +#endif /* OPENSSL_NO_ENGINE */ EVP_cleanup(); CONF_modules_free(); @@ -223,9 +227,11 @@ plugin_t *openssl_plugin_create() OPENSSL_config(NULL); OpenSSL_add_all_algorithms(); +#ifndef OPENSSL_NO_ENGINE /* activate support for hardware accelerators */ ENGINE_load_builtin_engines(); ENGINE_register_all_complete(); +#endif /* OPENSSL_NO_ENGINE */ /* crypter */ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c index de751fe89..9f1238474 100644 --- a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c +++ b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c @@ -21,7 +21,9 @@ #include #include +#ifndef OPENSSL_NO_ENGINE #include +#endif /* OPENSSL_NO_ENGINE */ /** * Public exponent to use for key generation. @@ -447,6 +449,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type, openssl_rsa_private_key_t *openssl_rsa_private_key_connect(key_type_t type, va_list args) { +#ifndef OPENSSL_NO_ENGINE private_openssl_rsa_private_key_t *this; char *keyid = NULL, *pin = NULL; EVP_PKEY *key; @@ -511,5 +514,8 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_connect(key_type_t type, this->engine = TRUE; return &this->public; +#else /* OPENSSL_NO_ENGINE */ + return NULL; +#endif /* OPENSSL_NO_ENGINE */ } -- cgit v1.2.3