mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-20 03:16:12 +00:00
openvpn: add fallback chain for openssl
This commit is contained in:
parent
78dfd81e27
commit
0fa0ed31e0
@ -212,9 +212,21 @@ function openvpn_get_digestlist() {
|
||||
return $digests;
|
||||
}
|
||||
|
||||
function openvpn_get_engines() {
|
||||
function openvpn_get_engines()
|
||||
{
|
||||
if (file_exists('/usr/local/bin/openssl')) {
|
||||
/* use the ports version */
|
||||
$bin_openssl = '/usr/local/bin/openssl';
|
||||
} elseif (file_exists('/usr/bin/openssl')) {
|
||||
/* use the base version (legacy fallback) */
|
||||
$bin_openssl = '/usr/bin/openssl';
|
||||
} else {
|
||||
/* the infamous "this should never happen" */
|
||||
log_error(_('Could not find an OpenSSL implementation on your system.'));
|
||||
}
|
||||
|
||||
$openssl_engines = array('none' => 'No Hardware Crypto Acceleration');
|
||||
exec("/usr/bin/openssl engine -t -c", $openssl_engine_output);
|
||||
exec($bin_openssl . ' engine -t -c', $openssl_engine_output);
|
||||
$openssl_engine_output = implode("\n", $openssl_engine_output);
|
||||
$openssl_engine_output = preg_replace("/\\n\\s+/", "|", $openssl_engine_output);
|
||||
$openssl_engine_output = explode("\n", $openssl_engine_output);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user