diff --git a/dns/rfc2136/Makefile b/dns/rfc2136/Makefile index 54f5bd4da..dac21994a 100644 --- a/dns/rfc2136/Makefile +++ b/dns/rfc2136/Makefile @@ -1,5 +1,5 @@ PLUGIN_NAME= rfc2136 -PLUGIN_VERSION= 1.7 +PLUGIN_VERSION= 1.8 PLUGIN_COMMENT= RFC-2136 Support PLUGIN_MAINTAINER= franco@opnsense.org PLUGIN_DEPENDS= bind-tools diff --git a/dns/rfc2136/pkg-descr b/dns/rfc2136/pkg-descr index defdef6d0..5ef614b97 100644 --- a/dns/rfc2136/pkg-descr +++ b/dns/rfc2136/pkg-descr @@ -1 +1,8 @@ Support for RFC-2136 based dynamic DNS updates using Bind + +Plugin Changelog +================ + +1.8 + +* Add support for choosing hash algorithm used by nsupdate command diff --git a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc index 65d53f692..13a226641 100644 --- a/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc +++ b/dns/rfc2136/src/etc/inc/plugins.inc.d/rfc2136.inc @@ -123,7 +123,7 @@ function rfc2136_configure_do($verbose = false, $int = '', $updatehost = '', $fo $keyfile = "/var/etc/nsupdatekey{$i}"; $keyfill = [ "key \"{$keyname}\" {", - "\talgorithm hmac-md5;", + "\talgorithm {$dnsupdate['keyalgo']};", "\tsecret \"{$dnsupdate['keydata']}\";", "};", '' /* end of file */ diff --git a/dns/rfc2136/src/www/services_rfc2136_edit.php b/dns/rfc2136/src/www/services_rfc2136_edit.php index 9ae902777..460c1e736 100644 --- a/dns/rfc2136/src/www/services_rfc2136_edit.php +++ b/dns/rfc2136/src/www/services_rfc2136_edit.php @@ -33,6 +33,8 @@ require_once("interfaces.inc"); require_once("plugins.inc.d/rfc2136.inc"); $a_rfc2136 = &config_read_array('dnsupdates', 'dnsupdate'); +$nsukeyalgos = array("hmac-md5", "hmac-sha1", "hmac-sha224", "hmac-sha256", "hmac-sha384", "hmac-sha512"); +$nsukeyalgodefault = "hmac-sha512"; if ($_SERVER['REQUEST_METHOD'] === 'GET') { if (isset($_GET['id']) && !empty($a_rfc2136[$_GET['id']])) { @@ -49,6 +51,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $pconfig['ttl'] = isset($id) &&!empty($a_rfc2136[$id]['ttl']) ? $a_rfc2136[$id]['ttl'] : 60; $pconfig['keydata'] = isset($id) &&!empty($a_rfc2136[$id]['keydata']) ? $a_rfc2136[$id]['keydata'] : null; $pconfig['keyname'] = isset($id) &&!empty($a_rfc2136[$id]['keyname']) ? $a_rfc2136[$id]['keyname'] : null; + $pconfig['keyalgo'] = isset($id) &&!empty($a_rfc2136[$id]['keyalgo']) ? $a_rfc2136[$id]['keyalgo'] : $nsukeyalgodefault; $pconfig['server'] = isset($id) &&!empty($a_rfc2136[$id]['server']) ? $a_rfc2136[$id]['server'] : null; $pconfig['interface'] = isset($id) &&!empty($a_rfc2136[$id]['interface']) ? $a_rfc2136[$id]['interface'] : null; $pconfig['descr'] = isset($id) &&!empty($a_rfc2136[$id]['descr']) ? $a_rfc2136[$id]['descr'] : null; @@ -88,6 +91,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $rfc2136['ttl'] = $pconfig['ttl']; $rfc2136['keyname'] = $pconfig['keyname']; $rfc2136['keydata'] = $pconfig['keydata']; + $rfc2136['keyalgo'] = $pconfig['keyalgo']; $rfc2136['server'] = $pconfig['server']; $rfc2136['usetcp'] = !empty($pconfig['usetcp']); $rfc2136['usepublicip'] = !empty($pconfig['usepublicip']); @@ -149,14 +153,12 @@ include("head.inc");