diff options
author | Martin Willi <martin@revosec.ch> | 2011-04-11 18:54:18 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-04-15 10:07:12 +0200 |
commit | 787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5 (patch) | |
tree | f8c05bcf7572117763fd50eaf315a13c2e6261d2 /src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c | |
parent | 6e2791715b7534b601ff5d5163d63d88ad7a8a5e (diff) | |
download | strongswan-787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5.tar.bz2 strongswan-787b5884aaf873fb9fda2b0d8b7c3d54e38ae7a5.tar.xz |
Added a get_name() function to plugin_t, create_plugin_enumerator enumerates over plugin_t
Diffstat (limited to 'src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c')
-rw-r--r-- | src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c index 071d2f782..cfa3bbae5 100644 --- a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c +++ b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c @@ -26,8 +26,6 @@ #include "pkcs11_public_key.h" #include "pkcs11_hasher.h" -static const char *plugin_name = "pkcs11"; - typedef struct private_pkcs11_plugin_t private_pkcs11_plugin_t; /** @@ -103,6 +101,12 @@ static void token_event_cb(private_pkcs11_plugin_t *this, pkcs11_library_t *p11, } } +METHOD(plugin_t, get_name, char*, + private_pkcs11_plugin_t *this) +{ + return "pkcs11"; +} + METHOD(plugin_t, destroy, void, private_pkcs11_plugin_t *this) { @@ -136,6 +140,7 @@ plugin_t *pkcs11_plugin_create() INIT(this, .public = { .plugin = { + .get_name = _get_name, .destroy = _destroy, }, }, @@ -148,17 +153,17 @@ plugin_t *pkcs11_plugin_create() if (lib->settings->get_bool(lib->settings, "libstrongswan.plugins.pkcs11.use_hasher", FALSE)) { - lib->crypto->add_hasher(lib->crypto, HASH_MD2, plugin_name, + lib->crypto->add_hasher(lib->crypto, HASH_MD2, get_name(this), (hasher_constructor_t)pkcs11_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)pkcs11_hasher_create); - lib->crypto->add_hasher(lib->crypto, HASH_SHA1, plugin_name, + lib->crypto->add_hasher(lib->crypto, HASH_SHA1, get_name(this), (hasher_constructor_t)pkcs11_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)pkcs11_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)pkcs11_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)pkcs11_hasher_create); } |