summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/openssl')
-rw-r--r--src/libstrongswan/plugins/openssl/Makefile.in3
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_crypter.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c2
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_plugin.c82
-rw-r--r--src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c2
5 files changed, 51 insertions, 40 deletions
diff --git a/src/libstrongswan/plugins/openssl/Makefile.in b/src/libstrongswan/plugins/openssl/Makefile.in
index b43be29f1..d1c8fce81 100644
--- a/src/libstrongswan/plugins/openssl/Makefile.in
+++ b/src/libstrongswan/plugins/openssl/Makefile.in
@@ -247,6 +247,8 @@ nm_ca_dir = @nm_ca_dir@
oldincludedir = @oldincludedir@
openac_plugins = @openac_plugins@
p_plugins = @p_plugins@
+pcsclite_CFLAGS = @pcsclite_CFLAGS@
+pcsclite_LIBS = @pcsclite_LIBS@
pdfdir = @pdfdir@
piddir = @piddir@
pki_plugins = @pki_plugins@
@@ -270,6 +272,7 @@ soup_LIBS = @soup_LIBS@
srcdir = @srcdir@
strongswan_conf = @strongswan_conf@
sysconfdir = @sysconfdir@
+systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
diff --git a/src/libstrongswan/plugins/openssl/openssl_crypter.c b/src/libstrongswan/plugins/openssl/openssl_crypter.c
index 2ed07ff0c..cd9a3bd4a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_crypter.c
+++ b/src/libstrongswan/plugins/openssl/openssl_crypter.c
@@ -152,7 +152,7 @@ METHOD(crypter_t, set_key, void,
METHOD(crypter_t, destroy, void,
private_openssl_crypter_t *this)
{
- free(this->key.ptr);
+ chunk_clear(&this->key);
free(this);
}
diff --git a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
index 32fc2bccd..78ed2811a 100644
--- a/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
+++ b/src/libstrongswan/plugins/openssl/openssl_ec_diffie_hellman.c
@@ -257,7 +257,7 @@ METHOD(diffie_hellman_t, destroy, void,
{
EC_POINT_clear_free(this->pub_key);
EC_KEY_free(this->key);
- chunk_free(&this->shared_secret);
+ chunk_clear(&this->shared_secret);
free(this);
}
diff --git a/src/libstrongswan/plugins/openssl/openssl_plugin.c b/src/libstrongswan/plugins/openssl/openssl_plugin.c
index 0050572ee..96aa38bb6 100644
--- a/src/libstrongswan/plugins/openssl/openssl_plugin.c
+++ b/src/libstrongswan/plugins/openssl/openssl_plugin.c
@@ -41,8 +41,6 @@
#include "openssl_x509.h"
#include "openssl_crl.h"
-static const char *plugin_name = "openssl";
-
typedef struct private_openssl_plugin_t private_openssl_plugin_t;
/**
@@ -195,6 +193,12 @@ static void threading_cleanup()
mutex = NULL;
}
+METHOD(plugin_t, get_name, char*,
+ private_openssl_plugin_t *this)
+{
+ return "openssl";
+}
+
METHOD(plugin_t, destroy, void,
private_openssl_plugin_t *this)
{
@@ -250,6 +254,8 @@ plugin_t *openssl_plugin_create()
INIT(this,
.public = {
.plugin = {
+ .get_name = _get_name,
+ .reload = (void*)return_false,
.destroy = _destroy,
},
},
@@ -274,85 +280,85 @@ plugin_t *openssl_plugin_create()
}
/* crypter */
- lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_AES_CBC, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAMELLIA_CBC, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_3DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_3DES, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_RC5, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_RC5, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_IDEA, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_IDEA, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_CAST, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_CAST, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_BLOWFISH, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_DES_ECB, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
- lib->crypto->add_crypter(lib->crypto, ENCR_NULL, plugin_name,
+ lib->crypto->add_crypter(lib->crypto, ENCR_NULL, get_name(this),
(crypter_constructor_t)openssl_crypter_create);
/* hasher */
- lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD2, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD2, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD4, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD4, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_MD5, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_MD5, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA224, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA224, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA256, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA256, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA384, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA384, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
- lib->crypto->add_hasher(lib->crypto, HASH_SHA512, plugin_name,
+ lib->crypto->add_hasher(lib->crypto, HASH_SHA512, get_name(this),
(hasher_constructor_t)openssl_hasher_create);
/* prf */
- lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, plugin_name,
+ lib->crypto->add_prf(lib->crypto, PRF_KEYED_SHA1, get_name(this),
(prf_constructor_t)openssl_sha1_prf_create);
/* (ec) diffie hellman */
- lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_224, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_224, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_2048_256, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_2048_256, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1536_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
#ifndef OPENSSL_NO_EC
- lib->crypto->add_dh(lib->crypto, ECP_256_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_256_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_384_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_384_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_521_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_521_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_224_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_224_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, ECP_192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, ECP_192_BIT, get_name(this),
(dh_constructor_t)openssl_ec_diffie_hellman_create);
#endif /* OPENSSL_NO_EC */
- lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_3072_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_4096_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_6144_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_8192_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_1024_160, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_1024_160, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_768_BIT, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_768_BIT, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
- lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, plugin_name,
+ lib->crypto->add_dh(lib->crypto, MODP_CUSTOM, get_name(this),
(dh_constructor_t)openssl_diffie_hellman_create);
/* rsa */
diff --git a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
index 0b607c386..d1afd94cc 100644
--- a/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
+++ b/src/libstrongswan/plugins/openssl/openssl_rsa_private_key.c
@@ -455,6 +455,7 @@ openssl_rsa_private_key_t *openssl_rsa_private_key_load(key_type_t type,
return NULL;
}
+#ifndef OPENSSL_NO_ENGINE
/**
* Login to engine with a PIN specified for a keyid
*/
@@ -496,6 +497,7 @@ static bool login(ENGINE *engine, chunk_t keyid)
}
return success;
}
+#endif /* OPENSSL_NO_ENGINE */
/**
* See header.