summaryrefslogtreecommitdiff
path: root/src/libstrongswan/plugins/plugin_feature.c
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2016-10-20 16:18:38 +0200
committerYves-Alexis Perez <corsac@debian.org>2016-10-20 16:18:38 +0200
commit25663e04c3ab01ef8dc9f906608282319cfea2db (patch)
treea0ca5e70f66d74dbe552c996a4f3a285cdfc35e4 /src/libstrongswan/plugins/plugin_feature.c
parentbf372706c469764d59e9f29c39e3ecbebd72b8d2 (diff)
downloadvyos-strongswan-25663e04c3ab01ef8dc9f906608282319cfea2db.tar.gz
vyos-strongswan-25663e04c3ab01ef8dc9f906608282319cfea2db.zip
New upstream version 5.5.1
Diffstat (limited to 'src/libstrongswan/plugins/plugin_feature.c')
-rw-r--r--src/libstrongswan/plugins/plugin_feature.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/plugin_feature.c b/src/libstrongswan/plugins/plugin_feature.c
index 4c92c412c..39d86c82a 100644
--- a/src/libstrongswan/plugins/plugin_feature.c
+++ b/src/libstrongswan/plugins/plugin_feature.c
@@ -30,6 +30,7 @@ ENUM(plugin_feature_names, FEATURE_NONE, FEATURE_CUSTOM,
"SIGNER",
"HASHER",
"PRF",
+ "XOF",
"DH",
"RNG",
"NONCE_GEN",
@@ -87,6 +88,9 @@ uint32_t plugin_feature_hash(plugin_feature_t *feature)
case FEATURE_PRF:
data = chunk_from_thing(feature->arg.prf);
break;
+ case FEATURE_XOF:
+ data = chunk_from_thing(feature->arg.xof);
+ break;
case FEATURE_DH:
data = chunk_from_thing(feature->arg.dh_group);
break;
@@ -160,6 +164,8 @@ bool plugin_feature_matches(plugin_feature_t *a, plugin_feature_t *b)
return a->arg.hasher == b->arg.hasher;
case FEATURE_PRF:
return a->arg.prf == b->arg.prf;
+ case FEATURE_XOF:
+ return a->arg.xof == b->arg.xof;
case FEATURE_DH:
return a->arg.dh_group == b->arg.dh_group;
case FEATURE_RNG:
@@ -218,6 +224,7 @@ bool plugin_feature_equals(plugin_feature_t *a, plugin_feature_t *b)
case FEATURE_SIGNER:
case FEATURE_HASHER:
case FEATURE_PRF:
+ case FEATURE_XOF:
case FEATURE_DH:
case FEATURE_NONCE_GEN:
case FEATURE_RESOLVER:
@@ -305,6 +312,13 @@ char* plugin_feature_get_string(plugin_feature_t *feature)
return str;
}
break;
+ case FEATURE_XOF:
+ if (asprintf(&str, "%N:%N", plugin_feature_names, feature->type,
+ ext_out_function_names, feature->arg.xof) > 0)
+ {
+ return str;
+ }
+ break;
case FEATURE_DH:
if (asprintf(&str, "%N:%N", plugin_feature_names, feature->type,
diffie_hellman_group_names, feature->arg.dh_group) > 0)
@@ -465,6 +479,10 @@ bool plugin_feature_load(plugin_t *plugin, plugin_feature_t *feature,
lib->crypto->add_prf(lib->crypto, feature->arg.prf,
name, reg->arg.reg.f);
break;
+ case FEATURE_XOF:
+ lib->crypto->add_xof(lib->crypto, feature->arg.xof,
+ name, reg->arg.reg.f);
+ break;
case FEATURE_DH:
lib->crypto->add_dh(lib->crypto, feature->arg.dh_group,
name, reg->arg.reg.f);
@@ -552,6 +570,9 @@ bool plugin_feature_unload(plugin_t *plugin, plugin_feature_t *feature,
case FEATURE_PRF:
lib->crypto->remove_prf(lib->crypto, reg->arg.reg.f);
break;
+ case FEATURE_XOF:
+ lib->crypto->remove_xof(lib->crypto, reg->arg.reg.f);
+ break;
case FEATURE_DH:
lib->crypto->remove_dh(lib->crypto, reg->arg.reg.f);
break;