From: Aki Tuomi Date: Sat, 15 Jun 2013 17:44:19 +0000 (+0300) Subject: Documentation for TSIG feature X-Git-Tag: rec-3.6.0-rc1~468^2~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1fc07025cb77a98cc0b1095ce8adee1ea5c9b606;p=thirdparty%2Fpdns.git Documentation for TSIG feature --- diff --git a/pdns/backends/bind/binddnssec.cc b/pdns/backends/bind/binddnssec.cc index a36c93af4a..fac2b367b0 100644 --- a/pdns/backends/bind/binddnssec.cc +++ b/pdns/backends/bind/binddnssec.cc @@ -294,7 +294,7 @@ bool Bind2Backend::setTSIGKey(const string& name, const string& algorithm, const { if(!d_dnssecdb) return false; - boost::format fmt("insert or update into tsigkeys (name,algorithm,secret) values('%s', '%s', '%s')"); + boost::format fmt("replace into tsigkeys (name,algorithm,secret) values('%s', '%s', '%s')"); try { d_dnssecdb->doCommand( (fmt % d_dnssecdb->escape(name) % d_dnssecdb->escape(algorithm) % d_dnssecdb->escape(content)).str() ); } @@ -312,7 +312,7 @@ bool Bind2Backend::deleteTSIGKey(const string& name) boost::format fmt("delete from tsigkeys where name='%s'"); try { - d_dnssecdb->doCommand( (fmt % d_dnssecdb->escape(name)).str()); + d_dnssecdb->doCommand( (fmt % d_dnssecdb->escape(name)).str() ); } catch (SSqlException &e) { throw AhuException("BindBackend unable to retrieve named TSIG key: "+e.txtReason()); @@ -340,9 +340,10 @@ bool Bind2Backend::getTSIGKeys(std::vector< struct TSIGKey > &keys) key.name = row[0]; key.algorithm = row[1]; key.key = row[2]; + keys.push_back(key); } - return keys.empty(); + return !keys.empty(); } diff --git a/pdns/docs/pdns.xml b/pdns/docs/pdns.xml index 7016641b6b..75c127d3fc 100755 --- a/pdns/docs/pdns.xml +++ b/pdns/docs/pdns.xml @@ -12711,6 +12711,15 @@ $ pdnssec rectify-zone powerdnssec.org + + generate-zone-key [ksk|zsk] [algorithm] [bits] + + + Generate and display a zone key. Can be used when you need to generate a key for some script backend. + Does not store the key. + + + rectify-zone ZONE [ZONE ..] @@ -12789,6 +12798,54 @@ $ pdnssec rectify-zone powerdnssec.org + + import-tsig-key name algorithm key + + + Imports a named TSIG key. Use enable/disable-tsig-key to map it to a zone. + + + + + create-tsig-key name algorithm + + + Creates and stores a named tsig key. + + + + + delete-tsig-key name + + + Deletes a named TSIG key. WARNING! Does not unmap it from zones. + + + + + list-tsig-keys + + + Shows all TSIG keys from all backends. + + + + + enable-tsig-key zone name [master|slave] + + + Enables TSIG key for a zone. Use master on master server, slave on slave server. + + + + + disable-tsig-key zone name [master|slave] + + + Disabled TSIG key for a zone. Use master on master server, slave on slave server. + + +