tests.sh revision 792915beb01a45e47ad1cf7c6ae114b0bdf45653
#
# Copyright (C) 2004-2014 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2000-2002 Internet Software Consortium.
#
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: tests.sh,v 1.109 2012/02/22 23:47:34 tbox Exp $
status=0
n=1
DIGOPTS="+tcp +noadd +nosea +nostat +nocmd +dnssec -p 5300"
DELVEOPTS="-a ns1/trusted.conf"
# convert private-type records to readable form
echo "-- $@ --"
while read record; do
perl -e 'my $rdata = pack("H*", @ARGV[0]);
die "invalid record" unless length($rdata) == 5;
my ($alg, $key, $remove, $complete) = unpack("CnCC", $rdata);
my $action = "signing";
$action = "removing" if $remove;
my $state = " (incomplete)";
$state = " (complete)" if $complete;
print ("$action: alg: $alg, key: $key$state\n");' $record
done
}
# check that signing records are marked as complete
ret=0
echo $x | grep incomplete >&- 2>&- && ret=1
[ $ret = 1 ] && {
echo "$x"
echo "I:failed"
}
return $ret
}
# check that a zone file is raw format, version 0
read(STDIN, $input, 8);
($style, $version) = unpack("NN", $input);
exit 1 if ($style != 2 || $version != 0);'
return $?
}
# check that a zone file is raw format, version 1
read(STDIN, $input, 8);
($style, $version) = unpack("NN", $input);
exit 1 if ($style != 2 || $version != 1);'
return $?
}
# strip NS and RRSIG NS from input
}
# Check the example. domain
echo "I:checking that zone transfer worked ($n)"
do
ret=0
[ $ret = 0 ] && break
sleep 1
done
n=`expr $n + 1`
# test AD bit:
# - dig +adflag asks for authentication (ad in response)
echo "I:checking AD bit asking for validation ($n)"
ret=0
$DIG $DIGOPTS +noauth +noadd +nodnssec +adflag a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
$DIG $DIGOPTS +noauth +noadd +nodnssec +adflag a.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
# test AD bit:
# - dig +noadflag
echo "I:checking that AD is not set without +adflag or +dnssec ($n)"
ret=0
$DIG $DIGOPTS +noauth +noadd +nodnssec +noadflag a.example. @10.53.0.2 a > dig.out.ns2.test$n || ret=1
$DIG $DIGOPTS +noauth +noadd +nodnssec +noadflag a.example. @10.53.0.4 a > dig.out.ns4.test$n || ret=1
n=`expr $n + 1`
echo "I:checking for AD in authoritative answer ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation NSEC ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking postive validation NSEC using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking positive validation NSEC3 ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking positive validation NSEC3 using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking positive validation OPTOUT ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking positive validation OPTOUT using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking positive wildcard validation NSEC ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking positive wildcard validation NSEC using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking positive wildcard answer NSEC3 ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive wildcard answer NSEC3 ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive wildcard validation NSEC3 ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking positive wildcard validation NSEC3 using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking positive wildcard validation OPTOUT ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking positive wildcard validation OPTOUT using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NXDOMAIN NSEC ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN NSEC using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NXDOMAIN NSEC3 ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN NSEC3 using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NXDOMAIN OPTOUT ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NXDOMAIN OPTOUT using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NODATA NSEC ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NODATA NSEC3 ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NODATA NSEC3 using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative validation NODATA OPTOUT ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative validation NODATA OPTOUT using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t txt -s 10.53.0.4 a.optout.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:checking negative wildcard validation NSEC ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative wildcard validation NSEC using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking negative wildcard validation NSEC3 ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative wildcard validation NSEC3 using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t txt -s 10.53.0.4 b.wild.nsec3.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:checking negative wildcard validation OPTOUT ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking negative wildcard validation OPTOUT using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t txt -s 10.53.0.4 b.optout.nsec3.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
# Check the insecure.example domain
echo "I:checking 1-server insecurity proof NSEC ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof NSEC using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking 1-server insecurity proof NSEC3 ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof NSEC3 using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking 1-server insecurity proof OPTOUT ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server insecurity proof OPTOUT using dns_client ($n)"
n=`expr $n + 1`
fi
echo "I:checking 1-server negative insecurity proof NSEC ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof NSEC using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t a -s 10.53.0.4 q.insecure.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:checking 1-server negative insecurity proof NSEC3 ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof NSEC3 using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t a -s 10.53.0.4 q.insecure.nsec3.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:checking 1-server negative insecurity proof OPTOUT ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking 1-server negative insecurity proof OPTOUT using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t a -s 10.53.0.4 q.insecure.optout.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:checking 1-server negative insecurity proof with SOA hack NSEC ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking 1-server negative insecurity proof with SOA hack NSEC3 ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking 1-server negative insecurity proof with SOA hack OPTOUT ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
# Check the secure.example domain
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
ret=0
n=`expr $n + 1`
echo "I:checking empty NODATA OPTOUT ($n)"
ret=0
#grep "flags:.*ad.*QUERY" dig.out.ns4.test$n > /dev/null || ret=1
n=`expr $n + 1`
# Check the bogus domain
echo "I:checking failed validation ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking failed validation using dns_client ($n)"
n=`expr $n + 1`
fi
# Try validating with a bad trusted key.
# This should fail.
echo "I:checking that validation fails with a misconfigured trusted key ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that negative validation fails with a misconfigured trusted key ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that insecurity proofs fail with a misconfigured trusted key ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that validation fails when key record is missing ($n)"
ret=0
n=`expr $n + 1`
if [ -x ${DELVE} ] ; then
ret=0
echo "I:checking that validation fails when key record is missing using dns_client ($n)"
$DELVE $DELVEOPTS -p 5300 -t a -s 10.53.0.4 a.b.keyless.example > /dev/null 2> resolve.out$n || ret=1
n=`expr $n + 1`
fi
echo "I:Checking that a bad CNAME signature is caught after a +CD query ($n)"
ret=0
#prime
#check: requery with +CD. pending data should be returned even if it's bogus
10.0.0.1"
#check: requery without +CD. bogus cached data should be rejected.
n=`expr $n + 1`
echo "I:Checking that a bad DNAME signature is caught after a +CD query ($n)"
ret=0
#prime
#check: requery with +CD. pending data should be returned even if it's bogus
expect="example.
10.0.0.1"
#check: requery without +CD. bogus cached data should be rejected.
n=`expr $n + 1`
# Check the insecure.secure.example domain (insecurity proof)
echo "I:checking 2-server insecurity proof ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
# Check a negative response in insecure.secure.example
echo "I:checking 2-server insecurity proof with a negative answer ($n)"
ret=0
|| ret=1
|| ret=1
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking 2-server insecurity proof with a negative answer and SOA hack ($n)"
ret=0
|| ret=1
|| ret=1
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
# Check that the query for a security root is successful and has ad set
echo "I:checking security root query ($n)"
ret=0
n=`expr $n + 1`
# Check that the setting the cd bit works
echo "I:checking cd bit on a positive answer ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking cd bit on a negative answer ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking positive validation RSASHA256 NSEC ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation RSASHA512 NSEC ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation with KSK-only DNSKEY signature ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking cd bit on a query that should fail ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking cd bit on an insecurity proof ($n)"
ret=0
# Note - these are looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking cd bit on a negative insecurity proof ($n)"
ret=0
# Note - these are looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking that validation of an ANY query works ($n)"
ret=0
# 2 records in the zone, 1 NXT, 3 SIGs
n=`expr $n + 1`
echo "I:checking that validation of a query returning a CNAME works ($n)"
ret=0
# the CNAME & its sig, the TXT and its SIG
n=`expr $n + 1`
echo "I:checking that validation of a query returning a DNAME works ($n)"
ret=0
# The DNAME & its sig, the TXT and its SIG, and the synthesized CNAME.
# It would be nice to test that the CNAME is being synthesized by the
# recursive server and not cached, but I don't know how.
n=`expr $n + 1`
echo "I:checking that validation of an ANY query returning a CNAME works ($n)"
ret=0
# The CNAME, NXT, and their SIGs
n=`expr $n + 1`
echo "I:checking that validation of an ANY query returning a DNAME works ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that positive validation in a privately secure zone works ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking that negative validation in a privately secure zone works ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking that lookups succeed after disabling a algorithm works ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking privately secure to nxdomain works ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking privately secure wildcard to nxdomain works ($n)"
ret=0
# Note - this is looking for failure, hence the &&
n=`expr $n + 1`
echo "I:checking a non-cachable NODATA works ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking a non-cachable NXDOMAIN works ($n)"
ret=0
n=`expr $n + 1`
#
# private.secure.example is served by the same server as its
# grand parent and there is not a secure delegation from secure.example
# to private.secure.example. In addition secure.example is using a
# algorithm which the validation does not support.
#
echo "I:checking dnssec-lookaside-validation works ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that we can load a rfc2535 signed zone ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that we can transfer a rfc2535 signed zone ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that we can sign a zone with out-of-zone records ($n)"
ret=0
(
cd signer
$SIGNER -o example -f example.db example.db > /dev/null 2>&1
n=`expr $n + 1`
echo "I:checking that we can sign a zone (NSEC3) with out-of-zone records ($n)"
ret=0
(
cd signer
$SIGNER -3 - -H 10 -o example -f example.db example.db > /dev/null 2>&1
awk '/^IQF9LQTLK/ {
printf("%s", $0);
while (!index($0, ")")) {
if (getline <= 0)
break;
printf (" %s", $0);
}
printf("\n");
grep "IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG.example. 0 IN NSEC3 1 0 10 - ( IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG A NS SOA RRSIG DNSKEY NSEC3PARAM )" nsec3param.out > /dev/null
n=`expr $n + 1`
echo "I:checking NSEC3 signing with empty nonterminals above a delegation ($n)"
ret=0
(
cd signer
$SIGNER -3 - -A -H 10 -o example -f example3.db example3.db > /dev/null 2>&1
awk '/^IQF9LQTLK/ {
printf("%s", $0);
while (!index($0, ")")) {
if (getline <= 0)
break;
printf (" %s", $0);
}
printf("\n");
grep "IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG.example. 0 IN NSEC3 1 0 10 - ( IQF9LQTLKKNFK0KVIFELRAK4IC4QLTMG A NS SOA RRSIG DNSKEY NSEC3PARAM )" nsec3param.out > /dev/null
n=`expr $n + 1`
echo "I:checking that dnsssec-signzone updates originalttl on ttl changes ($n)"
ret=0
(
cd signer
$SIGNER -o example -f example.db.before example.db > /dev/null 2>&1
$SIGNER -o example -f example.db.after example.db.changed > /dev/null 2>&1
)
n=`expr $n + 1`
echo "I:checking dnssec-signzone keeps valid signatures from removed keys ($n)"
ret=0
(
cd signer
$SIGNER -D -o example example.db > /dev/null 2>&1
# now switch out key2 for key3 and resign the zone
$SIGNER -D -o example example.db > /dev/null 2>&1
n=`expr $n + 1`
echo "I:checking dnssec-signzone -R purges signatures from removed keys ($n)"
ret=0
(
cd signer
n=`expr $n + 1`
echo "I:checking dnssec-signzone keeps valid signatures from inactive keys ($n)"
ret=0
(
cd signer
# now retire key2 and resign the zone
n=`expr $n + 1`
echo "I:checking dnssec-signzone -Q purges signatures from inactive keys ($n)"
ret=0
(
cd signer
n=`expr $n + 1`
echo "I:checking dnssec-signzone retains unexpired signatures ($n)"
ret=0
(
cd signer
$SIGNER -Sxt -o example example.db > signer.out.1 2>&1
$SIGNER -Sxt -o example -f example.db.signed example.db.signed > signer.out.2 2>&1
n=`expr $n + 1`
echo "I:checking dnssec-signzone purges RRSIGs from formerly-owned glue (nsec) ($n)"
ret=0
(
cd signer
# remove NSEC-only keys
cat << EOF >> example2.db
sub1.example. IN A 10.53.0.1
ns.sub2.example. IN A 10.53.0.2
EOF
$SIGNER -DS -O full -f example2.db.signed -o example example2.db > /dev/null 2>&1
(
cd signer
cat << EOF >> example2.db
sub1.example. IN NS sub1.example.
sub1.example. IN A 10.53.0.1
sub2.example. IN NS ns.sub2.example.
ns.sub2.example. IN A 10.53.0.2
EOF
$SIGNER -DS -O full -f example2.db.signed -o example example2.db > /dev/null 2>&1
n=`expr $n + 1`
echo "I:checking dnssec-signzone purges RRSIGs from formerly-owned glue (nsec3) ($n)"
ret=0
(
cd signer
cat << EOF >> example2.db
sub1.example. IN A 10.53.0.1
ns.sub2.example. IN A 10.53.0.2
EOF
$SIGNER -DS -3 feedabee -O full -f example2.db.signed -o example example2.db > /dev/null 2>&1
(
cd signer
cat << EOF >> example2.db
sub1.example. IN NS sub1.example.
sub1.example. IN A 10.53.0.1
sub2.example. IN NS ns.sub2.example.
ns.sub2.example. IN A 10.53.0.2
EOF
$SIGNER -DS -3 feedabee -O full -f example2.db.signed -o example example2.db > /dev/null 2>&1
n=`expr $n + 1`
echo "I:checking dnssec-signzone output format ($n)"
ret=0
(
cd signer
$SIGNER -O full -f - -Sxt -o example example.db > signer.out.3 2> /dev/null
$SIGNER -O text -f - -Sxt -o example example.db > signer.out.4 2> /dev/null
$SIGNER -O raw -f signer.out.5 -Sxt -o example example.db > /dev/null 2>&1
$SIGNER -O raw=0 -f signer.out.6 -Sxt -o example example.db > /dev/null 2>&1
$SIGNER -O raw -f - -Sxt -o example example.db > signer.out.7 2> /dev/null
echo "I:checking dnssec-signzone output format ($n)"
ret=0
(
cd signer
$SIGNER -O full -f - -Sxt -o example example.db > signer.out.3 2>&1
$SIGNER -O text -f - -Sxt -o example example.db > signer.out.4 2>&1
echo "I:checking validated data are not cached longer than originalttl ($n)"
ret=0
n=`expr $n + 1`
# Test that "rndc secroots" is able to dump trusted keys
echo "I:checking rndc secroots ($n)"
ret=0
linecount=`cat ns4/named.secroots | wc -l`
n=`expr $n + 1`
# Check direct query for RRSIG. If we first ask for normal (non RRSIG)
# record, the corresponding RRSIG should be cached and subsequent query
# for RRSIG will be returned with the cached record.
echo "I:checking RRSIG query from cache ($n)"
ret=0
expect=`$DIG $DIGOPTS +short normalthenrrsig.secure.example. @10.53.0.3 rrsig | grep '^A' ` || ret=1
# also check that RA is set
n=`expr $n + 1`
# Check direct query for RRSIG: If it's not cached with other records,
# it should result in an empty response.
echo "I:checking RRSIG query not in cache ($n)"
ret=0
# also check that RA is cleared
n=`expr $n + 1`
#
# RT21868 regression test.
#
echo "I:checking NSEC3 zone with mismatched NSEC3PARAM / NSEC parameters ($n)"
ret=0
n=`expr $n + 1`
#
# RT22007 regression test.
#
echo "I:checking optout NSEC3 referral with only insecure delegations ($n)"
ret=0
grep "3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN.*NSEC3 1 1 1 - 3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
echo "I:checking optout NSEC3 NXDOMAIN with only insecure delegations ($n)"
ret=0
grep "3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN.*NSEC3 1 1 1 - 3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
echo "I:checking optout NSEC3 nodata with only insecure delegations ($n)"
ret=0
grep "3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN.*NSEC3 1 1 1 - 3KL3NK1HKQ4IUEEHBEF12VGFKUETNBAN" dig.out.ns2.test$n > /dev/null || ret=1
n=`expr $n + 1`
echo "I:checking that a zone finishing the transition from RSASHA1 to RSASHA256 validates secure ($n)"
ret=0
# Run a minimal update test if possible. This is really just
# a regression test for RT #2399; more tests should be added.
then
echo "I:running DNSSEC update test"
else
echo "I:The DNSSEC update test requires the Net::DNS library." >&2
fi
echo "I:checking managed key maintenance has not started yet ($n)"
ret=0
n=`expr $n + 1`
# Reconfigure caching server to use "dnssec-validation auto", and repeat
# some of the DNSSEC validation tests to ensure that it works correctly.
echo "I:switching to automatic root key configuration"
sleep 5
echo "I:checking managed key maintenance timer has now started ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation NSEC ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation NSEC3 ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking positive validation OPTOUT ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking negative validation ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that root DS queries validate ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking expired signatures remain with "'"allow-update { none; };"'" and no keys available ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking expired signatures do not validate ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that the NSEC3 record for the apex is properly signed when a DNSKEY is added via UPDATE ($n)"
ret=0
(
cd ns3
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk update-nsec3.example`
(
echo zone update-nsec3.example
echo server 10.53.0.3 5300
echo send
) | $NSUPDATE
)
n=`expr $n + 1`
echo "I:checking that the NSEC record is properly generated when DNSKEY are added via auto-dnssec ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that the NSEC3 record is properly generated when DNSKEY are added via auto-dnssec ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that signing records have been marked as complete ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing' without arguments is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -list' without zone is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -clear' without additional arguments is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -clear all' without zone is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param' without additional arguments is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param none' without zone is handled ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -nsec3param none > /dev/null 2>&1 && ret=1
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param 1' without additional arguments is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param 1 0' without additional arguments is handled ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param 1 0 0' without additional arguments is handled ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -nsec3param 1 0 0 > /dev/null 2>&1 && ret=1
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param 1 0 0 -' without zone is handled ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -nsec3param 1 0 0 - > /dev/null 2>&1 && ret=1
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param' works with salt ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -nsec3param 1 0 0 ffff inline.example > /dev/null 2>&1 || ret=1
if [ "$salt" = "FFFF" ]; then
break;
fi
echo "I:sleeping ...."
sleep 1
done;
n=`expr $n + 1`
echo "I:check that 'rndc signing -nsec3param' works without salt ($n)"
ret=0
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -nsec3param 1 0 0 - inline.example > /dev/null 2>&1 || ret=1
if [ "$salt" = "-" ]; then
break;
fi
echo "I:sleeping ...."
sleep 1
done;
n=`expr $n + 1`
echo "I:check rndc signing -list output ($n)"
ret=0
ret=1
}
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -list update-nsec3.example 2>&1 > signing.out
ret=1
}
n=`expr $n + 1`
echo "I:clear signing records ($n)"
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -clear all update-nsec3.example > /dev/null || ret=1
sleep 1
$RNDC -c ../common/rndc.conf -s 10.53.0.3 -p 9953 signing -list update-nsec3.example 2>&1 > signing.out
ret=1
}
n=`expr $n + 1`
echo "I:checking that a insecure zone beneath a cname resolves ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking that a secure zone beneath a cname resolves ($n)"
ret=0
n=`expr $n + 1`
echo "I:checking dnskey query with no data still gets put in cache ($n)"
ret=0
myDIGOPTS="+noadd +nosea +nostat +noquest +nocomm +nocmd -p 5300 @10.53.0.4"
sleep 1
then
sleep 1
then
echo "I: cannot confirm query answer still in cache"
ret=1
fi
fi
n=`expr $n + 1`
echo "I:check that a split dnssec dnssec-signzone work ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that a smart split dnssec dnssec-signzone work ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that NOTIFY is sent at the end of NSEC3 chain generation ($n)"
ret=0
(
echo zone nsec3chain-test
echo server 10.53.0.2 5300
echo update add nsec3chain-test. 0 nsec3param 1 0 1 123456
echo send
) | $NSUPDATE
do
then
break;
fi
echo "I:sleeping ...."
sleep 3
done;
sleep 3
n=`expr $n + 1`
echo "I:check dnssec-dsfromkey from stdin ($n)"
ret=0
# make canonical
awk '{
for (i=1;i<7;i++) printf("%s ", $i);
for (i=7;i<=NF;i++) printf("%s", $i);
printf("\n");
awk '{
for (i=1;i<7;i++) printf("%s ", $i);
for (i=7;i<=NF;i++) printf("%s", $i);
printf("\n");
n=`expr $n + 1`
echo "I:testing soon-to-expire RRSIGs without a replacement private key ($n)"
ret=0
$DIG +noall +answer +dnssec +nottl -p 5300 expiring.example ns @10.53.0.3 | grep RRSIG > dig.out.ns3.test$n 2>&1
# there must be a signature here
n=`expr $n + 1`
echo "I:testing new records are signed with 'no-resign' ($n)"
ret=0
(
echo zone nosign.example
echo server 10.53.0.3 5300
echo update add new.nosign.example 300 in txt "hi there"
echo send
) | $NSUPDATE
sleep 1
n=`expr $n + 1`
echo "I:testing expiring records aren't resigned with 'no-resign' ($n)"
ret=0
# the NS RRSIG should not be changed
n=`expr $n + 1`
echo "I:testing updates fail with no private key ($n)"
ret=0
(
echo zone nosign.example
echo server 10.53.0.3 5300
echo update add fail.nosign.example 300 in txt "reject me"
echo send
n=`expr $n + 1`
echo "I:testing legacy upper case signer name validation ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing that we lower case signer name ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing TTL is capped at RRSIG expiry time ($n)"
ret=0
(
cd ns3
done
$SIGNER -S -r $RANDFILE -N increment -e now+1mi -o expiring.example expiring.example.db > /dev/null 2>&1
done
done
n=`expr $n + 1`
echo "I:testing TTL is capped at RRSIG expiry time for records in the additional section ($n)"
ret=0
done
done
n=`expr $n + 1`
sleep 3
echo "I:testing TTL of about to expire RRsets with dnssec-accept-expired yes; ($n)"
ret=0
done
done
n=`expr $n + 1`
echo "I:testing TTL of expired RRsets with dnssec-accept-expired yes; ($n)"
ret=0
done
done
n=`expr $n + 1`
echo "I:testing TTL is capped at RRSIG expiry time for records in the additional section with dnssec-accept-expired yes; ($n)"
ret=0
done
done
n=`expr $n + 1`
echo "I:testing DNSKEY lookup via CNAME ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing KEY lookup at CNAME (present) ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing KEY lookup at CNAME (not present) ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing DNSKEY lookup via DNAME ($n)"
ret=0
n=`expr $n + 1`
echo "I:testing KEY lookup via DNAME ($n)"
ret=0
n=`expr $n + 1`
echo "I:check that named doesn't loop when all private keys are not available ($n)"
ret=0
n=`expr $n + 1`
echo "I:check against against missing nearest provable proof ($n)"
n=`expr $n + 1`
echo "I:check that key id are logged when dumping the cache ($n)"
ret=0
sleep 1
n=`expr $n + 1`
echo "I:check KEYDATA records are printed in human readable form in key zone ($n)"
# force the zone to be written out
ret=0
# restart the server
n=`expr $n + 1`
echo "I:check dig's +nocrypto flag ($n)"
ret=0
n=`expr $n + 1`
echo "I:check simultaneous inactivation and publishing of dnskeys removes inactive signature ($n)"
ret=0
cnt=0
while :
do
sleep 1
done
sigs=`grep RRSIG dig.out.ns3.test$n | wc -l`
n=`expr $n + 1`
echo "I:check that increasing the sig-validity-interval resigning triggers re-signing"
ret=0
do
sleep 1
done
n=`expr $n + 1`
sleep 3
echo "I:check insecure delegation between static-stub zones ($n)"
ret=0
n=`expr $n + 1`
echo "I:check the acceptance of seconds as inception and expiration times ($n)"
ret=0
in="NSEC 8 0 86400 1390003200 1389394800 33655 . NYWjZYBV1b+h4j0yu/SmPOOylR8P4IXKDzHX3NwEmU1SUp27aJ91dP+i+UBcnPmBib0hck4DrFVvpflCEpCnVQd2DexcN0GX+3PM7XobxhtDlmnU X1L47zJlbdHNwTqHuPaMM6Xy9HGMXps7O5JVyfggVhTz2C+G5OVxBdb2rOo="
exp="NSEC 8 0 86400 20140118000000 20140110230000 33655 . NYWjZYBV1b+h4j0yu/SmPOOylR8P4IXKDzHX3NwEmU1SUp27aJ91dP+i +UBcnPmBib0hck4DrFVvpflCEpCnVQd2DexcN0GX+3PM7XobxhtDlmnU X1L47zJlbdHNwTqHuPaMM6Xy9HGMXps7O5JVyfggVhTz2C+G5OVxBdb2 rOo="
n=`expr $n + 1`
echo "I:exit status: $status"
exit $status