summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:26 +0200
committerYves-Alexis Perez <corsac@debian.org>2013-08-25 15:37:26 +0200
commit6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349 (patch)
tree009fc492961e13860d2a4bc2de8caf2bbe2975e7 /src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
parentc83921a2b566aa9d55d8ccc7258f04fca6292ee6 (diff)
downloadvyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.tar.gz
vyos-strongswan-6b99c8d9cff7b3e8ae8f3204b99e7ea40f791349.zip
Imported Upstream version 5.1.0
Diffstat (limited to 'src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c')
-rw-r--r--src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
index 9afaf123a..3faa59cae 100644
--- a/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
+++ b/src/libstrongswan/plugins/pkcs11/pkcs11_plugin.c
@@ -185,19 +185,6 @@ METHOD(plugin_t, reload, bool,
return FALSE;
}
-/**
- * Add a set of features
- */
-static inline void add_features(plugin_feature_t *f, plugin_feature_t *n,
- int count, int *pos)
-{
- int i;
- for (i = 0; i < count; i++)
- {
- f[(*pos)++] = n[i];
- }
-}
-
METHOD(plugin_t, get_features, int,
private_pkcs11_plugin_t *this, plugin_feature_t *features[])
{
@@ -261,32 +248,32 @@ METHOD(plugin_t, get_features, int,
{ /* initialize only once */
bool use_ecc = lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_ecc", FALSE);
- add_features(f, f_manager, countof(f_manager), &count);
+ plugin_features_add(f, f_manager, countof(f_manager), &count);
/* private key handling for EC keys is not disabled by use_ecc */
- add_features(f, f_privkey, countof(f_privkey), &count);
+ plugin_features_add(f, f_privkey, countof(f_privkey), &count);
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_pubkey", FALSE))
{
- add_features(f, f_pubkey, countof(f_pubkey) - (use_ecc ? 0 : 1),
- &count);
+ plugin_features_add(f, f_pubkey, countof(f_pubkey) - (use_ecc ? 0 : 1),
+ &count);
}
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_hasher", FALSE))
{
- add_features(f, f_hash, countof(f_hash), &count);
+ plugin_features_add(f, f_hash, countof(f_hash), &count);
}
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_rng", FALSE))
{
- add_features(f, f_rng, countof(f_rng), &count);
+ plugin_features_add(f, f_rng, countof(f_rng), &count);
}
if (lib->settings->get_bool(lib->settings,
"libstrongswan.plugins.pkcs11.use_dh", FALSE))
{
- add_features(f, f_dh, countof(f_dh), &count);
+ plugin_features_add(f, f_dh, countof(f_dh), &count);
if (use_ecc)
{
- add_features(f, f_ecdh, countof(f_ecdh), &count);
+ plugin_features_add(f, f_ecdh, countof(f_ecdh), &count);
}
}
}