mirror of
https://github.com/strongswan/strongswan.git
synced 2025-10-07 00:01:49 -04:00
rdrand: Provide get_features() regardless of RDRAND availability
As having no get_features() raises a deprecated warning, we return no features instead.
This commit is contained in:
parent
144f1d7041
commit
7707357227
@ -102,7 +102,11 @@ METHOD(plugin_t, get_features, int,
|
|||||||
PLUGIN_DEPENDS(CRYPTER, ENCR_AES_CBC, 16),
|
PLUGIN_DEPENDS(CRYPTER, ENCR_AES_CBC, 16),
|
||||||
};
|
};
|
||||||
*features = f;
|
*features = f;
|
||||||
return countof(f);
|
if (have_rdrand())
|
||||||
|
{
|
||||||
|
return countof(f);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
METHOD(plugin_t, destroy, void,
|
METHOD(plugin_t, destroy, void,
|
||||||
@ -122,16 +126,12 @@ plugin_t *rdrand_plugin_create()
|
|||||||
.public = {
|
.public = {
|
||||||
.plugin = {
|
.plugin = {
|
||||||
.get_name = _get_name,
|
.get_name = _get_name,
|
||||||
|
.get_features = _get_features,
|
||||||
.reload = (void*)return_false,
|
.reload = (void*)return_false,
|
||||||
.destroy = _destroy,
|
.destroy = _destroy,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
if (have_rdrand())
|
|
||||||
{
|
|
||||||
this->public.plugin.get_features = _get_features;
|
|
||||||
}
|
|
||||||
|
|
||||||
return &this->public.plugin;
|
return &this->public.plugin;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user