diff options
author | jim-p <jimp@pfsense.org> | 2016-11-07 13:49:19 -0500 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2016-11-07 13:49:19 -0500 |
commit | 86584ded30c27b9ad1b017fb743399dc01180f02 (patch) | |
tree | d22a1cf6f7401b260e4c1d3b5744a89ceae36396 | |
parent | 10b262b409c9b4170785948b9e73bdfc7edc2eae (diff) | |
download | pfsense-86584ded30c27b9ad1b017fb743399dc01180f02.zip pfsense-86584ded30c27b9ad1b017fb743399dc01180f02.tar.gz |
Store Dynamic DNS passwords in Base64 to protect special characters. Fixes #6688
-rw-r--r-- | src/etc/inc/dyndns.class | 2 | ||||
-rw-r--r-- | src/etc/inc/globals.inc | 2 | ||||
-rw-r--r-- | src/etc/inc/upgrade_config.inc | 17 | ||||
-rw-r--r-- | src/usr/local/www/services_dyndns_edit.php | 2 |
4 files changed, 20 insertions, 3 deletions
diff --git a/src/etc/inc/dyndns.class b/src/etc/inc/dyndns.class index 0988dca..2bd9925 100644 --- a/src/etc/inc/dyndns.class +++ b/src/etc/inc/dyndns.class @@ -234,7 +234,7 @@ } $this->_dnsService = strtolower($dnsService); $this->_dnsUser = $dnsUser; - $this->_dnsPass = $dnsPass; + $this->_dnsPass = base64_decode($dnsPass); $this->_dnsHost = $dnsHost; $this->_dnsDomain = $dnsDomain; $this->_dnsServer = $dnsServer; diff --git a/src/etc/inc/globals.inc b/src/etc/inc/globals.inc index 2361478..ae7c860 100644 --- a/src/etc/inc/globals.inc +++ b/src/etc/inc/globals.inc @@ -65,7 +65,7 @@ $g = array( "disablecrashreporter" => false, "crashreporterurl" => "https://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, - "latest_config" => "15.7", + "latest_config" => "15.8", "minimum_ram_warning" => "101", "minimum_ram_warning_text" => "128 MB", "wan_interface_name" => "wan", diff --git a/src/etc/inc/upgrade_config.inc b/src/etc/inc/upgrade_config.inc index 4f9874f..842ec0e 100644 --- a/src/etc/inc/upgrade_config.inc +++ b/src/etc/inc/upgrade_config.inc @@ -5011,4 +5011,21 @@ function upgrade_156_to_157() { } } +function upgrade_157_to_158() { + global $config; + /* Convert Dynamic DNS passwords to base64 encoding. Redmine #6688 */ + + if (!is_array($config['dyndnses'])) { + $config['dyndnses'] = array(); + } + if (!is_array($config['dyndnses']['dyndns'])) { + $config['dyndnses']['dyndns'] = array(); + } + $a_dyndns = &$config['dyndnses']['dyndns']; + + foreach ($a_dyndns as &$dyndns) { + $dyndns['password'] = base64_encode($dyndns['password']); + } +} + ?> diff --git a/src/usr/local/www/services_dyndns_edit.php b/src/usr/local/www/services_dyndns_edit.php index 2e756d1..55860f0 100644 --- a/src/usr/local/www/services_dyndns_edit.php +++ b/src/usr/local/www/services_dyndns_edit.php @@ -150,7 +150,7 @@ if ($_POST) { $dyndns['type'] = $_POST['type']; $dyndns['username'] = $_POST['username']; if ($_POST['passwordfld'] != DMYPWD) { - $dyndns['password'] = $_POST['passwordfld']; + $dyndns['password'] = base64_encode($_POST['passwordfld']); } else { $dyndns['password'] = $a_dyndns[$id]['password'];; } |