Add features support to af_alg plugin
[strongswan.git] / src / libstrongswan / plugins / af_alg / af_alg_hasher.c
index 11074c4..ef23504 100644 (file)
@@ -46,7 +46,7 @@ static struct {
        hash_algorithm_t id;
        char *name;
        size_t size;
-} algs[] = {
+} algs[AF_ALG_HASHER] = {
        {HASH_SHA1,                     "sha1",                 HASH_SIZE_SHA1          },
        {HASH_MD5,                      "md5",                  HASH_SIZE_MD5           },
        {HASH_SHA224,           "sha224",               HASH_SIZE_SHA224        },
@@ -59,7 +59,7 @@ static struct {
 /**
  * See header.
  */
-void af_alg_hasher_probe(char *plugin)
+void af_alg_hasher_probe(plugin_feature_t *features, int *pos)
 {
        af_alg_ops_t *ops;
        int i;
@@ -70,8 +70,7 @@ void af_alg_hasher_probe(char *plugin)
                if (ops)
                {
                        ops->destroy(ops);
-                       lib->crypto->add_hasher(lib->crypto, algs[i].id, plugin,
-                                                       (hasher_constructor_t)af_alg_hasher_create);
+                       features[(*pos)++] = PLUGIN_PROVIDE(HASHER, algs[i].id);
                }
        }
 }