aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/rdrand/rdrand_plugin.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/plugins/rdrand/rdrand_plugin.c')
-rw-r--r--src/libstrongswan/plugins/rdrand/rdrand_plugin.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/libstrongswan/plugins/rdrand/rdrand_plugin.c b/src/libstrongswan/plugins/rdrand/rdrand_plugin.c
index a719cd781..fc9c6202d 100644
--- a/src/libstrongswan/plugins/rdrand/rdrand_plugin.c
+++ b/src/libstrongswan/plugins/rdrand/rdrand_plugin.c
@@ -14,6 +14,7 @@
*/
#include "rdrand_plugin.h"
+#include "rdrand_rng.h"
#include <stdio.h>
@@ -90,6 +91,17 @@ METHOD(plugin_t, get_name, char*,
return "rdrand";
}
+METHOD(plugin_t, get_features, int,
+ private_rdrand_plugin_t *this, plugin_feature_t *features[])
+{
+ static plugin_feature_t f[] = {
+ PLUGIN_REGISTER(RNG, rdrand_rng_create),
+ PLUGIN_PROVIDE(RNG, RNG_WEAK),
+ };
+ *features = f;
+ return countof(f);
+}
+
METHOD(plugin_t, destroy, void,
private_rdrand_plugin_t *this)
{
@@ -113,7 +125,10 @@ plugin_t *rdrand_plugin_create()
},
);
- have_rdrand();
+ if (have_rdrand())
+ {
+ this->public.plugin.get_features = _get_features;
+ }
return &this->public.plugin;
}