Skip to content

Commit

Permalink
Store Dynamic DNS passwords in Base64 to protect special characters. …
Browse files Browse the repository at this point in the history
…Fixes #6688
  • Loading branch information
jim-p committed Nov 7, 2016
1 parent 10b262b commit 86584de
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/etc/inc/dyndns.class
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/etc/inc/globals.inc
Expand Up @@ -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",
Expand Down
17 changes: 17 additions & 0 deletions src/etc/inc/upgrade_config.inc
Expand Up @@ -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']);
}
}

?>
2 changes: 1 addition & 1 deletion src/usr/local/www/services_dyndns_edit.php
Expand Up @@ -150,7 +150,7 @@ function is_dyndns_username($uname) {
$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'];;
}
Expand Down

0 comments on commit 86584de

Please sign in to comment.