From f70b71ce12c465cc32ea6dc5488404f004a46801 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 10 Oct 2022 20:23:26 +0200 Subject: [PATCH] ipsec: style sweep --- plist | 2 -- src/etc/inc/plugins.inc.d/ipsec.inc | 13 ++++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plist b/plist index bc0aeff3e..c5369d0c2 100644 --- a/plist +++ b/plist @@ -56,8 +56,6 @@ /usr/local/etc/inc/xmlrpc/legacy.inc /usr/local/etc/inc/xmlrpc/service.inc /usr/local/etc/inc/xmlrpc/test.inc -/usr/local/etc/ipsec.opnsense.d/README -/usr/local/etc/ipsec.secrets.opnsense.d/README /usr/local/etc/lighttpd_webgui/conf.d/README /usr/local/etc/lighttpd_webgui/conf.d/extforward.conf.example /usr/local/etc/netflow.conf.example diff --git a/src/etc/inc/plugins.inc.d/ipsec.inc b/src/etc/inc/plugins.inc.d/ipsec.inc index 0774c3d32..f59c6f289 100644 --- a/src/etc/inc/plugins.inc.d/ipsec.inc +++ b/src/etc/inc/plugins.inc.d/ipsec.inc @@ -411,9 +411,10 @@ function ipsec_parse_phase2($ikeid) } } else { $result['type'] = 'transport'; - if (!((($ph1ent['authentication_method'] == "xauth_psk_server") || + if ( + !((($ph1ent['authentication_method'] == "xauth_psk_server") || ($ph1ent['authentication_method'] == "pre_shared_key")) && isset($ph1ent['mobile'])) - ){ + ) { $result['local_ts'][] = ipsec_get_phase1_src($ph1ent); } if (!isset($ph1ent['mobile'])) { @@ -1464,7 +1465,7 @@ function ipsec_configure_do($verbose = false, $interface = '') } // XXX: should enforce explicit choice in the gui, it's also a phase 2 property in reality - if (!empty($ph1ent['auto']) && $ph1ent['auto'] != 'add' ) { + if (!empty($ph1ent['auto']) && $ph1ent['auto'] != 'add') { $start_action = $ph1ent['auto']; } elseif (isset($ph1ent['mobile']) || ($ph1ent['auto'] ?? '') == 'add') { $start_action = 'none'; @@ -1496,7 +1497,8 @@ function ipsec_configure_do($verbose = false, $interface = '') } } - if (isset($ph1ent['tunnel_isolation']) + if ( + isset($ph1ent['tunnel_isolation']) || (!isset($ph1ent['mobile']) && ($ph1ent['iketype'] ?? 'ikev1') == 'ikev1') ) { $this_conn = $connection; @@ -1511,7 +1513,8 @@ function ipsec_configure_do($verbose = false, $interface = '') if (isset($parsed_phase2[$fieldname][$idx]) && $parsed_phase2[$fieldname][$idx] != null) { if (is_array($parsed_phase2[$fieldname][$idx])) { $this_conn['children'][$child_id][$fieldname] = join( - ',', $parsed_phase2[$fieldname][$idx] + ',', + $parsed_phase2[$fieldname][$idx] ); } else { $this_conn['children'][$child_id][$fieldname] = $parsed_phase2[$fieldname][$idx] . " s";