From b061a3c61ced43cf746a4439b2370a03efccab0d Mon Sep 17 00:00:00 2001 From: Matt Smith Date: Thu, 22 Oct 2015 13:08:13 -0500 Subject: Remove config stuff for WEP. on upgrade, disable WEP on interfaces that have it configured and disable those interfaces and generate a notice. Fixes #5123. --- src/etc/inc/globals.inc | 2 +- src/etc/inc/interfaces.inc | 25 ++----------------------- src/etc/inc/upgrade_config.inc | 22 ++++++++++++++++++++++ 3 files changed, 25 insertions(+), 24 deletions(-) (limited to 'src/etc/inc') diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 32b25ca..286b00e 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -74,7 +74,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "12.3", + "latest_config" => "12.4", "nopkg_platforms" => array("cdrom"), "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index f7e60a6..9185738 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -2639,29 +2639,8 @@ function interface_wireless_configure($if, &$wl, &$wlcfg) { $wlcmd[] = "-wme"; } - /* set up wep if enabled */ - $wepset = ""; - if (isset($wlcfg['wep']['enable']) && is_array($wlcfg['wep']['key'])) { - switch ($wlcfg['wpa']['auth_algs']) { - case "1": - $wepset .= "authmode open wepmode on "; - break; - case "2": - $wepset .= "authmode shared wepmode on "; - break; - case "3": - $wepset .= "authmode mixed wepmode on "; - } - $i = 1; - foreach ($wlcfg['wep']['key'] as $wepkey) { - $wepset .= "wepkey " . escapeshellarg("{$i}:{$wepkey['value']}") . " "; - if (isset($wepkey['txkey'])) { - $wlcmd[] = "weptxkey {$i} "; - } - $i++; - } - $wlcmd[] = $wepset; - } else if (isset($wlcfg['wpa']['enable'])) { + /* Enable wpa if it's configured. No WEP support anymore. */ + if (isset($wlcfg['wpa']['enable'])) { $wlcmd[] = "authmode wpa wepmode off "; } else { $wlcmd[] = "authmode open wepmode off "; diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index 6e43894..cfc92d2 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -3981,4 +3981,26 @@ function upgrade_122_123() { } } +function upgrade_123_to_124() { + require_once("notices.inc"); + global $config; + + /* Find interfaces with WEP configured. */ + foreach ($config['interfaces'] as $ifname => $intf) { + if (!is_array($intf['wireless'])) { + continue; + } + + /* Generate a notice, disable interface, remove WEP settings */ + if (isset($intf['wireless']['wep']['enable'])) { + file_notice("WirelessSettings", "WEP is no longer supported. It will be disabled on the {$ifname} interface and the interface will be disabled. Please reconfigure the interface."); + unset($config['interfaces'][$ifname]['wireless']['wep']); + if (isset($intf['enable'])) { + unset($config['interfaces'][$ifname]['enable']); + } + } + } +} + + ?> -- cgit v1.1