diff options
author | Martin Willi <martin@revosec.ch> | 2011-09-21 11:17:56 +0200 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2011-10-14 10:05:46 +0200 |
commit | 3cd28acce0405af40d02d9e935b2c2610e0940c2 (patch) | |
tree | 8dc7ea418ee3fad0d35c0123477238bb3102e715 /src/libstrongswan/plugins/plugin_feature.c | |
parent | 02572b84f99bb5e29a05dcb1d0a314b00df71b91 (diff) | |
download | strongswan-3cd28acce0405af40d02d9e935b2c2610e0940c2.tar.bz2 strongswan-3cd28acce0405af40d02d9e935b2c2610e0940c2.tar.xz |
Add aead plugin features
Diffstat (limited to 'src/libstrongswan/plugins/plugin_feature.c')
-rw-r--r-- | src/libstrongswan/plugins/plugin_feature.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/libstrongswan/plugins/plugin_feature.c b/src/libstrongswan/plugins/plugin_feature.c index 682963b75..29ca10130 100644 --- a/src/libstrongswan/plugins/plugin_feature.c +++ b/src/libstrongswan/plugins/plugin_feature.c @@ -21,6 +21,7 @@ ENUM(plugin_feature_names, FEATURE_NONE, FEATURE_CUSTOM, "NONE", "CRYPTER", + "AEAD", "SIGNER", "HASHER", "PRF", @@ -56,6 +57,9 @@ bool plugin_feature_matches(plugin_feature_t *a, plugin_feature_t *b) case FEATURE_CRYPTER: return a->crypter.alg == b->crypter.alg && a->crypter.key_size == b->crypter.key_size; + case FEATURE_AEAD: + return a->aead.alg == b->aead.alg && + a->aead.key_size == b->aead.key_size; case FEATURE_SIGNER: return a->signer == b->signer; case FEATURE_HASHER: @@ -116,6 +120,14 @@ char* plugin_feature_get_string(plugin_feature_t *feature) return str; } break; + case FEATURE_AEAD: + if (asprintf(&str, "%N:%N-%d", plugin_feature_names, feature->type, + encryption_algorithm_names, feature->aead.alg, + feature->aead.key_size) > 0) + { + return str; + } + break; case FEATURE_SIGNER: if (asprintf(&str, "%N:%N", plugin_feature_names, feature->type, integrity_algorithm_names, feature->signer) > 0) |