Compare commits

..
3 Commits
64 changed files with 463 additions and 1000 deletions
-49
View File
@@ -1,52 +1,3 @@
4789. [cleanup] Check writability of new-zones-directory. [RT #46308]
4788. [cleanup] When using "update-policy local", log a warning
when an update matching the session key is received
from a remote host. [RT #46213]
4787. [cleanup] Turn nsec3param_salt_totext() into a public function,
dns_nsec3param_salttotext(), and add unit tests for it.
[RT #46289]
4786. [func] The "filter-aaaa-on-v4" and "filter-aaaa-on-v6"
options are no longer conditionally compiled.
[RT #46340]
4785. [func] The hmac-md5 algorithm is no longer recommended for
use with RNDC keys. For compatibility reasons, it
it is still the default algorithm in rndc-confgen,
but this will be changed to hmac-sha256 in a future
release. [RT #42272]
4784. [func] The use of dnssec-keygen to generate HMAC keys is
deprecated in favor of tsig-keygen. dnssec-keygen
will print a warning when used for this purpose.
All HMAC algorithms will be removed from
dnssec-keygen in a future release. [RT #42272]
4783. [test] dnssec: 'check that NOTIFY is sent at the end of
NSEC3 chain generation failed' required more time
on some machines for the IXFR to complete. [RT #46388]
4782. [test] dnssec: 'checking positive and negative validation
with negative trust anchors' required more time to
complete on some machines. [RT #46386]
4781. [maint] B.ROOT-SERVERS.NET is now 199.9.14.201. [RT #45889]
4780. [bug] When answering ANY queries, don't include the NS
RRset in the authority section if it was already
in the answer section. [RT #44543]
4779. [bug] Expire NTA at the start of the second. Don't update
the expiry value if the record has already expired
after a successful check. [RT #46368]
4778. [test] Improve synth-from-dnssec testing. [RT #46352]
4777. [cleanup] Removed a redundant call to configure_view_acl().
[RT #46369]
4776. [bug] Improve portability of ht_test. [RT #46333]
4775. [bug] Address Coverity warnings in ht_test.c and mem_test.c
+3 -5
View File
@@ -1,4 +1,4 @@
.\" Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2017 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" This Source Code Form is subject to the terms of the Mozilla Public
.\" License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -111,9 +111,7 @@ as directed\&.
.PP
\-A \fIalgorithm\fR
.RS 4
Specifies the algorithm to use for the TSIG key\&. Available choices are: hmac\-md5, hmac\-sha1, hmac\-sha224, hmac\-sha256, hmac\-sha384 and hmac\-sha512\&. The default is hmac\-md5, or if MD5 was disabled at compile time, hmac\-sha256\&.
.sp
Note: Use of hmac\-md5 is no longer recommended, and the default value will be changed to hmac\-sha256 in a future release\&.
Specifies the algorithm to use for the TSIG key\&. Available choices are: hmac\-md5, hmac\-sha1, hmac\-sha224, hmac\-sha256, hmac\-sha384 and hmac\-sha512\&. The default is hmac\-md5 or if MD5 was disabled hmac\-sha256\&.
.RE
.PP
\-b \fIkeysize\fR
@@ -219,5 +217,5 @@ BIND 9 Administrator Reference Manual\&.
\fBInternet Systems Consortium, Inc\&.\fR
.SH "COPYRIGHT"
.br
Copyright \(co 2001, 2003-2005, 2007, 2009, 2013-2017 Internet Systems Consortium, Inc. ("ISC")
Copyright \(co 2001, 2003-2005, 2007, 2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC")
.br
+2 -2
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2001, 2003-2005, 2007-2009, 2011, 2013, 2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001, 2003-2005, 2007-2009, 2011, 2013, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -237,7 +237,7 @@ main(int argc, char **argv) {
fprintf(stderr,
"warning: the default algorithm hmac-md5 "
"is deprecated and will be\n"
"changed to hmac-sha256 in a future release\n");
"changed to hmac-sha256 in a future release\n")
}
}
+1 -2
View File
@@ -1,5 +1,5 @@
<!--
- Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2017 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -39,7 +39,6 @@
<year>2014</year>
<year>2015</year>
<year>2016</year>
<year>2017</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
</docinfo>
+3 -7
View File
@@ -1,6 +1,6 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
- Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2017 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2001, 2003-2005, 2007, 2009, 2013-2016 Internet Systems Consortium, Inc. ("ISC")
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -113,12 +113,8 @@
<p>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-md5, or
if MD5 was disabled at compile time, hmac-sha256.
</p>
<p>
Note: Use of hmac-md5 is no longer recommended, and the default
value will be changed to hmac-sha256 in a future release.
hmac-sha384 and hmac-sha512. The default is hmac-md5 or
if MD5 was disabled hmac-sha256.
</p>
</dd>
<dt><span class="term">-b <em class="replaceable"><code>keysize</code></em></span></dt>
+5 -8
View File
@@ -62,15 +62,12 @@ may be preferable to direct use of
.RS 4
Selects the cryptographic algorithm\&. For DNSSEC keys, the value of
\fBalgorithm\fR
must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&. For TKEY and SIG(0) keys, the value must be DH (Diffie Hellman); specifying this value will automatically set the
must be one of RSAMD5, RSASHA1, DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECCGOST, ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448\&. For TSIG/TKEY keys, the value must be one of DH (Diffie Hellman), HMAC\-MD5, HMAC\-SHA1, HMAC\-SHA224, HMAC\-SHA256, HMAC\-SHA384, or HMAC\-SHA512; specifying any of these algorithms will automatically set the
\fB\-T KEY\fR
option as well\&.
.sp
TSIG keys can also by generated by setting the value to one of HMAC\-MD5, HMAC\-SHA1, HMAC\-SHA224, HMAC\-SHA256, HMAC\-SHA384, or HMAC\-SHA512\&. As with DH, specifying these values will automatically set
\fB\-T KEY\fR\&. Note, however, that
option as well\&. (Note:
\fBtsig\-keygen\fR
produces TSIG keys in a more useful format\&. These algorithms have been deprecated in
\fBdnssec\-keygen\fR, and will be removed in a future release\&.
produces TSIG keys in a more useful format than
\fBdnssec\-keygen\fR\&.)
.sp
These values are case insensitive\&. In some cases, abbreviations are supported, such as ECDSA256 for ECDSAP256SHA256 and ECDSA384 for ECDSAP384SHA384\&. If RSASHA1 or DSA is specified along with the
\fB\-3\fR
@@ -78,7 +75,7 @@ option, then NSEC3RSASHA1 or NSEC3DSA will be used instead\&.
.sp
As of BIND 9\&.12\&.0, this option is mandatory except when using the
\fB\-S\fR
option, which copies the algorithm from the predecessor key\&. Previously, the default for newly generated keys was RSASHA1\&.
option (which copies the algorithm from the predecessor key)\&. Previously, the default for newly generated keys was RSASHA1\&.
.RE
.PP
\-b \fIkeysize\fR
+8 -15
View File
@@ -103,19 +103,12 @@
of <code class="option">algorithm</code> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECCGOST,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448. For
TKEY and SIG(0) keys, the value must be DH (Diffie Hellman);
specifying this value will automatically set the
<code class="option">-T KEY</code> option as well.
</p>
<p>
TSIG keys can also by generated by setting the value to
one of HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
HMAC-SHA384, or HMAC-SHA512. As with DH, specifying these
values will automatically set <code class="option">-T KEY</code>. Note,
however, that <span class="command"><strong>tsig-keygen</strong></span> produces TSIG keys
in a more useful format. These algorithms have been deprecated
in <span class="command"><strong>dnssec-keygen</strong></span>, and will be removed in a
future release.
TSIG/TKEY keys, the value must be one of DH (Diffie Hellman),
HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384,
or HMAC-SHA512; specifying any of these algorithms will
automatically set the <code class="option">-T KEY</code> option as well.
(Note: <span class="command"><strong>tsig-keygen</strong></span> produces TSIG keys in a
more useful format than <span class="command"><strong>dnssec-keygen</strong></span>.)
</p>
<p>
These values are case insensitive. In some cases, abbreviations
@@ -126,8 +119,8 @@
</p>
<p>
As of BIND 9.12.0, this option is mandatory except when using
the <code class="option">-S</code> option, which copies the algorithm from
the predecessor key. Previously, the default for newly
the <code class="option">-S</code> option (which copies the algorithm from
the predecessor key). Previously, the default for newly
generated keys was RSASHA1.
</p>
</dd>
+4 -2
View File
@@ -156,10 +156,12 @@ options {\n\
# fetch-glue <obsolete>;\n\
fetch-quota-params 100 0.1 0.3 0.7;\n\
fetches-per-server 0;\n\
fetches-per-zone 0;\n\
filter-aaaa-on-v4 no;\n\
fetches-per-zone 0;\n"
#ifdef ALLOW_FILTER_AAAA
" filter-aaaa-on-v4 no;\n\
filter-aaaa-on-v6 no;\n\
filter-aaaa { any; };\n"
#endif
#ifdef HAVE_GEOIP
" geoip-use-ecs yes;\n"
#endif
+20 -27
View File
@@ -160,8 +160,6 @@
#define DIR_PERM_OK W_OK|X_OK
#endif
#define MAX_TCP_TIMEOUT 65535
/*%
* Check an operation for failure. Assumes that the function
* using it has a 'result' variable and a 'cleanup' label.
@@ -4683,19 +4681,20 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
* "allow-recursion" inherits from "allow-query-cache" if set,
* otherwise from "allow-query" if set.
*/
if (view->cacheacl == NULL && view->recursionacl != NULL) {
if (view->cacheacl == NULL && view->recursionacl != NULL)
dns_acl_attach(view->recursionacl, &view->cacheacl);
}
if (view->cacheacl == NULL && view->recursion) {
dns_acl_attach(view->queryacl, &view->cacheacl);
}
/*
* XXXEACH: This call to configure_view_acl() is redundant. We
* are leaving it as it is because we are making a minimal change
* for a patch release. In the future this should be changed to
* dns_acl_attach(view->queryacl, &view->cacheacl).
*/
if (view->cacheacl == NULL && view->recursion)
CHECK(configure_view_acl(vconfig, config, "allow-query", NULL,
actx, named_g_mctx, &view->cacheacl));
if (view->recursion &&
view->recursionacl == NULL && view->cacheacl != NULL)
{
dns_acl_attach(view->cacheacl, &view->recursionacl);
}
/*
* Set default "allow-recursion", "allow-recursion-on" and
@@ -4876,6 +4875,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
dns_quotatype_zone, r);
}
#ifdef ALLOW_FILTER_AAAA
obj = NULL;
result = named_config_get(maps, "filter-aaaa-on-v4", &obj);
INSIST(result == ISC_R_SUCCESS);
@@ -4910,7 +4910,7 @@ configure_view(dns_view_t *view, dns_viewlist_t *viewlist,
CHECK(configure_view_acl(vconfig, config, "filter-aaaa", NULL,
actx, named_g_mctx, &view->aaaa_acl));
#endif
obj = NULL;
result = named_config_get(maps, "prefetch", &obj);
if (result == ISC_R_SUCCESS) {
@@ -7053,13 +7053,6 @@ setup_newzones(dns_view_t *view, cfg_obj_t *config, cfg_obj_t *vconfig,
dir, isc_result_totext(result));
return (result);
}
if (access(dir, DIR_PERM_OK) != 0) {
isc_log_write(named_g_lctx, NAMED_LOGCATEGORY_GENERAL,
NAMED_LOGMODULE_SERVER, ISC_LOG_ERROR,
"new-zones-directory '%s' "
"is not writable", dir);
return (ISC_R_NOPERM);
}
dns_view_setnewzonedir(view, dir);
}
@@ -7888,11 +7881,11 @@ load_configuration(const char *filename, named_server_t *server,
result = named_config_get(maps, "tcp-keepalive-timeout", &obj);
INSIST(result == ISC_R_SUCCESS);
keepalive = cfg_obj_asuint32(obj);
if (keepalive > MAX_TCP_TIMEOUT) {
if (keepalive > 1200) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-keepalive-timeout value is out of range: "
"lowering to %u", MAX_TCP_TIMEOUT);
keepalive = MAX_TCP_TIMEOUT;
"lowering to 1200");
keepalive = 1200;
} else if (keepalive < 1) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-keepalive-timeout value is out of range: "
@@ -7904,11 +7897,11 @@ load_configuration(const char *filename, named_server_t *server,
result = named_config_get(maps, "tcp-advertised-timeout", &obj);
INSIST(result == ISC_R_SUCCESS);
advertised = cfg_obj_asuint32(obj);
if (advertised > MAX_TCP_TIMEOUT) {
if (advertised > 1200) {
cfg_obj_log(obj, named_g_lctx, ISC_LOG_WARNING,
"tcp-advertized-timeout value is out of range: "
"lowering to %u", MAX_TCP_TIMEOUT);
advertised = MAX_TCP_TIMEOUT;
"lowering to 1200");
advertised = 1200;
}
ns_server_settimeouts(named_g_server->sctx,
@@ -14702,7 +14695,7 @@ named_server_tcptimeouts(isc_lex_t *lex, isc_buffer_t **text) {
if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND);
CHECK(isc_parse_uint32(&keepalive, ptr, 10));
if (keepalive > MAX_TCP_TIMEOUT)
if (keepalive > 1200)
CHECK(ISC_R_RANGE);
if (keepalive < 1)
CHECK(ISC_R_RANGE);
@@ -14711,7 +14704,7 @@ named_server_tcptimeouts(isc_lex_t *lex, isc_buffer_t **text) {
if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND);
CHECK(isc_parse_uint32(&advertised, ptr, 10));
if (advertised > MAX_TCP_TIMEOUT)
if (advertised > 1200)
CHECK(ISC_R_RANGE);
result = isc_task_beginexclusive(named_g_server->task);
+4 -2
View File
@@ -1,17 +1,19 @@
#!/bin/sh
#
# Copyright (C) 2013, 2014, 2016, 2017 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2013, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
# $Id: clean.sh,v 1.6 2007/09/26 03:22:44 marka Exp $
#
# Clean up after tests.
#
rm -f dig.out.*
rm -f */named.memstats
rm -f ns1/named.conf
rm -f */named.conf
rm -f */named.run
rm -f ns*/named.lock
@@ -1,25 +0,0 @@
/*
* Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
controls { /* empty */ };
options {
query-source address 10.53.0.3;
notify-source 10.53.0.3;
transfer-source 10.53.0.3;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.3; };
listen-on-v6 { none; };
recursion yes;
};
zone "." {
type hint;
file "root.hint";
};
@@ -1,8 +0,0 @@
; Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
. NS ns1.
ns1. A 10.53.0.1
+3 -28
View File
@@ -212,7 +212,7 @@ echo "I:testing with 'minimal-responses yes;'"
minimal=yes
dotests
echo "I:reconfiguring server: minimal-responses no"
echo "I:reconfiguring server"
cp ns1/named2.conf ns1/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
sleep 2
@@ -230,7 +230,7 @@ if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
echo "I:reconfiguring server: minimal-any yes"
echo "I:reconfiguring server"
cp ns1/named3.conf ns1/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
sleep 2
@@ -266,7 +266,7 @@ echo "I:testing with 'minimal-responses no-auth;'"
minimal=no-auth
dotests
echo "I:reconfiguring server: minimal-responses no-auth-recursive"
echo "I:reconfiguring server"
cp ns1/named4.conf ns1/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
sleep 2
@@ -297,30 +297,5 @@ if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
echo "I:reconfiguring server: minimal-responses no"
cp ns1/named2.conf ns1/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.1 -p 9953 reconfig 2>&1 | sed 's/^/I:ns1 /'
sleep 2
n=`expr $n + 1`
echo "I:testing NS handling in ANY responses (authoritative) ($n)"
ret=0
$DIG -t ANY rt.example @10.53.0.1 -p 5300 > dig.out.$n || ret=1
grep "AUTHORITY: 0" dig.out.$n > /dev/null || ret=1
grep "NS[ ]*ns" dig.out.$n > /dev/null || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
n=`expr $n + 1`
echo "I:testing NS handling in ANY responses (recursive) ($n)"
ret=0
$DIG -t ANY rt.example @10.53.0.3 -p 5300 > dig.out.$n || ret=1
grep "AUTHORITY: 0" dig.out.$n > /dev/null || ret=1
grep "NS[ ]*ns" dig.out.$n > /dev/null || ret=1
if [ $ret -eq 1 ] ; then
echo "I: failed"; status=1
fi
echo "I:exit status: $status"
[ $status -eq 0 ] || exit 1
+2 -2
View File
@@ -24,8 +24,8 @@ options {
dnssec-must-be-secure mustbesecure.example yes;
minimal-responses no;
nta-lifetime 12s;
nta-recheck 9s;
nta-lifetime 10s;
nta-recheck 7s;
# Note: We only reference the bind.keys file here to confirm that it
# is *not* being used. It contains the real root key, and we're
+4 -10
View File
@@ -1722,7 +1722,7 @@ echo "I: waiting for NTA rechecks/expirations"
# fakenode.secure.example should both be lifted, but badds.example
# should still be going.
#
$PERL -e 'my $delay = '$start' + 10 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
$PERL -e 'my $delay = '$start' + 8 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
$DIG $DIGOPTS b.secure.example. a @10.53.0.4 > dig.out.ns4.test$n.8 || ret=1
grep "status: SERVFAIL" dig.out.ns4.test$n.8 > /dev/null && ret=1
grep "flags:[^;]* ad[^;]*;" dig.out.ns4.test$n.8 > /dev/null || ret=1
@@ -1742,7 +1742,7 @@ ret=0
# it should still be NTA'd, but badds.example used the default
# lifetime of 10s, so it should revert to SERVFAIL now.
#
$PERL -e 'my $delay = '$start' + 13 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
$PERL -e 'my $delay = '$start' + 11 - time(); select(undef, undef, undef, $delay) if ($delay > 0);'
# check nta table
$RNDC -c ../common/rndc.conf -s 10.53.0.4 -p 9953 nta -d > rndc.out.ns4.test$n._11
lines=`grep " expiry " rndc.out.ns4.test$n._11 | wc -l`
@@ -2501,15 +2501,9 @@ do
done;
grep "ANSWER: 3," dig.out.ns2.test$n > /dev/null || ret=1
if [ $ret != 0 ]; then echo "I:nsec3 chain generation not complete"; fi
sleep 3
$DIG $DIGOPTS +noauth +nodnssec soa nsec3chain-test @10.53.0.2 > dig.out.ns2.test$n || ret=1
s2=`awk '$4 == "SOA" { print $7}' dig.out.ns2.test$n`
for i in 1 2 3 4 5 6 7 8 9 10
do
$DIG $DIGOPTS +noauth +nodnssec soa nsec3chain-test @10.53.0.3 > dig.out.ns3.test$n || ret=1
s3=`awk '$4 == "SOA" { print $7}' dig.out.ns3.test$n`
test "$s2" = "$s3" && break
sleep 1
done
$DIG $DIGOPTS +noauth +nodnssec soa nsec3chain-test @10.53.0.3 > dig.out.ns3.test$n || ret=1
$PERL ../digcomp.pl dig.out.ns2.test$n dig.out.ns3.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
+9
View File
@@ -36,6 +36,7 @@ usage() {
fprintf(stderr, "args:\n");
fprintf(stderr, " --edns-version\n");
fprintf(stderr, " --enable-dnsrps\n");
fprintf(stderr, " --enable-filter-aaaa\n");
fprintf(stderr, " --gethostname\n");
fprintf(stderr, " --gssapi\n");
fprintf(stderr, " --have-dlopen\n");
@@ -62,6 +63,14 @@ main(int argc, char **argv) {
#endif
}
if (strcmp(argv[1], "--enable-filter-aaaa") == 0) {
#ifdef ALLOW_FILTER_AAAA
return (0);
#else
return (1);
#endif
}
if (strcmp(argv[1], "--edns-version") == 0) {
#ifdef DNS_EDNS_VERSION
printf("%d\n", DNS_EDNS_VERSION);
+16
View File
@@ -0,0 +1,16 @@
#!/bin/sh
#
# Copyright (C) 2010, 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
SYSTEMTESTTOP=..
. $SYSTEMTESTTOP/conf.sh
$FEATURETEST --enable-filter-aaaa || {
echo "I:This test requires --enable-filter-aaaa at compile time." >&2
exit 255
}
exit 0
-2
View File
@@ -486,7 +486,6 @@ fi
n=`expr $n + 1`
ret=0
echo "I:check that 'update-policy local' fails from non-localhost address ($n)"
grep 'match on session key not from localhost' ns5/named.run > /dev/null && ret=1
$NSUPDATE -p 5300 -k ns5/session.key > nsupdate.out.$n 2>&1 << END && ret=1
server 10.53.0.5 5300
local 10.53.0.1
@@ -494,7 +493,6 @@ update add nonlocal.local.nil. 600 A 4.3.2.1
send
END
grep REFUSED nsupdate.out.$n > /dev/null 2>&1 || ret=1
grep 'match on session key not from localhost' ns5/named.run > /dev/null || ret=1
$DIG @10.53.0.5 -p 5300 \
+tcp +noadd +nosea +nostat +noquest +nocomm +nocmd \
nonlocal.local.nil. > dig.out.ns5.$n || ret=1
+16 -17
View File
@@ -100,27 +100,26 @@ $PERL stop.pl $test
status=`expr $status + $?`
if [ $status != 0 ]; then
echofail "R:FAIL"
# Don't clean up - we need the evidence.
find . -name core -exec chmod 0644 '{}' \;
echofail "R:FAIL"
# Don't clean up - we need the evidence.
find . -name core -exec chmod 0644 '{}' \;
else
echopass "R:PASS"
echopass "R:PASS"
if $clean
then
rm -f $SYSTEMTESTTOP/random.data
if test -f $test/clean.sh
if $clean
then
( cd $test && $SHELL clean.sh "$@" )
rm -f $SYSTEMTESTTOP/random.data
if test -f $test/clean.sh
then
( cd $test && $SHELL clean.sh "$@" )
fi
if test -d ../../../.git
then
git status -su $test |
sed -n 's/^?? \(.*\)/I:file \1 not removed/p'
fi
fi
if test -d ../../../.git
then
git status -su --ignored $test |
sed -n -e 's|^?? \(.*\)|I:file \1 not removed|p' \
-e 's|^!! \(.*/named.run\)$|I:file \1 not removed|p' \
-e 's|^!! \(.*/named.memstats\)$|I:file \1 not removed|p'
fi
fi
fi
echoinfo "E:$test:`date`"
@@ -1,16 +0,0 @@
/*
* Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
options {
new-zones-directory "./nope";
port 5300;
pid-file "../named.pid";
listen-on { 127.0.0.1; };
listen-on-v6 { none; };
recursion no;
};
-11
View File
@@ -73,17 +73,6 @@ grep "managed-keys-directory './nope' is not writable" ns2/named.run > /dev/null
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I: checking that named refuses to reconfigure if new-zones-directory is not writable ($n)"
ret=0
cp -f ns2/named-alt6.conf ns2/named.conf
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 reconfig > rndc.out.$n 2>&1
grep "failed: permission denied" rndc.out.$n > /dev/null 2>&1 || ret=1
sleep 1
grep "new-zones-directory './nope' is not writable" ns2/named.run > /dev/null 2>&1 || ret=1
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
n=`expr $n + 1`
echo "I: checking that named refuses to start if working directory is not writable ($n)"
ret=0
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
rm -f */named.memstats
rm -f */named.run
rm -f dig.out.*
rm -f ns1/K*+*+*.key
rm -f ns1/K*+*+*.private
@@ -1,34 +0,0 @@
/*
* Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// NS4
controls { /* empty */ };
options {
query-source address 10.53.0.4;
notify-source 10.53.0.4;
transfer-source 10.53.0.4;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.4; };
listen-on-v6 { none; };
recursion yes;
notify no;
dnssec-enable yes;
dnssec-validation yes;
synth-from-dnssec no;
};
zone "." {
type hint;
file "root.hints";
};
include "../ns1/trusted.conf";
// include "../../common/controls.conf";
@@ -1,8 +0,0 @@
; Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
. NS ns1
ns1 A 10.53.0.1
@@ -1,33 +0,0 @@
/*
* Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// NS5
controls { /* empty */ };
options {
query-source address 10.53.0.5;
notify-source 10.53.0.5;
transfer-source 10.53.0.5;
port 5300;
pid-file "named.pid";
listen-on { 10.53.0.5; };
listen-on-v6 { none; };
recursion yes;
notify no;
dnssec-enable yes;
dnssec-validation yes;
synth-from-dnssec yes;
};
zone "." {
type hint;
file "root.hints";
};
include "../ns1/trusted.conf";
@@ -1,8 +0,0 @@
; Copyright (C) 2017 Internet Systems Consortium, Inc. ("ISC")
;
; This Source Code Form is subject to the terms of the Mozilla Public
; License, v. 2.0. If a copy of the MPL was not distributed with this
; file, You can obtain one at http://mozilla.org/MPL/2.0/.
. NS ns1
ns1 A 10.53.0.1
+82 -125
View File
@@ -17,58 +17,49 @@ rm -f dig.out.*
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
DELVOPTS="-a ns1/trusted.conf -p 5300"
for ns in 2 4 5
do
case $ns in
2) description="<default>";;
4) description="no";;
5) description="yes";;
*) exit 1;;
esac
echo "I:prime negative NXDOMAIN response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS a.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NXDOMAIN," dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
[ $ns -eq ${ns} ] && nxdomain=dig.out.ns${ns}.test$n
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime negative NXDOMAIN response ($n)"
ret=0
$DIG $DIGOPTS a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NXDOMAIN," dig.out.ns2.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns2.test$n > /dev/null || ret=1
nxdomain=dig.out.ns2.test$n
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime negative NODATA response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS nodata.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
[ $ns -eq 2 ] && nodata=dig.out.ns${ns}.test$n
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime negative NODATA response ($n)"
ret=0
$DIG $DIGOPTS nodata.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns2.test$n > /dev/null || ret=1
nodata=dig.out.ns2.test$n
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime wildcard response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS a.wild-a.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "a.wild-a.example.*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime wildcard response ($n)"
ret=0
$DIG $DIGOPTS a.wild-a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "a.wild-a.example.*3600.IN.A" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime wildcard CNAME response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS a.wild-cname.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "a.wild-cname.example.*3600.IN.CNAME" dig.out.ns${ns}.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
done
echo "I:prime wildcard CNAME response ($n)"
ret=0
$DIG $DIGOPTS a.wild-cname.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "a.wild-cname.example.*3600.IN.CNAME" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:prime redirect response (+nodnssec) (synth-from-dnssec <default>;) ($n)"
echo "I:prime redirect response (+nodnssec) ($n)"
ret=0
$DIG $DIGOPTS +nodnssec a.redirect. @10.53.0.3 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null && ret=1
@@ -78,88 +69,54 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
#
# ensure TTL of synthesised answers differs from direct answers.
#
sleep 1
for ns in 2 4 5
do
case $ns in
2) synth=yes description="<default>";;
4) synth=no description="no";;
5) synth=yes description="yes";;
*) exit 1;;
esac
echo "I:check synthesized NXDOMAIN response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS b.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NXDOMAIN," dig.out.ns${ns}.test$n > /dev/null || ret=1
if [ ${synth} = yes ]
then
grep "example.*IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null && ret=1
else
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
fi
$PERL ../digcomp.pl $nxdomain dig.out.ns${ns}.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
$RNDC -c ../common/rndc.conf -s 10.53.0.2 -p 9953 dumpdb
echo "I:check synthesized NODATA response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS nodata.example. @10.53.0.${ns} aaaa > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
if [ ${synth} = yes ]
then
grep "example.*IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null && ret=1
else
grep "example.*3600.IN.SOA" dig.out.ns${ns}.test$n > /dev/null || ret=1
fi
$PERL ../digcomp.pl $nodata dig.out.ns${ns}.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check synthesized NXDOMAIN response ($n)"
ret=0
$DIG $DIGOPTS b.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NXDOMAIN," dig.out.ns2.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns2.test$n > /dev/null && ret=1
$PERL ../digcomp.pl $nxdomain dig.out.ns2.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check synthesized wildcard response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS b.wild-a.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
if [ ${synth} = yes ]
then
grep "b\.wild-a\.example\..*IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "b\.wild-a\.example\..*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null && ret=1
else
grep "b\.wild-a\.example\..*3600.IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1
fi
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check synthesized NODATA response ($n)"
ret=0
$DIG $DIGOPTS nodata.example. @10.53.0.2 aaaa > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "example.*3600.IN.SOA" dig.out.ns2.test$n > /dev/null && ret=1
$PERL ../digcomp.pl $nodata dig.out.ns2.test$n || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check synthesized wildcard CNAME response (synth-from-dnssec ${description};) ($n)"
ret=0
$DIG $DIGOPTS b.wild-cname.example. @10.53.0.${ns} a > dig.out.ns${ns}.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns${ns}.test$n > /dev/null || ret=1
if [ ${synth} = yes ]
then
grep "b.wild-cname.example.*IN.CNAME" dig.out.ns${ns}.test$n > /dev/null || ret=1
grep "b.wild-cname.example.*3600.IN.CNAME" dig.out.ns${ns}.test$n > /dev/null && ret=1
else
grep "b.wild-cname.example.*3600.IN.CNAME" dig.out.ns${ns}.test$n > /dev/null || ret=1
fi
grep "ns1.example.*.IN.A" dig.out.ns${ns}.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
done
echo "I:check synthesized wildcard response ($n)"
ret=0
$DIG $DIGOPTS b.wild-a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "b\.wild-a\.example\..*3600.IN.A" dig.out.ns2.test$n > /dev/null && ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check redirect response (+dnssec) (synth-from-dnssec <default>;) ($n)"
echo "I:check synthesized wildcard CNAME response ($n)"
ret=0
$DIG $DIGOPTS b.wild-cname.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
grep "status: NOERROR," dig.out.ns2.test$n > /dev/null || ret=1
grep "b.wild-cname.example.*3600.IN.CNAME" dig.out.ns2.test$n > /dev/null && ret=1
grep "ns1.example.*.IN.A" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check redirect response (+dnssec) ($n)"
ret=0
$DIG $DIGOPTS b.redirect. @10.53.0.3 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null || ret=1
@@ -169,7 +126,7 @@ n=`expr $n + 1`
if [ $ret != 0 ]; then echo "I:failed"; fi
status=`expr $status + $ret`
echo "I:check redirect response (+nodnssec) (synth-from-dnssec <default>;) ($n)"
echo "I:check redirect response (+nodnssec) ($n)"
ret=0
$DIG $DIGOPTS +nodnssec b.redirect. @10.53.0.3 a > dig.out.ns2.test$n || ret=1
grep "flags:[^;]* ad[ ;]" dig.out.ns2.test$n > /dev/null && ret=1
+4
View File
@@ -141,6 +141,10 @@ int sigwait(const unsigned int *set, int *sig);
/* Use AES for Client Cookie generation */
#undef AES_CC
/* Define to enable the "filter-aaaa-on-v4" and "filter-aaaa-on-v6" options.
*/
#undef ALLOW_FILTER_AAAA
/* define if ATF unit tests are to be built. */
#undef ATF_TEST
+4
View File
@@ -306,6 +306,10 @@ typedef __int64 off_t;
/* Define to the sockaddr length type used by getnameinfo(3). */
#define IRS_GETNAMEINFO_SOCKLEN_T socklen_t
/* Define to enable the "filter-aaaa-on-v4" and "filter-aaaa-on-v6" options.
*/
@ALLOW_FILTER_AAAA@
/* Define to enable "rrset-order fixed" syntax. */
@DNS_RDATASET_FIXED@
Vendored
+28 -13
View File
@@ -940,7 +940,6 @@ infodir
docdir
oldincludedir
includedir
runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -1034,6 +1033,7 @@ enable_dnsrps_dl
with_dnsrps_libname
with_dnsrps_dir
enable_dnsrps
enable_filter_aaaa
enable_dnstap
with_protobuf_c
with_libfstrm
@@ -1103,7 +1103,6 @@ datadir='${datarootdir}'
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1356,15 +1355,6 @@ do
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
-runstatedir | --runstatedir | --runstatedi | --runstated \
| --runstate | --runstat | --runsta | --runst | --runs \
| --run | --ru | --r)
ac_prev=runstatedir ;;
-runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
| --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
| --run=* | --ru=* | --r=*)
runstatedir=$ac_optarg ;;
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1502,7 +1492,7 @@ fi
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
libdir localedir mandir runstatedir
libdir localedir mandir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1655,7 +1645,6 @@ Fine tuning of the installation directories:
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1730,6 +1719,7 @@ Optional Features:
--disable-rpz-nsdname disable rpz nsdname rules [default=enabled]
--enable-dnsrps-dl DNS Response Policy Service delayed link [default=$librpz_dl]
--enable-dnsrps enable DNS Response Policy Service API
--enable-filter-aaaa enable filtering of AAAA records [default=no]
--enable-dnstap enable dnstap support (requires fstrm, protobuf-c)
--enable-querytrace enable very verbose query trace logging [default=no]
--enable-full-report report values of all configure options
@@ -11480,6 +11470,7 @@ yes)
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
test "${enable_querytrace+set}" = set || enable_querytrace=yes
test "${with_atf+set}" = set || with_atf=yes
test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
test "${enable_symtable+set}" = set || enable_symtable=all
test "${enable_warn_error+set}" = set || enable_warn_error=yes
@@ -20953,6 +20944,28 @@ $as_echo "#define USE_DNSRPS 1" >>confdefs.h
fi
#
# Activate "filter-aaaa-on-v4/v6" or not?
#
# Check whether --enable-filter-aaaa was given.
if test "${enable_filter_aaaa+set}" = set; then :
enableval=$enable_filter_aaaa; enable_filter="$enableval"
else
enable_filter="no"
fi
case "$enable_filter" in
yes)
$as_echo "#define ALLOW_FILTER_AAAA 1" >>confdefs.h
;;
no)
;;
*)
;;
esac
#
# Activate dnstap?
#
@@ -26225,6 +26238,8 @@ report() {
echo " DNS Response Policy Service interface (--enable-dnsrps)"
test "yes" = "$enable_fixed" && \
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
test "yes" = "$enable_filter" && \
echo " AAAA filtering (--enable-filter-aaaa)"
test "yes" = "$enable_seccomp" && \
echo " Use libseccomp system call filtering (--enable-seccomp)"
test "yes" = "$want_backtrace" && \
+21
View File
@@ -66,6 +66,7 @@ yes)
test "${enable_fixed_rrset+set}" = set || enable_fixed_rrset=yes
test "${enable_querytrace+set}" = set || enable_querytrace=yes
test "${with_atf+set}" = set || with_atf=yes
test "${enable_filter_aaaa+set}" = set || enable_filter_aaaa=yes
test "${with_dlz_filesystem+set}" = set || with_dlz_filesystem=yes
test "${enable_symtable+set}" = set || enable_symtable=all
test "${enable_warn_error+set}" = set || enable_warn_error=yes
@@ -4412,6 +4413,24 @@ if test "x$enable_dnsrps" != "xno"; then
AC_DEFINE([USE_DNSRPS], [1], [Enable DNS Response Policy Service API])
fi
#
# Activate "filter-aaaa-on-v4/v6" or not?
#
AC_ARG_ENABLE(filter-aaaa,
[ --enable-filter-aaaa enable filtering of AAAA records [[default=no]]],
enable_filter="$enableval",
enable_filter="no")
case "$enable_filter" in
yes)
AC_DEFINE(ALLOW_FILTER_AAAA, 1,
[Define to enable the "filter-aaaa-on-v4" and "filter-aaaa-on-v6" options.])
;;
no)
;;
*)
;;
esac
#
# Activate dnstap?
#
@@ -5462,6 +5481,8 @@ report() {
echo " DNS Response Policy Service interface (--enable-dnsrps)"
test "yes" = "$enable_fixed" && \
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
test "yes" = "$enable_filter" && \
echo " AAAA filtering (--enable-filter-aaaa)"
test "yes" = "$enable_seccomp" && \
echo " Use libseccomp system call filtering (--enable-seccomp)"
test "yes" = "$want_backtrace" && \
+7 -23
View File
@@ -4988,9 +4988,7 @@ badresp:1,adberr:0,findfail:0,valfail:0]
Specifies the directory in which to store the configuration
parameters for zones added via <command>rndc addzone</command>.
By default, this is the working directory. If set to a relative
path, it will be relative to the working directory. The
directory <emphasis>must</emphasis> be writable by the
effective user ID of the <command>named</command> process.
path, it will be relative to the working directory.
</para>
</listitem>
</varlistentry>
@@ -6716,7 +6714,10 @@ options {
<term><command>filter-aaaa-on-v4</command></term>
<listitem>
<para>
This option is intended to help the
This option is only available when
<acronym>BIND</acronym> 9 is compiled with the
<userinput>--enable-filter-aaaa</userinput> option on the
"configure" command line. It is intended to help the
transition from IPv4 to IPv6 by not giving IPv6 addresses
to DNS clients unless they have connections to the IPv6
Internet. This is not recommended unless absolutely
@@ -8830,7 +8831,7 @@ avoid-v6-udp-ports { 40000; range 50000 60000; };
server waits on an idle TCP connection before closing
it when the client is using the EDNS TCP keepalive
option. The default is 300 (30 seconds), the maximum
is 65535 (about 1.8 hours), and the minimum is 1 (one tenth
is 1200 (two minutes), and the minimum is 1 (one tenth
of a second). Values above the maximum or below the minimum
will be adjusted with a logged warning.
This value may be greater than
@@ -8852,7 +8853,7 @@ avoid-v6-udp-ports { 40000; range 50000 60000; };
keepalive option. This informs a client of the
amount of time it may keep the session open.
The default is 300 (30 seconds), the maximum is
65535 (about 1.8 hours), and the minimum is 0, which
1200 (two minutes), and the minimum is 0, which
signals that the clients must close TCP connections
immediately. Ordinarily this should be set to the
same value as <command>tcp-keepalive-timeout</command>.
@@ -12509,23 +12510,6 @@ view "external" {
</listitem>
</varlistentry>
<varlistentry>
<term><command>file</command></term>
<listitem>
<para>
Set the zone's filename. In <command>master</command>,
<command>hint</command>, and <command>redirect</command>
zones which do not have <command>masters</command>
defined, zone data is loaded from this file. In
<command>slave</command>, <command>stub</command>, and
<command>redirect</command> zones which do have
<command>masters</command> defined, zone data is
retrieved from another server and saved in this file.
This option is not applicable to other zone types.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><command>forward</command></term>
<listitem>
-14
View File
@@ -9988,20 +9988,6 @@ view "external" {
See caveats in <a class="xref" href="Bv9ARM.ch06.html#root_delegation_only"><span class="command"><strong>root-delegation-only</strong></span></a>.
</p>
</dd>
<dt><span class="term"><span class="command"><strong>file</strong></span></span></dt>
<dd>
<p>
Set the zone's filename. In <span class="command"><strong>master</strong></span>,
<span class="command"><strong>hint</strong></span>, and <span class="command"><strong>redirect</strong></span>
zones which do not have <span class="command"><strong>masters</strong></span>
defined, zone data is loaded from this file. In
<span class="command"><strong>slave</strong></span>, <span class="command"><strong>stub</strong></span>, and
<span class="command"><strong>redirect</strong></span> zones which do have
<span class="command"><strong>masters</strong></span> defined, zone data is
retrieved from another server and saved in this file.
This option is not applicable to other zone types.
</p>
</dd>
<dt><span class="term"><span class="command"><strong>forward</strong></span></span></dt>
<dd>
<p>
-22
View File
@@ -528,28 +528,6 @@
they are set.
</p>
</li>
<li class="listitem">
<p>
The use of <span class="command"><strong>dnssec-keygen</strong></span> to generate
HMAC keys for TSIG authentication has been deprecated in favor
of <span class="command"><strong>tsig-keygen</strong></span>. If the algorithms HMAC-MD5,
HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, or
HMAC-SHA512 are specified, <span class="command"><strong>dnssec-keygen</strong></span>
will print a warning message. These algorithms will be
removed from <span class="command"><strong>dnssec-keygen</strong></span> entirely in
a future release. [RT #42272]
</p>
</li>
<li class="listitem">
<p>
The use of HMAC-MD5 for RNDC keys is no longer recommended.
For compatibility, this is still the default algorithm generated
by <span class="command"><strong>rndc-confgen</strong></span>, but it will print a
warning message. The default algorithm in
<span class="command"><strong>rndc-confgen</strong></span> will be changed to HMAC-SHA256
in a future release. [RT #42272]
</p>
</li>
</ul></div>
</div>
+8 -15
View File
@@ -121,19 +121,12 @@
of <code class="option">algorithm</code> must be one of RSAMD5, RSASHA1,
DSA, NSEC3RSASHA1, NSEC3DSA, RSASHA256, RSASHA512, ECCGOST,
ECDSAP256SHA256, ECDSAP384SHA384, ED25519 or ED448. For
TKEY and SIG(0) keys, the value must be DH (Diffie Hellman);
specifying this value will automatically set the
<code class="option">-T KEY</code> option as well.
</p>
<p>
TSIG keys can also by generated by setting the value to
one of HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256,
HMAC-SHA384, or HMAC-SHA512. As with DH, specifying these
values will automatically set <code class="option">-T KEY</code>. Note,
however, that <span class="command"><strong>tsig-keygen</strong></span> produces TSIG keys
in a more useful format. These algorithms have been deprecated
in <span class="command"><strong>dnssec-keygen</strong></span>, and will be removed in a
future release.
TSIG/TKEY keys, the value must be one of DH (Diffie Hellman),
HMAC-MD5, HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384,
or HMAC-SHA512; specifying any of these algorithms will
automatically set the <code class="option">-T KEY</code> option as well.
(Note: <span class="command"><strong>tsig-keygen</strong></span> produces TSIG keys in a
more useful format than <span class="command"><strong>dnssec-keygen</strong></span>.)
</p>
<p>
These values are case insensitive. In some cases, abbreviations
@@ -144,8 +137,8 @@
</p>
<p>
As of BIND 9.12.0, this option is mandatory except when using
the <code class="option">-S</code> option, which copies the algorithm from
the predecessor key. Previously, the default for newly
the <code class="option">-S</code> option (which copies the algorithm from
the predecessor key). Previously, the default for newly
generated keys was RSASHA1.
</p>
</dd>
+2 -6
View File
@@ -131,12 +131,8 @@
<p>
Specifies the algorithm to use for the TSIG key. Available
choices are: hmac-md5, hmac-sha1, hmac-sha224, hmac-sha256,
hmac-sha384 and hmac-sha512. The default is hmac-md5, or
if MD5 was disabled at compile time, hmac-sha256.
</p>
<p>
Note: Use of hmac-md5 is no longer recommended, and the default
value will be changed to hmac-sha256 in a future release.
hmac-sha384 and hmac-sha512. The default is hmac-md5 or
if MD5 was disabled hmac-sha256.
</p>
</dd>
<dt><span class="term">-b <em class="replaceable"><code>keysize</code></em></span></dt>
-22
View File
@@ -488,28 +488,6 @@
they are set.
</p>
</li>
<li class="listitem">
<p>
The use of <span class="command"><strong>dnssec-keygen</strong></span> to generate
HMAC keys for TSIG authentication has been deprecated in favor
of <span class="command"><strong>tsig-keygen</strong></span>. If the algorithms HMAC-MD5,
HMAC-SHA1, HMAC-SHA224, HMAC-SHA256, HMAC-SHA384, or
HMAC-SHA512 are specified, <span class="command"><strong>dnssec-keygen</strong></span>
will print a warning message. These algorithms will be
removed from <span class="command"><strong>dnssec-keygen</strong></span> entirely in
a future release. [RT #42272]
</p>
</li>
<li class="listitem">
<p>
The use of HMAC-MD5 for RNDC keys is no longer recommended.
For compatibility, this is still the default algorithm generated
by <span class="command"><strong>rndc-confgen</strong></span>, but it will print a
warning message. The default algorithm in
<span class="command"><strong>rndc-confgen</strong></span> will be changed to HMAC-SHA256
in a future release. [RT #42272]
</p>
</li>
</ul></div>
</div>
-7
View File
@@ -693,13 +693,6 @@
catagory.
</para>
</listitem>
<listitem>
<para>
The <command>filter-aaaa-on-v4</command> and
<command>filter-aaaa-on-v6</command> options are no longer
conditionally compiled in <command>named</command>. [RT #46340]
</para>
</listitem>
</itemizedlist>
</section>
+1
View File
@@ -3718,6 +3718,7 @@ dns_dispatch_importrecv(dns_dispatch_t *disp, isc_event_t *event) {
isc_socketevent_t *sevent, *newsevent;
REQUIRE(VALID_DISPATCH(disp));
REQUIRE((disp->attributes & DNS_DISPATCHATTR_NOLISTEN) != 0);
REQUIRE(event != NULL);
if ((disp->attributes & DNS_DISPATCHATTR_NOLISTEN) == 0)
-1
View File
@@ -73,7 +73,6 @@ LIBDNS_EXTERNAL_DATA extern isc_logmodule_t dns_modules[];
#define DNS_LOGMODULE_NTA (&dns_modules[30])
#define DNS_LOGMODULE_DYNDB (&dns_modules[31])
#define DNS_LOGMODULE_DNSTAP (&dns_modules[32])
#define DNS_LOGMODULE_SSU (&dns_modules[33])
ISC_LANG_BEGINDECLS
+2
View File
@@ -176,7 +176,9 @@ typedef int dns_messagetextflag_t;
additional section. */
#define DNS_MESSAGERENDER_PREFER_AAAA 0x0010 /*%< prefer AAAA records in
additional section. */
#ifdef ALLOW_FILTER_AAAA
#define DNS_MESSAGERENDER_FILTER_AAAA 0x0020 /*%< filter AAAA records */
#endif
typedef struct dns_msgblock dns_msgblock_t;
-13
View File
@@ -235,19 +235,6 @@ dns_nsec3param_toprivate(dns_rdata_t *src, dns_rdata_t *target,
* 'buf' should be at least src->length + 1 in size.
*/
isc_result_t
dns_nsec3param_salttotext(dns_rdata_nsec3param_t *nsec3param, char *dst,
size_t dstlen);
/*%<
* Convert the salt of given NSEC3PARAM RDATA into hex-encoded, NULL-terminated
* text stored at "dst".
*
* Requires:
*
*\li "dst" to have enough space (as indicated by "dstlen") to hold the
* resulting text and its NULL-terminating byte.
*/
isc_result_t
dns_nsec3param_deletechains(dns_db_t *db, dns_dbversion_t *ver,
dns_zone_t *zone, isc_boolean_t nonsec,
-1
View File
@@ -79,7 +79,6 @@ LIBDNS_EXTERNAL_DATA isc_logmodule_t dns_modules[] = {
{ "dns/nta", 0 },
{ "dns/dyndb", 0 },
{ "dns/dnstap", 0 },
{ "dns/ssu", 0 },
{ NULL, 0 }
};
+5 -3
View File
@@ -1897,6 +1897,7 @@ wrong_priority(dns_rdataset_t *rds, int pass, dns_rdatatype_t preferred_glue) {
return (ISC_TRUE);
}
#ifdef ALLOW_FILTER_AAAA
/*
* Decide whether to not answer with an AAAA record and its RRSIG
*/
@@ -1938,6 +1939,7 @@ norender_rdataset(const dns_rdataset_t *rdataset, unsigned int options,
return (ISC_TRUE);
}
#endif
static isc_result_t
renderset(dns_rdataset_t *rdataset, const dns_name_t *owner_name,
@@ -2098,14 +2100,13 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
preferred_glue))
goto next;
#ifdef ALLOW_FILTER_AAAA
/*
* Suppress AAAAs if asked and we are
* not doing DNSSEC or are breaking DNSSEC.
* Say so in the AD bit if we break DNSSEC.
*/
if (norender_rdataset(rdataset, options,
sectionid))
{
if (norender_rdataset(rdataset, options, sectionid)) {
if (sectionid == DNS_SECTION_ANSWER ||
sectionid == DNS_SECTION_AUTHORITY)
msg->flags &= ~DNS_MESSAGEFLAG_AD;
@@ -2114,6 +2115,7 @@ dns_message_rendersection(dns_message_t *msg, dns_section_t sectionid,
goto next;
}
#endif
st = *(msg->buffer);
count = 0;
-36
View File
@@ -1009,42 +1009,6 @@ rr_exists(dns_db_t *db, dns_dbversion_t *ver, const dns_name_t *name,
return (result);
}
isc_result_t
dns_nsec3param_salttotext(dns_rdata_nsec3param_t *nsec3param, char *dst,
size_t dstlen)
{
isc_result_t result;
isc_region_t r;
isc_buffer_t b;
REQUIRE(nsec3param != NULL);
REQUIRE(dst != NULL);
if (nsec3param->salt_length == 0) {
if (dstlen < 2U) {
return (ISC_R_NOSPACE);
}
strlcpy(dst, "-", dstlen);
return (ISC_R_SUCCESS);
}
r.base = nsec3param->salt;
r.length = nsec3param->salt_length;
isc_buffer_init(&b, dst, (unsigned int)dstlen);
result = isc_hex_totext(&r, 2, "", &b);
if (result != ISC_R_SUCCESS) {
return (result);
}
if (isc_buffer_availablelength(&b) < 1) {
return (ISC_R_NOSPACE);
}
isc_buffer_putuint8(&b, 0);
return (ISC_R_SUCCESS);
}
isc_result_t
dns_nsec3param_deletechains(dns_db_t *db, dns_dbversion_t *ver,
dns_zone_t *zone, isc_boolean_t nonsec,
+5 -6
View File
@@ -227,8 +227,7 @@ fetch_done(isc_task_t *task, isc_event_t *event) {
case DNS_R_NXDOMAIN:
case DNS_R_NCACHENXRRSET:
case DNS_R_NXRRSET:
if (nta->expiry > now)
nta->expiry = now;
nta->expiry = now;
break;
default:
break;
@@ -459,7 +458,7 @@ dns_ntatable_covered(dns_ntatable_t *ntatable, isc_stdtime_t now,
}
if (result == ISC_R_SUCCESS) {
nta = (dns_nta_t *) node->data;
answer = ISC_TF(nta->expiry > now);
answer = ISC_TF(nta->expiry >= now);
}
/* Deal with expired NTA */
@@ -552,7 +551,7 @@ dns_ntatable_totext(dns_ntatable_t *ntatable, isc_buffer_t **buf) {
snprintf(obuf, sizeof(obuf), "%s%s: %s %s",
first ? "" : "\n", nbuf,
n->expiry <= now ? "expired" : "expiry",
n->expiry < now ? "expired" : "expiry",
tbuf);
first = ISC_FALSE;
result = putstr(buf, obuf);
@@ -606,7 +605,7 @@ dns_ntatable_dump(dns_ntatable_t *ntatable, FILE *fp) {
isc_time_set(&t, n->expiry, 0);
isc_time_formattimestamp(&t, tbuf, sizeof(tbuf));
fprintf(fp, "%s: %s %s\n", nbuf,
n->expiry <= now ? "expired" : "expiry",
n->expiry < now ? "expired" : "expiry",
tbuf);
}
result = dns_rbtnodechain_next(&chain, NULL, NULL);
@@ -673,7 +672,7 @@ dns_ntatable_save(dns_ntatable_t *ntatable, FILE *fp) {
dns_rbtnodechain_current(&chain, NULL, NULL, &node);
if (node->data != NULL) {
dns_nta_t *n = (dns_nta_t *) node->data;
if (n->expiry > now) {
if (now <= n->expiry) {
isc_buffer_t b;
char nbuf[DNS_NAME_FORMATSIZE + 1], tbuf[80];
dns_fixedname_t fn;
+1 -1
View File
@@ -52,7 +52,7 @@ static char root_ns[] =
". 518400 IN NS M.ROOT-SERVERS.NET.\n"
"A.ROOT-SERVERS.NET. 3600000 IN A 198.41.0.4\n"
"A.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:503:BA3E::2:30\n"
"B.ROOT-SERVERS.NET. 3600000 IN A 199.9.14.201\n"
"B.ROOT-SERVERS.NET. 3600000 IN A 192.228.79.201\n"
"B.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:200::b\n"
"C.ROOT-SERVERS.NET. 3600000 IN A 192.33.4.12\n"
"C.ROOT-SERVERS.NET. 3600000 IN AAAA 2001:500:2::c\n"
+1 -10
View File
@@ -425,21 +425,12 @@ dns_ssutable_checkrules2(dns_ssutable_t *table, const dns_name_t *signer,
continue;
}
if (!dns_name_issubdomain(name, rule->name)) {
continue;
}
dns_acl_match(addr, NULL, env->localhost,
NULL, &match, NULL);
if (match == 0) {
if (signer != NULL) {
isc_log_write(dns_lctx,
DNS_LOGCATEGORY_GENERAL,
DNS_LOGMODULE_SSU,
ISC_LOG_WARNING,
"update-policy local: "
"match on session "
"key not from "
"localhost");
}
continue;
}
break;
+2 -58
View File
@@ -22,7 +22,6 @@
#include <isc/file.h>
#include <isc/hash.h>
#include <isc/hex.h>
#include <isc/lex.h>
#include <isc/mem.h>
#include <isc/os.h>
#include <isc/print.h>
@@ -101,7 +100,7 @@ create_managers(void) {
CHECK(isc_task_create(taskmgr, 0, &maintask));
return (ISC_R_SUCCESS);
cleanup:
cleanup:
cleanup_managers();
return (result);
}
@@ -159,7 +158,7 @@ dns_test_begin(FILE *logfile, isc_boolean_t start_managers) {
return (ISC_R_SUCCESS);
cleanup:
cleanup:
dns_test_end();
return (result);
}
@@ -435,58 +434,3 @@ dns_test_getdata(const char *file, unsigned char *buf,
isc_stdio_close(f);
return (result);
}
isc_result_t
dns_test_rdata_fromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
dns_rdatatype_t rdtype, unsigned char *dst,
size_t dstlen, const char *src)
{
isc_buffer_t source, target;
isc_lex_t *lex = NULL;
isc_result_t result;
size_t length;
REQUIRE(rdata != NULL);
REQUIRE(DNS_RDATA_INITIALIZED(rdata));
REQUIRE(dst != NULL);
REQUIRE(src != NULL);
/*
* Set up source to hold the input string.
*/
length = strlen(src);
isc_buffer_constinit(&source, src, length);
isc_buffer_add(&source, length);
/*
* Create a lexer as one is required by dns_rdata_fromtext().
*/
result = isc_lex_create(mctx, 64, &lex);
if (result != ISC_R_SUCCESS) {
return (result);
}
/*
* Point lexer at source.
*/
result = isc_lex_openbuffer(lex, &source);
if (result != ISC_R_SUCCESS) {
goto destroy_lexer;
}
/*
* Set up target for storing uncompressed wire form of provided RDATA.
*/
isc_buffer_init(&target, dst, dstlen);
/*
* Parse input string, determining result.
*/
result = dns_rdata_fromtext(rdata, rdclass, rdtype, lex, dns_rootname,
0, NULL, &target, NULL);
destroy_lexer:
isc_lex_destroy(&lex);
return (result);
}
-10
View File
@@ -80,13 +80,3 @@ dns_test_getdata(const char *file, unsigned char *buf,
char *
dns_test_tohex(const unsigned char *data, size_t len, char *buf, size_t buflen);
/*%
* Try parsing text form RDATA in "src" (of class "rdclass" and type "rdtype")
* into a structure representing that RDATA at "rdata", storing the
* uncompressed wire form of that RDATA at "dst", which is "dstlen" bytes long.
*/
isc_result_t
dns_test_rdata_fromstring(dns_rdata_t *rdata, dns_rdataclass_t rdclass,
dns_rdatatype_t rdtype, unsigned char *dst,
size_t dstlen, const char *src);
-111
View File
@@ -43,82 +43,6 @@ iteration_test(const char *file, unsigned int expected) {
dns_db_detach(&db);
}
/*%
* Structure containing parameters for nsec3param_salttotext_test().
*/
typedef struct {
const char *nsec3param_text; /* NSEC3PARAM RDATA in text form */
const char *expected_salt; /* string expected in target buffer */
} nsec3param_salttotext_test_params_t;
/*%
* Check whether dns_nsec3param_salttotext() handles supplied text form
* NSEC3PARAM RDATA correctly: test whether the result of calling the former is
* as expected and whether it properly checks available buffer space.
*
* Assumes supplied text form NSEC3PARAM RDATA is valid as testing handling of
* invalid NSEC3PARAM RDATA is out of scope of this unit test.
*/
static void
nsec3param_salttotext_test(const nsec3param_salttotext_test_params_t *params) {
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_rdata_nsec3param_t nsec3param;
unsigned char buf[1024];
isc_result_t result;
char salt[64];
size_t length;
/*
* Prepare a dns_rdata_nsec3param_t structure for testing.
*/
result = dns_test_rdata_fromstring(&rdata, dns_rdataclass_in,
dns_rdatatype_nsec3param, buf,
sizeof(buf),
params->nsec3param_text);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
result = dns_rdata_tostruct(&rdata, &nsec3param, NULL);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
/*
* Check typical use.
*/
result = dns_nsec3param_salttotext(&nsec3param, salt, sizeof(salt));
ATF_CHECK_EQ_MSG(result, ISC_R_SUCCESS,
"\"%s\": expected success, got %s\n",
params->nsec3param_text, isc_result_totext(result));
ATF_CHECK_EQ_MSG(strcmp(salt, params->expected_salt), 0,
"\"%s\": expected salt \"%s\", got \"%s\"",
params->nsec3param_text, params->expected_salt, salt);
/*
* Ensure available space in the buffer is checked before the salt is
* printed to it and that the amount of space checked for includes the
* terminating NULL byte.
*/
length = strlen(params->expected_salt);
ATF_REQUIRE(length < sizeof(salt) - 1); /* prevent buffer overwrite */
ATF_REQUIRE(length > 0U); /* prevent length underflow */
result = dns_nsec3param_salttotext(&nsec3param, salt, length - 1);
ATF_CHECK_EQ_MSG(result, ISC_R_NOSPACE,
"\"%s\": expected a %lu-byte target buffer to be "
"rejected, got %s\n",
params->nsec3param_text, length - 1,
isc_result_totext(result));
result = dns_nsec3param_salttotext(&nsec3param, salt, length);
ATF_CHECK_EQ_MSG(result, ISC_R_NOSPACE,
"\"%s\": expected a %lu-byte target buffer to be "
"rejected, got %s\n",
params->nsec3param_text, length,
isc_result_totext(result));
result = dns_nsec3param_salttotext(&nsec3param, salt, length + 1);
ATF_CHECK_EQ_MSG(result, ISC_R_SUCCESS,
"\"%s\": expected a %lu-byte target buffer to be "
"accepted, got %s\n",
params->nsec3param_text, length + 1,
isc_result_totext(result));
}
/*
* Individual unit tests
*/
@@ -144,40 +68,6 @@ ATF_TC_BODY(max_iterations, tc) {
dns_test_end();
}
ATF_TC(nsec3param_salttotext);
ATF_TC_HEAD(nsec3param_salttotext, tc) {
atf_tc_set_md_var(tc, "descr", "check dns_nsec3param_salttotext()");
}
ATF_TC_BODY(nsec3param_salttotext, tc) {
isc_result_t result;
size_t i;
const nsec3param_salttotext_test_params_t tests[] = {
/*
* Tests with non-empty salts.
*/
{ "0 0 10 0123456789abcdef", "0123456789ABCDEF" },
{ "0 1 11 0123456789abcdef", "0123456789ABCDEF" },
{ "1 0 12 42", "42" },
{ "1 1 13 42", "42" },
/*
* Test with empty salt.
*/
{ "0 0 0 -", "-" },
};
UNUSED(tc);
result = dns_test_begin(NULL, ISC_FALSE);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
for (i = 0; i < sizeof(tests) / sizeof(tests[0]); i++) {
nsec3param_salttotext_test(&tests[i]);
}
dns_test_end();
}
#else
ATF_TC(untested);
ATF_TC_HEAD(untested, tc) {
@@ -195,7 +85,6 @@ ATF_TC_BODY(untested, tc) {
ATF_TP_ADD_TCS(tp) {
#if defined(OPENSSL) || defined(PKCS11CRYPTO)
ATF_TP_ADD_TC(tp, max_iterations);
ATF_TP_ADD_TC(tp, nsec3param_salttotext);
#else
ATF_TP_ADD_TC(tp, untested);
#endif
+25 -5
View File
@@ -141,18 +141,38 @@ static void
check_text_ok_single(const text_ok_t *text_ok, dns_rdataclass_t rdclass,
dns_rdatatype_t type, size_t structsize)
{
dns_rdata_t rdata = DNS_RDATA_INIT;
isc_buffer_t source, target;
unsigned char buf_fromtext[1024];
char buf_totext[1024] = { 0 };
isc_buffer_t target;
isc_lex_t *lex = NULL;
isc_result_t result;
dns_rdata_t rdata;
size_t length;
/*
* Set up lexer to read data.
*/
result = isc_lex_create(mctx, 64, &lex);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
length = strlen(text_ok->text_in);
isc_buffer_constinit(&source, text_ok->text_in, length);
isc_buffer_add(&source, length);
result = isc_lex_openbuffer(lex, &source);
ATF_REQUIRE_EQ(result, ISC_R_SUCCESS);
/*
* Initialize target structures.
*/
isc_buffer_init(&target, buf_fromtext, sizeof(buf_fromtext));
dns_rdata_init(&rdata);
/*
* Try converting text form RDATA into uncompressed wire form.
*/
result = dns_test_rdata_fromstring(&rdata, rdclass, type, buf_fromtext,
sizeof(buf_fromtext),
text_ok->text_in);
result = dns_rdata_fromtext(&rdata, rdclass, type, lex, dns_rootname,
0, NULL, &target, NULL);
/*
* Destroy lexer now to simplify error handling below.
*/
isc_lex_destroy(&lex);
/*
* Check whether result is as expected.
*/
-1
View File
@@ -637,7 +637,6 @@ dns_nsec3_supportedhash
dns_nsec3_typepresent
dns_nsec3param_deletechains
dns_nsec3param_fromprivate
dns_nsec3param_salttotext
dns_nsec3param_toprivate
dns_nsec_build
dns_nsec_buildrdata
+46 -3
View File
@@ -3303,6 +3303,50 @@ resume_signingwithkey(dns_zone_t *zone) {
}
}
/*
* Convert the salt of given NSEC3PARAM RDATA into hex-encoded, NULL-terminated
* text stored at "dst".
*
* Requires:
* "dst" to have enough space (as indicated by "dstlen") to hold the
* resulting text and its NULL-terminating byte.
*/
static isc_result_t
nsec3param_salt_totext(dns_rdata_nsec3param_t *nsec3param, char *dst,
size_t dstlen)
{
isc_result_t result;
isc_region_t r;
isc_buffer_t b;
REQUIRE(nsec3param != NULL);
REQUIRE(dst != NULL);
if (nsec3param->salt_length == 0) {
if (dstlen < 2U) {
return (ISC_R_NOSPACE);
}
strlcpy(dst, "-", dstlen);
return (ISC_R_SUCCESS);
}
r.base = nsec3param->salt;
r.length = nsec3param->salt_length;
isc_buffer_init(&b, dst, (unsigned int)dstlen);
result = isc_hex_totext(&r, 2, "", &b);
if (result != ISC_R_SUCCESS) {
return (result);
}
if (isc_buffer_availablelength(&b) < 1) {
return (ISC_R_NOSPACE);
}
isc_buffer_putuint8(&b, 0);
return (ISC_R_SUCCESS);
}
/*
* Initiate adding/removing NSEC3 records belonging to the chain defined by the
* supplied NSEC3PARAM RDATA.
@@ -3406,8 +3450,7 @@ zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param) {
strlcat(flags, "|OPTOUT", sizeof(flags));
}
}
result = dns_nsec3param_salttotext(nsec3param, saltbuf,
sizeof(saltbuf));
result = nsec3param_salt_totext(nsec3param, saltbuf, sizeof(saltbuf));
RUNTIME_CHECK(result == ISC_R_SUCCESS);
dns_zone_log(zone, ISC_LOG_INFO,
"zone_addnsec3chain(%u,%s,%u,%s)",
@@ -17215,7 +17258,7 @@ dns_zone_addnsec3chain(dns_zone_t *zone, dns_rdata_nsec3param_t *nsec3param) {
REQUIRE(DNS_ZONE_VALID(zone));
result = dns_nsec3param_salttotext(nsec3param, salt, sizeof(salt));
result = nsec3param_salt_totext(nsec3param, salt, sizeof(salt));
RUNTIME_CHECK(result == ISC_R_SUCCESS);
dns_zone_log(zone, ISC_LOG_NOTICE,
"dns_zone_addnsec3chain(hash=%u, iterations=%u, salt=%s)",
+9
View File
@@ -1895,9 +1895,18 @@ view_clauses[] = {
{ "fetch-quota-params", &cfg_type_fetchquota, 0 },
{ "fetches-per-server", &cfg_type_fetchesper, 0 },
{ "fetches-per-zone", &cfg_type_fetchesper, 0 },
#ifdef ALLOW_FILTER_AAAA
{ "filter-aaaa", &cfg_type_bracketed_aml, 0 },
{ "filter-aaaa-on-v4", &cfg_type_filter_aaaa, 0 },
{ "filter-aaaa-on-v6", &cfg_type_filter_aaaa, 0 },
#else
{ "filter-aaaa", &cfg_type_bracketed_aml,
CFG_CLAUSEFLAG_NOTCONFIGURED },
{ "filter-aaaa-on-v4", &cfg_type_filter_aaaa,
CFG_CLAUSEFLAG_NOTCONFIGURED },
{ "filter-aaaa-on-v6", &cfg_type_filter_aaaa,
CFG_CLAUSEFLAG_NOTCONFIGURED },
#endif
{ "glue-cache", &cfg_type_boolean, 0 },
{ "ixfr-from-differences", &cfg_type_ixfrdifftype, 0 },
{ "lame-ttl", &cfg_type_ttlval, 0 },
+4
View File
@@ -1096,6 +1096,7 @@ client_send(ns_client_t *client) {
preferred_glue = DNS_MESSAGERENDER_PREFER_AAAA;
}
#ifdef ALLOW_FILTER_AAAA
/*
* filter-aaaa-on-v4 yes or break-dnssec option to suppress
* AAAA records.
@@ -1112,6 +1113,7 @@ client_send(ns_client_t *client) {
if (preferred_glue == DNS_MESSAGERENDER_PREFER_AAAA)
preferred_glue = DNS_MESSAGERENDER_PREFER_A;
}
#endif
/*
* Create an OPT for our reply.
@@ -3031,7 +3033,9 @@ client_create(ns_clientmgr_t *manager, ns_client_t **clientp) {
client->interface = NULL;
client->peeraddr_valid = ISC_FALSE;
dns_ecs_init(&client->ecs);
#ifdef ALLOW_FILTER_AAAA
client->filter_aaaa = dns_aaaa_ok;
#endif
client->needshutdown = ISC_TF((client->sctx->options &
NS_SERVER_CLIENTTEST) != 0);
+20 -70
View File
@@ -20,19 +20,21 @@
* code is reached. Current use is limited to libns unit tests and thus:
*
* - hook-related types and macros are not placed in libns header files,
* - hook-related code is compiled away unless --with-atf is used,
* - hook-related code is compiled away unless --enable-developer is used,
* - hook-related macro names are prefixed with "NS_".
*
* However, the implementation is pretty generic and could be repurposed for
* general use, e.g. as part of libisc, after some further customization.
*
* Hooks are created by inserting a macro into any function returning
* isc_result_t (NS_PROCESS_HOOK()) or void (NS_PROCESS_HOOK_VOID()). As both
* of these macros contain a return statement which is inlined into the
* function into which the hook is inserted, a hook callback is able to cause
* that function to return at hook insertion point. For functions returning
* isc_result_t, if a hook callback intends to cause a return at hook insertion
* point, it also has to set the value to be returned by the function.
* isc_result_t (NS_PROCESS_HOOK()) or void (NS_PROCESS_HOOK_VOID()). Each
* hook has an identifier, which is an integer that is an index into the hook
* table. In an attempt to keep things as simple as possible, current
* implementation:
*
* - uses hook tables which are statically-sized arrays only allowing a
* single callback to be invoked for each hook identifier,
* - only supports replacing whole hook tables.
*
* Hook callbacks are functions which:
*
@@ -48,33 +50,21 @@
* - a pointer to isc_result_t which will be returned by the function
* into which the hook is inserted if the callback returns ISC_TRUE.
*
* Hook tables are arrays which consist of a number of tuples (one tuple per
* hook identifier), each of which determines the callback to be invoked when a
* given hook is processed and the data to be passed to that callback. In an
* attempt to keep things as simple as possible, current implementation uses
* hook tables which are statically-sized arrays only allowing a single
* callback to be invoked for each hook identifier.
*
* In order for a hook callback to be called for a given hook, a pointer to
* that callback (along with an optional pointer to callback-specific data) has
* to be inserted into the relevant hook table entry for that hook. Replacing
* whole hook tables is also possible.
* to be inserted into the hook table entry for that hook.
*
* Consider the following sample code:
*
* ----------------------------------------------------------------------------
* ns_hook_t *foo_hook_table = NULL;
* const ns_hook_t *foo_hook_table = NULL;
*
* isc_result_t
* foo_bar(void) {
* int val = 42;
*
* ...
*
* NS_PROCESS_HOOK(foo_hook_table, FOO_EXTRACT_VAL, &val);
*
* ...
*
* printf("This message may not be printed due to use of hooks.");
*
* return (ISC_R_SUCCESS);
@@ -82,75 +72,35 @@
*
* isc_boolean_t
* cause_failure(void *hook_data, void *callback_data, isc_result_t *resultp) {
* int *valp = (int *)hook_data;
* isc_boolean_t *calledp = (isc_boolean_t *)callback_data;
*
* ...
*
* *resultp = ISC_R_FAILURE;
*
* return (ISC_TRUE);
* }
*
* isc_boolean_t
* examine_val(void *hook_data, void *callback_data, isc_result_t *resultp) {
* int *valp = (int *)hook_data;
* int *valcopyp = (int *)callback_data;
*
* UNUSED(resultp);
*
* ...
*
* return (ISC_FALSE);
* }
*
* void
* test_foo_bar(void) {
* isc_boolean_t called = ISC_FALSE;
* int valcopy;
*
* ns_hook_t my_hooks[FOO_HOOKS_COUNT] = {
* isc_boolean_t foo_bar_called = ISC_FALSE;
* const ns_hook_t my_hooks[FOO_HOOKS_COUNT] = {
* [FOO_EXTRACT_VAL] = {
* .callback = cause_failure,
* .callback_data = &called,
* .callback_data = &foo_bar_called,
* },
* };
*
* foo_hook_table = my_hooks;
*
* foo_bar();
*
* {
* const ns_hook_t examine_hook = {
* .callback = examine_val,
* .callback_data = &valcopy,
* };
*
* my_hooks[FOO_EXTRACT_VAL] = examine_hook;
* }
* foo_bar();
*
* }
* ----------------------------------------------------------------------------
*
* When test_foo_bar() is called, "foo_hook_table" is set to "my_hooks". Then
* When test_foo_bar() is called, the hook table is first replaced. Then
* foo_bar() gets invoked. Once execution reaches the insertion point for hook
* FOO_EXTRACT_VAL, cause_failure() will be called with &val as "hook_data" and
* &called as "callback_data". It can do whatever it pleases with these two
* values. Eventually, cause_failure() sets *resultp to ISC_R_FAILURE and
* FOO_EXTRACT_VAL, cause_failure() will be called with &val as hook_data and
* &foo_bar_called as callback_data. It can do whatever it pleases with these
* two values. Eventually, cause_failure() sets *resultp to ISC_R_FAILURE and
* returns ISC_TRUE, which causes foo_bar() to return ISC_R_FAILURE and never
* execute the printf() call below hook insertion point.
*
* Execution then returns to test_foo_bar(). Unlike before the first call to
* foo_bar(), this time only a single hook ("examine_hook") is defined instead
* of a complete hook table. This hook is then subsequently inserted at index
* FOO_EXTRACT_VAL into the "my_hook" hook table. This causes the hook
* previously set at that index (the one calling cause_failure()) to be
* replaced with "examine_hook". Thus, when the second call to foo_bar() is
* subsequently made, examine_val() will be called with &val as "hook_data" and
* &valcopy as "callback_data". Contrary to cause_failure(), extract_val()
* returns ISC_FALSE, which means it does not access "resultp" and does not
* cause foo_bar() to return at hook insertion point. Thus, printf() will be
* called this time and foo_bar() will return ISC_R_SUCCESS.
*/
enum {
@@ -186,7 +136,7 @@ typedef struct ns_hook {
#define NS_PROCESS_HOOK_VOID(table, id, data) \
_NS_PROCESS_HOOK(table, id, data)
LIBNS_EXTERNAL_DATA extern ns_hook_t *ns__hook_table;
LIBNS_EXTERNAL_DATA extern const ns_hook_t *ns__hook_table;
#endif /* NS_HOOKS_ENABLE */
#endif /* NS_HOOKS_H */
+4
View File
@@ -141,7 +141,9 @@ struct ns_client {
struct in6_pktinfo pktinfo;
isc_dscp_t dscp;
isc_event_t ctlevent;
#ifdef ALLOW_FILTER_AAAA
dns_aaaa_t filter_aaaa;
#endif
/*%
* Information about recent FORMERR response(s), for
* FORMERR loop avoidance. This is separate for each
@@ -178,8 +180,10 @@ typedef ISC_LIST(ns_client_t) client_list_t;
#define NS_CLIENTATTR_MULTICAST 0x00008 /*%< recv'd from multicast */
#define NS_CLIENTATTR_WANTDNSSEC 0x00010 /*%< include dnssec records */
#define NS_CLIENTATTR_WANTNSID 0x00020 /*%< include nameserver ID */
#ifdef ALLOW_FILTER_AAAA
#define NS_CLIENTATTR_FILTER_AAAA 0x00040 /*%< suppress AAAAs */
#define NS_CLIENTATTR_FILTER_AAAA_RC 0x00080 /*%< recursing for A against AAAA */
#endif
#define NS_CLIENTATTR_WANTAD 0x00100 /*%< want AD in response if possible */
#define NS_CLIENTATTR_WANTCOOKIE 0x00200 /*%< return a COOKIE */
#define NS_CLIENTATTR_HAVECOOKIE 0x00400 /*%< has a valid COOKIE */
-1
View File
@@ -119,7 +119,6 @@ typedef struct query_ctx {
isc_boolean_t nxrewrite; /* negative answer from RPZ */
isc_boolean_t findcoveringnsec; /* lookup covering NSEC */
isc_boolean_t want_stale; /* want stale records? */
isc_boolean_t answer_has_ns; /* NS is in answer */
dns_fixedname_t wildcardname; /* name needing wcard proof */
dns_fixedname_t dsname; /* name needing DS */
+56 -87
View File
@@ -247,7 +247,7 @@ log_noexistnodata(void *val, int level, const char *fmt, ...)
#ifdef NS_HOOKS_ENABLE
LIBNS_EXTERNAL_DATA ns_hook_t *ns__hook_table = NULL;
LIBNS_EXTERNAL_DATA const ns_hook_t *ns__hook_table = NULL;
#define PROCESS_HOOK(...) \
NS_PROCESS_HOOK(ns__hook_table, __VA_ARGS__)
@@ -1832,7 +1832,9 @@ query_addadditional(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
}
if (qtype == dns_rdatatype_a) {
#ifdef ALLOW_FILTER_AAAA
isc_boolean_t have_a = ISC_FALSE;
#endif
/*
* We now go looking for A and AAAA records, along with
@@ -1871,7 +1873,9 @@ query_addadditional(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
dns_rdataset_disassociate(sigrdataset);
} else if (result == ISC_R_SUCCESS) {
mname = NULL;
#ifdef ALLOW_FILTER_AAAA
have_a = ISC_TRUE;
#endif
if (additionaltype == dns_rdatasetadditional_fromcache &&
(DNS_TRUST_PENDING(rdataset->trust) ||
DNS_TRUST_GLUE(rdataset->trust)) &&
@@ -1931,12 +1935,14 @@ query_addadditional(void *arg, const dns_name_t *name, dns_rdatatype_t qtype) {
/*
* There's an A; check whether we're filtering AAAA
*/
#ifdef ALLOW_FILTER_AAAA
if (have_a &&
(client->filter_aaaa == dns_aaaa_break_dnssec ||
(client->filter_aaaa == dns_aaaa_filter &&
(!WANTDNSSEC(client) || sigrdataset == NULL ||
!dns_rdataset_isassociated(sigrdataset)))))
goto addname;
#endif
if (additionaltype == dns_rdatasetadditional_fromcache &&
(DNS_TRUST_PENDING(rdataset->trust) ||
DNS_TRUST_GLUE(rdataset->trust)) &&
@@ -2065,11 +2071,13 @@ query_addrdataset(ns_client_t *client, dns_section_t section,
if (dbversion == NULL)
goto regular;
#ifdef ALLOW_FILTER_AAAA
if (client->filter_aaaa == dns_aaaa_filter ||
client->filter_aaaa == dns_aaaa_break_dnssec)
{
options |= DNS_RDATASETADDGLUE_FILTERAAAA;
}
#endif
result = dns_rdataset_addglue(rdataset, dbversion->version,
options, client->message);
@@ -4545,6 +4553,7 @@ query_findclosestnsec3(dns_name_t *qname, dns_db_t *db,
return;
}
#ifdef ALLOW_FILTER_AAAA
static isc_boolean_t
is_v4_client(ns_client_t *client) {
if (isc_sockaddr_pf(&client->peeraddr) == AF_INET)
@@ -4562,6 +4571,7 @@ is_v6_client(ns_client_t *client) {
return (ISC_TRUE);
return (ISC_FALSE);
}
#endif
static isc_uint32_t
dns64_ttl(dns_db_t *db, dns_dbversion_t *version) {
@@ -4979,7 +4989,6 @@ qctx_init(ns_client_t *client, dns_fetchevent_t *event,
qctx->is_staticstub_zone = ISC_FALSE;
qctx->nxrewrite = ISC_FALSE;
qctx->want_stale = ISC_FALSE;
qctx->answer_has_ns = ISC_FALSE;
qctx->authoritative = ISC_FALSE;
}
@@ -6512,6 +6521,7 @@ query_respond_any(query_ctx_t *qctx) {
dns_rdatasetiter_t *rdsiter = NULL;
isc_result_t result;
dns_rdatatype_t onetype = 0; /* type to use for minimal-any */
#ifdef ALLOW_FILTER_AAAA
isc_boolean_t have_aaaa, have_a, have_sig;
/*
@@ -6522,6 +6532,7 @@ query_respond_any(query_ctx_t *qctx) {
have_aaaa = ISC_FALSE;
have_a = !qctx->authoritative;
have_sig = ISC_FALSE;
#endif
result = dns_db_allrdatasets(qctx->db, qctx->node,
qctx->version, 0, &rdsiter);
@@ -6549,6 +6560,7 @@ query_respond_any(query_ctx_t *qctx) {
result = dns_rdatasetiter_first(rdsiter);
while (result == ISC_R_SUCCESS) {
dns_rdatasetiter_current(rdsiter, qctx->rdataset);
#ifdef ALLOW_FILTER_AAAA
/*
* Notice the presence of A and AAAAs so
* that AAAAs can be hidden from IPv4 clients.
@@ -6559,22 +6571,7 @@ query_respond_any(query_ctx_t *qctx) {
else if (qctx->rdataset->type == dns_rdatatype_a)
have_a = ISC_TRUE;
}
/*
* We found an NS RRset; no need to add one later.
*/
if (qctx->qtype == dns_rdatatype_any &&
qctx->rdataset->type == dns_rdatatype_ns)
{
qctx->answer_has_ns = ISC_TRUE;
}
/*
* Note: if we're in this function, then qctx->type
* is guaranteed to be ANY, but qctx->qtype (i.e. the
* original type requested) might have been RRSIG or
* SIG; we need to check for that.
*/
#endif
if (qctx->is_zone && qctx->qtype == dns_rdatatype_any &&
!dns_db_issecure(qctx->db) &&
dns_rdatatype_isdnssec(qctx->rdataset->type))
@@ -6606,8 +6603,10 @@ query_respond_any(query_ctx_t *qctx) {
qctx->rdataset->type == qctx->qtype) &&
qctx->rdataset->type != 0)
{
#ifdef ALLOW_FILTER_AAAA
if (dns_rdatatype_isdnssec(qctx->rdataset->type))
have_sig = ISC_TRUE;
#endif
if (NOQNAME(qctx->rdataset) && WANTDNSSEC(qctx->client))
{
@@ -6670,10 +6669,10 @@ query_respond_any(query_ctx_t *qctx) {
*/
dns_rdataset_disassociate(qctx->rdataset);
}
result = dns_rdatasetiter_next(rdsiter);
}
#ifdef ALLOW_FILTER_AAAA
/*
* Filter AAAAs if there is an A and there is no signature
* or we are supposed to break DNSSEC.
@@ -6684,7 +6683,7 @@ query_respond_any(query_ctx_t *qctx) {
have_aaaa && have_a &&
(!have_sig || !WANTDNSSEC(qctx->client)))
qctx->client->attributes |= NS_CLIENTATTR_FILTER_AAAA;
#endif
if (qctx->fname != NULL)
dns_message_puttempname(qctx->client->message, &qctx->fname);
@@ -6797,6 +6796,7 @@ query_getexpire(query_ctx_t *qctx) {
}
}
#ifdef ALLOW_FILTER_AAAA
/*
* Optionally hide AAAAs from IPv4 clients if there is an A.
*
@@ -6891,6 +6891,7 @@ query_filter_aaaa(query_ctx_t *qctx) {
return (ISC_R_COMPLETE);
}
#endif
/*%
* Build a repsonse for a "normal" query, for a type other than ANY,
@@ -6929,9 +6930,11 @@ query_respond(query_ctx_t *qctx) {
return (query_done(qctx));
}
#ifdef ALLOW_FILTER_AAAA
result = query_filter_aaaa(qctx);
if (result != ISC_R_COMPLETE)
return (result);
#endif
/*
* Check to see if the AAAA RRset has non-excluded addresses
* in it. If not look for a A RRset.
@@ -6968,26 +6971,12 @@ query_respond(query_ctx_t *qctx) {
}
/*
* Special case NS handling
* BIND 8 priming queries need the additional section.
*/
if (qctx->is_zone && qctx->qtype == dns_rdatatype_ns) {
/*
* We've already got an NS, no need to add one in
* the authority section
*/
if (dns_name_equal(qctx->client->query.qname,
dns_db_origin(qctx->db)))
{
qctx->answer_has_ns = ISC_TRUE;
}
/*
* BIND 8 priming queries need the additional section.
*/
if (dns_name_equal(qctx->client->query.qname, dns_rootname)) {
qctx->client->query.attributes &=
~NS_QUERYATTR_NOADDITIONAL;
}
if (qctx->is_zone && qctx->qtype == dns_rdatatype_ns &&
dns_name_equal(qctx->client->query.qname, dns_rootname))
{
qctx->client->query.attributes &= ~NS_QUERYATTR_NOADDITIONAL;
}
/*
@@ -8349,38 +8338,6 @@ log_noexistnodata(void *val, int level, const char *fmt, ...) {
va_end(ap);
}
static dns_ttl_t
query_synthttl(dns_rdataset_t *soardataset, dns_rdataset_t *sigsoardataset,
dns_rdataset_t *p1rdataset, dns_rdataset_t *sigp1rdataset,
dns_rdataset_t *p2rdataset, dns_rdataset_t *sigp2rdataset)
{
dns_rdata_soa_t soa;
dns_rdata_t rdata = DNS_RDATA_INIT;
dns_ttl_t ttl;
isc_result_t result;
REQUIRE(soardataset != NULL);
REQUIRE(sigsoardataset != NULL);
REQUIRE(p1rdataset != NULL);
REQUIRE(sigp1rdataset != NULL);
result = dns_rdataset_first(soardataset);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
dns_rdataset_current(soardataset, &rdata);
dns_rdata_tostruct(&rdata, &soa, NULL);
ttl = ISC_MIN(soa.minimum, soardataset->ttl);
ttl = ISC_MIN(ttl, sigsoardataset->ttl);
ttl = ISC_MIN(ttl, p1rdataset->ttl);
ttl = ISC_MIN(ttl, sigp1rdataset->ttl);
if (p2rdataset != NULL)
ttl = ISC_MIN(ttl, p2rdataset->ttl);
if (sigp2rdataset != NULL)
ttl = ISC_MIN(ttl, sigp2rdataset->ttl);
return (ttl);
}
/*
* Synthesize a NODATA response from the SOA and covering NSEC in cache.
*/
@@ -8397,9 +8354,10 @@ query_synthnodata(query_ctx_t *qctx, const dns_name_t *signer,
/*
* Detemine the correct TTL to use for the SOA and RRSIG
*/
ttl = query_synthttl(*soardatasetp, *sigsoardatasetp,
qctx->rdataset, qctx->sigrdataset,
NULL, NULL);
ttl = ISC_MIN(qctx->rdataset->ttl, qctx->sigrdataset->ttl);
ttl = ISC_MIN(ttl, (*soardatasetp)->ttl);
ttl = ISC_MIN(ttl, (*sigsoardatasetp)->ttl);
(*soardatasetp)->ttl = (*sigsoardatasetp)->ttl = ttl;
/*
@@ -8601,15 +8559,15 @@ query_synthcnamewildcard(query_ctx_t *qctx, dns_rdataset_t *rdataset,
/*
* Synthesize a NXDOMAIN response from qctx (which contains the
* NODATA proof), nowild + nowildrdataset + signowildrdataset (which
* contains the NOWILDCARD proof) and signer + soardatasetp + sigsoardatasetp
* NODATA proof), nowild + rdataset + sigrdataset (which contains
* the NOWILDCARD proof) and signer + soardatasetp + sigsoardatasetp
* which contain the SOA record + RRSIG for the negative answer.
*/
static isc_result_t
query_synthnxdomain(query_ctx_t *qctx,
dns_name_t *nowild,
dns_rdataset_t *nowildrdataset,
dns_rdataset_t *signowildrdataset,
dns_rdataset_t *rdataset,
dns_rdataset_t *sigrdataset,
dns_name_t *signer,
dns_rdataset_t **soardatasetp,
dns_rdataset_t **sigsoardatasetp)
@@ -8623,9 +8581,12 @@ query_synthnxdomain(query_ctx_t *qctx,
/*
* Detemine the correct TTL to use for the SOA and RRSIG
*/
ttl = query_synthttl(*soardatasetp, *sigsoardatasetp,
qctx->rdataset, qctx->sigrdataset,
nowildrdataset, signowildrdataset);
ttl = ISC_MIN(qctx->rdataset->ttl, qctx->sigrdataset->ttl);
ttl = ISC_MIN(ttl, rdataset->ttl);
ttl = ISC_MIN(ttl, sigrdataset->ttl);
ttl = ISC_MIN(ttl, (*soardatasetp)->ttl);
ttl = ISC_MIN(ttl, (*sigsoardatasetp)->ttl);
(*soardatasetp)->ttl = (*sigsoardatasetp)->ttl = ttl;
/*
@@ -8690,8 +8651,8 @@ query_synthnxdomain(query_ctx_t *qctx,
goto cleanup;
}
dns_rdataset_clone(nowildrdataset, clone);
dns_rdataset_clone(signowildrdataset, sigclone);
dns_rdataset_clone(rdataset, clone);
dns_rdataset_clone(sigrdataset, sigclone);
/*
* Add NOWILDCARD proof.
@@ -8833,12 +8794,14 @@ query_coveringnsec(query_ctx_t *qctx) {
if (qctx->type == dns_rdatatype_any) { /* XXX not yet */
goto cleanup;
}
#ifdef ALLOW_FILTER_AAAA
if (qctx->client->filter_aaaa != dns_aaaa_ok &&
(qctx->type == dns_rdatatype_a ||
qctx->type == dns_rdatatype_aaaa)) /* XXX not yet */
{
goto cleanup;
}
#endif
if (!ISC_LIST_EMPTY(qctx->client->view->dns64) &&
(qctx->type == dns_rdatatype_a ||
qctx->type == dns_rdatatype_aaaa)) /* XXX not yet */
@@ -8903,12 +8866,14 @@ query_coveringnsec(query_ctx_t *qctx) {
if (qctx->type == dns_rdatatype_any) { /* XXX not yet */
goto cleanup;
}
#ifdef ALLOW_FILTER_AAAA
if (qctx->client->filter_aaaa != dns_aaaa_ok &&
(qctx->type == dns_rdatatype_a ||
qctx->type == dns_rdatatype_aaaa)) /* XXX not yet */
{
goto cleanup;
}
#endif
if (!ISC_LIST_EMPTY(qctx->client->view->dns64) &&
(qctx->type == dns_rdatatype_a ||
qctx->type == dns_rdatatype_aaaa)) /* XXX not yet */
@@ -9447,6 +9412,7 @@ query_prepresponse(query_ctx_t *qctx) {
qctx->need_wildcardproof = ISC_TRUE;
}
#ifdef ALLOW_FILTER_AAAA
/*
* The filter-aaaa-on-v4 option should suppress AAAAs for IPv4
* clients if there is an A; filter-aaaa-on-v6 option does the same
@@ -9470,6 +9436,7 @@ query_prepresponse(query_ctx_t *qctx) {
qctx->client->filter_aaaa = qctx->client->view->v6_aaaa;
}
#endif
if (qctx->type == dns_rdatatype_any) {
return (query_respond_any(qctx));
@@ -10218,12 +10185,14 @@ query_addauth(query_ctx_t *qctx) {
*/
if (!qctx->want_restart && !NOAUTHORITY(qctx->client)) {
if (qctx->is_zone) {
if (!qctx->answer_has_ns) {
if (!((qctx->qtype == dns_rdatatype_ns ||
qctx->qtype == dns_rdatatype_any) &&
dns_name_equal(qctx->client->query.qname,
dns_db_origin(qctx->db))))
{
(void)query_addns(qctx);
}
} else if (!qctx->answer_has_ns &&
qctx->qtype != dns_rdatatype_ns)
{
} else if (qctx->qtype != dns_rdatatype_ns) {
if (qctx->fname != NULL) {
query_releasename(qctx->client, &qctx->fname);
}
+2 -2
View File
@@ -679,8 +679,8 @@ extract_qctx(void *hook_data, void *callback_data, isc_result_t *resultp) {
*/
static isc_result_t
create_qctx_for_client(ns_client_t *client, query_ctx_t **qctxp) {
ns_hook_t *saved_hook_table;
ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
const ns_hook_t *saved_hook_table;
const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
[NS_QUERY_SETUP_QCTX_INITIALIZED] = {
.callback = extract_qctx,
.callback_data = qctxp,
+2 -2
View File
@@ -57,7 +57,7 @@ ns__query_sfcache_test(const ns__query_sfcache_test_params_t *test) {
/*
* Interrupt execution if query_done() is called.
*/
ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
[NS_QUERY_DONE_BEGIN] = {
.callback = ns_test_hook_catch_call,
.callback_data = NULL,
@@ -264,7 +264,7 @@ ns__query_start_test(const ns__query_start_test_params_t *test) {
/*
* Interrupt execution if query_lookup() or query_done() is called.
*/
ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
const ns_hook_t query_hooks[NS_QUERY_HOOKS_COUNT] = {
[NS_QUERY_LOOKUP_BEGIN] = {
.callback = ns_test_hook_catch_call,
.callback_data = NULL,
+3 -9
View File
@@ -46,8 +46,8 @@
./bin/confgen/keygen.c C 2009,2012,2013,2014,2015,2016,2017
./bin/confgen/keygen.h C 2009,2016
./bin/confgen/rndc-confgen.8 MAN DOCBOOK
./bin/confgen/rndc-confgen.c C 2001,2003,2004,2005,2007,2008,2009,2011,2013,2014,2016,2017
./bin/confgen/rndc-confgen.docbook SGML 2001,2003,2004,2005,2007,2009,2013,2014,2015,2016,2017
./bin/confgen/rndc-confgen.c C 2001,2003,2004,2005,2007,2008,2009,2011,2013,2014,2016
./bin/confgen/rndc-confgen.docbook SGML 2001,2003,2004,2005,2007,2009,2013,2014,2015,2016
./bin/confgen/rndc-confgen.html HTML DOCBOOK
./bin/confgen/unix/Makefile.in MAKE 2009,2012,2016
./bin/confgen/unix/os.c C 2009,2016
@@ -626,7 +626,7 @@
./bin/tests/system/acl/ns2/named7.conf CONF-C 2014,2016
./bin/tests/system/acl/setup.sh SH 2008,2012,2014,2016
./bin/tests/system/acl/tests.sh SH 2008,2012,2013,2014,2016
./bin/tests/system/additional/clean.sh SH 2013,2014,2016,2017
./bin/tests/system/additional/clean.sh SH 2013,2014,2016
./bin/tests/system/additional/ns1/mx.db ZONE 2016
./bin/tests/system/additional/ns1/named.args X 2013,2014
./bin/tests/system/additional/ns1/named1.conf CONF-C 2013,2016,2017
@@ -639,8 +639,6 @@
./bin/tests/system/additional/ns1/rt.db ZONE 2013,2016
./bin/tests/system/additional/ns1/rt2.db ZONE 2013,2016
./bin/tests/system/additional/ns1/srv.db ZONE 2016
./bin/tests/system/additional/ns3/named.conf CONF-C 2017
./bin/tests/system/additional/ns3/root.hint ZONE 2017
./bin/tests/system/additional/setup.sh SH 2013,2016
./bin/tests/system/additional/tests.sh SH 2013,2016,2017
./bin/tests/system/addzone/clean.sh SH 2010,2012,2013,2014,2015,2016,2017
@@ -2249,10 +2247,6 @@
./bin/tests/system/synthfromdnssec/ns3/named.conf CONF-C 2017
./bin/tests/system/synthfromdnssec/ns3/redirect.db ZONE 2017
./bin/tests/system/synthfromdnssec/ns3/root.hints ZONE 2017
./bin/tests/system/synthfromdnssec/ns4/named.conf CONF-C 2017
./bin/tests/system/synthfromdnssec/ns4/root.hints ZONE 2017
./bin/tests/system/synthfromdnssec/ns5/named.conf CONF-C 2017
./bin/tests/system/synthfromdnssec/ns5/root.hints ZONE 2017
./bin/tests/system/synthfromdnssec/prereq.sh SH 2017
./bin/tests/system/synthfromdnssec/setup.sh SH 2017
./bin/tests/system/synthfromdnssec/tests.sh SH 2017
+19
View File
@@ -219,6 +219,7 @@ my @projectlist = ("..\\bin\\check\\win32\\checkconf.vcxproj",
my %configdefh;
my @substdefh = ("AES_CC",
"ALLOW_FILTER_AAAA",
"CONFIGARGS",
"DNS_RDATASET_FIXED",
"ENABLE_RPZ_NSDNAME",
@@ -450,6 +451,7 @@ my @help = (
" enable-crypto-rand use crypto provider for random [default=yes]\n",
" enable-openssl-hash use OpenSSL for hash functions [default=yes]\n",
" enable-isc-spnego use SPNEGO from lib/dns [default=yes]\n",
" enable-filter-aaaa enable filtering of AAAA records [default=yes]\n",
" enable-fixed-rrset enable fixed rrset ordering [default=no]\n",
" enable-developer enable developer build settings [default=no]\n",
" enable-querytrace enable very verbose query trace [default=no]\n",
@@ -494,6 +496,7 @@ my $cryptolib = "";
my $enable_native_pkcs11 = "no";
my $enable_crypto_rand = "yes";
my $enable_openssl_hash = "auto";
my $enable_filter_aaaa = "yes";
my $enable_isc_spnego = "yes";
my $enable_fixed_rrset = "no";
my $enable_developer = "no";
@@ -714,6 +717,10 @@ sub myenable {
if ($val =~ /^no$/i) {
$enable_isc_spnego = "no";
}
} elsif ($key =~ /^filter-aaaa$/i) {
if ($val =~ /^no$/i) {
$enable_filter_aaaa = "no";
}
} elsif ($key =~ /^fixed-rrset$/i) {
if ($val =~ /^yes$/i) {
$enable_fixed_rrset = "yes";
@@ -748,6 +755,7 @@ sub myenable {
if ($enable_developer eq "yes") {
$configdefh{"ISC_LIST_CHECKINIT"} = 1;
$enable_filter_aaaa = "yes";
$enable_querytrace = "yes";
# no atf on WIN32
$enable_fixed_rrset = "yes";
@@ -997,6 +1005,11 @@ if ($verbose) {
} else {
print "isc-spnego: disabled\n";
}
if ($enable_filter_aaaa eq "yes") {
print "filter-aaaa: enabled\n";
} else {
print "filter-aaaa: disabled\n";
}
if ($enable_fixed_rrset eq "yes") {
print "fixed-rrset: enabled\n";
} else {
@@ -1396,6 +1409,11 @@ if ($enable_native_pkcs11 eq "yes") {
}
}
# enable-filter-aaaa
if ($enable_filter_aaaa eq "yes") {
$configdefh{"ALLOW_FILTER_AAAA"} = 1;
}
# enable-fixed-rrset
if ($enable_fixed_rrset eq "yes") {
$configdefh{"DNS_RDATASET_FIXED"} = 1;
@@ -3395,6 +3413,7 @@ exit 0;
# --enable-querytrace supported
# --disable-rpz-nsip supported
# --disable-rpz-nsdname supported
# --enable-filter-aaaa supported
# --enable-full-report supported by verbose
# --enable-dnstap not supported (requires libfstrm support on WIN32)
# --enable-seccomp not supported (Linux specific)