diff options
author | Martin Willi <martin@revosec.ch> | 2014-02-10 11:21:09 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2014-02-10 11:22:16 +0100 |
commit | 770735722754f572ed452259d3b25cd40f27d70c (patch) | |
tree | 377af05b159ca58bfcb8088dbe942962f2a06fcc | |
parent | 144f1d70410eafa5a5e2327f06b0129380c10e6c (diff) | |
download | strongswan-770735722754f572ed452259d3b25cd40f27d70c.tar.bz2 strongswan-770735722754f572ed452259d3b25cd40f27d70c.tar.xz |
rdrand: Provide get_features() regardless of RDRAND availability
As having no get_features() raises a deprecated warning, we return no features
instead.
-rw-r--r-- | src/libstrongswan/plugins/rdrand/rdrand_plugin.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/libstrongswan/plugins/rdrand/rdrand_plugin.c b/src/libstrongswan/plugins/rdrand/rdrand_plugin.c index bb540648d..b416c872f 100644 --- a/src/libstrongswan/plugins/rdrand/rdrand_plugin.c +++ b/src/libstrongswan/plugins/rdrand/rdrand_plugin.c @@ -102,7 +102,11 @@ METHOD(plugin_t, get_features, int, PLUGIN_DEPENDS(CRYPTER, ENCR_AES_CBC, 16), }; *features = f; - return countof(f); + if (have_rdrand()) + { + return countof(f); + } + return 0; } METHOD(plugin_t, destroy, void, @@ -122,16 +126,12 @@ plugin_t *rdrand_plugin_create() .public = { .plugin = { .get_name = _get_name, + .get_features = _get_features, .reload = (void*)return_false, .destroy = _destroy, }, }, ); - if (have_rdrand()) - { - this->public.plugin.get_features = _get_features; - } - return &this->public.plugin; } |