From 00062ae8f8602b1f445a5d37c4e96c5a0f342c18 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 30 Jul 2021 13:46:48 +0200 Subject: [PATCH] openvpn: improve the cipher parsing It had verbose text in it. Sort better while here. --- src/etc/inc/plugins.inc.d/openvpn.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/etc/inc/plugins.inc.d/openvpn.inc b/src/etc/inc/plugins.inc.d/openvpn.inc index b6bb30658..5fa1e1b39 100644 --- a/src/etc/inc/plugins.inc.d/openvpn.inc +++ b/src/etc/inc/plugins.inc.d/openvpn.inc @@ -271,13 +271,13 @@ function openvpn_get_cipherlist() $ciphers = array(); exec('/usr/local/sbin/openvpn --show-ciphers', $lines); foreach ($lines as $line) { - if (strstr($line, '(') !== false) { + if (strstr($line, ' (') !== false) { $cipher = explode(' ', $line)[0]; $ciphers[$cipher] = $line; } } - ksort($ciphers); - $ciphers["none"] = gettext("None (No Encryption)"); + ksort($ciphers, SORT_STRING | SORT_FLAG_CASE); + $ciphers['none'] = gettext('None (No Encryption)'); return $ciphers; }