2009-10-27 22:25:37 +00:00
|
|
|
#!/bin/sh -e
|
2000-05-19 22:45:47 +00:00
|
|
|
#
|
2014-01-21 23:46:16 +00:00
|
|
|
# Copyright (C) 2004, 2006-2014 Internet Systems Consortium, Inc. ("ISC")
|
2012-06-29 11:39:47 +10:00
|
|
|
# Copyright (C) 2000-2002 Internet Software Consortium.
|
|
|
|
#
|
|
|
|
# Permission to use, copy, modify, and/or distribute this software for any
|
|
|
|
# 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.
|
2000-07-27 09:55:03 +00:00
|
|
|
|
2011-11-04 05:36:28 +00:00
|
|
|
# $Id: sign.sh,v 1.43 2011/11/04 05:36:28 each Exp $
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
SYSTEMTESTTOP=../..
|
|
|
|
. $SYSTEMTESTTOP/conf.sh
|
2000-06-22 22:00:42 +00:00
|
|
|
|
2000-05-15 22:53:15 +00:00
|
|
|
zone=secure.example.
|
|
|
|
infile=secure.example.db.in
|
|
|
|
zonefile=secure.example.db
|
|
|
|
|
2012-10-06 14:56:33 +10:00
|
|
|
cnameandkey=`$KEYGEN -T KEY -q -r $RANDFILE -a RSASHA1 -b 768 -n host cnameandkey.$zone`
|
|
|
|
dnameandkey=`$KEYGEN -T KEY -q -r $RANDFILE -a RSASHA1 -b 768 -n host dnameandkey.$zone`
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 768 -n zone $zone`
|
2000-05-15 22:53:15 +00:00
|
|
|
|
2012-10-06 14:56:33 +10:00
|
|
|
cat $infile $cnameandkey.key $dnameandkey.key $keyname.key >$zonefile
|
2000-05-15 22:53:15 +00:00
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2000-05-15 22:53:15 +00:00
|
|
|
|
2000-05-17 22:10:42 +00:00
|
|
|
zone=bogus.example.
|
|
|
|
infile=bogus.example.db.in
|
|
|
|
zonefile=bogus.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
2000-05-17 22:10:42 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2001-09-19 21:19:52 +00:00
|
|
|
|
2002-01-22 22:27:29 +00:00
|
|
|
zone=dynamic.example.
|
|
|
|
infile=dynamic.example.db.in
|
|
|
|
zonefile=dynamic.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname1=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
|
|
|
keyname2=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 1024 -n zone -f KSK $zone`
|
2002-01-22 22:27:29 +00:00
|
|
|
|
2006-03-06 01:27:52 +00:00
|
|
|
cat $infile $keyname1.key $keyname2.key >$zonefile
|
2002-01-22 22:27:29 +00:00
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2002-01-22 22:27:29 +00:00
|
|
|
|
2001-09-19 21:19:52 +00:00
|
|
|
zone=keyless.example.
|
|
|
|
infile=keyless.example.db.in
|
|
|
|
zonefile=keyless.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
2001-09-19 21:19:52 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2001-09-19 21:19:52 +00:00
|
|
|
|
|
|
|
# Change the signer field of the a.b.keyless.example SIG A
|
|
|
|
# to point to a provably nonexistent KEY record.
|
|
|
|
mv $zonefile.signed $zonefile.tmp
|
2014-06-24 13:50:14 +10:00
|
|
|
<$zonefile.tmp $PERL -p -e 's/ keyless.example/ b.keyless.example/
|
2001-09-19 21:19:52 +00:00
|
|
|
if /^a.b.keyless.example/../NXT/;' >$zonefile.signed
|
|
|
|
rm -f $zonefile.tmp
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# NSEC3/NSEC test zone
|
|
|
|
#
|
|
|
|
zone=secure.nsec3.example.
|
|
|
|
infile=secure.nsec3.example.db.in
|
|
|
|
zonefile=secure.nsec3.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# NSEC3/NSEC3 test zone
|
|
|
|
#
|
|
|
|
zone=nsec3.nsec3.example.
|
|
|
|
infile=nsec3.nsec3.example.db.in
|
|
|
|
zonefile=nsec3.nsec3.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# OPTOUT/NSEC3 test zone
|
|
|
|
#
|
|
|
|
zone=optout.nsec3.example.
|
|
|
|
infile=optout.nsec3.example.db.in
|
|
|
|
zonefile=optout.nsec3.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A nsec3 zone (non-optout).
|
|
|
|
#
|
|
|
|
zone=nsec3.example.
|
|
|
|
infile=nsec3.example.db.in
|
|
|
|
zonefile=nsec3.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -g -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# OPTOUT/NSEC test zone
|
|
|
|
#
|
|
|
|
zone=secure.optout.example.
|
|
|
|
infile=secure.optout.example.db.in
|
|
|
|
zonefile=secure.optout.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# OPTOUT/NSEC3 test zone
|
|
|
|
#
|
|
|
|
zone=nsec3.optout.example.
|
|
|
|
infile=nsec3.optout.example.db.in
|
|
|
|
zonefile=nsec3.optout.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# OPTOUT/OPTOUT test zone
|
|
|
|
#
|
|
|
|
zone=optout.optout.example.
|
|
|
|
infile=optout.optout.example.db.in
|
|
|
|
zonefile=optout.optout.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A optout nsec3 zone.
|
|
|
|
#
|
|
|
|
zone=optout.example.
|
|
|
|
infile=optout.example.db.in
|
|
|
|
zonefile=optout.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -g -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A nsec3 zone (non-optout) with unknown hash algorithm.
|
|
|
|
#
|
|
|
|
zone=nsec3-unknown.example.
|
|
|
|
infile=nsec3-unknown.example.db.in
|
|
|
|
zonefile=nsec3-unknown.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -U -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A optout nsec3 zone.
|
|
|
|
#
|
|
|
|
zone=optout-unknown.example.
|
|
|
|
infile=optout-unknown.example.db.in
|
|
|
|
zonefile=optout-unknown.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -3 - -U -A -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A multiple parameter nsec3 zone.
|
|
|
|
#
|
|
|
|
zone=multiple.example.
|
|
|
|
infile=multiple.example.db.in
|
|
|
|
zonefile=multiple.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
|
2008-09-24 02:46:23 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
mv $zonefile.signed $zonefile
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -u3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
mv $zonefile.signed $zonefile
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -u3 AAAA -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
mv $zonefile.signed $zonefile
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -u3 BBBB -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
mv $zonefile.signed $zonefile
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -u3 CCCC -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2008-09-24 02:46:23 +00:00
|
|
|
mv $zonefile.signed $zonefile
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -u3 DDDD -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2009-10-27 22:25:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A RSASHA256 zone.
|
|
|
|
#
|
|
|
|
zone=rsasha256.example.
|
|
|
|
infile=rsasha256.example.db.in
|
|
|
|
zonefile=rsasha256.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 768 -n zone $zone`
|
2009-10-27 22:25:37 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2009-10-27 22:25:37 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A RSASHA512 zone.
|
|
|
|
#
|
|
|
|
zone=rsasha512.example.
|
|
|
|
infile=rsasha512.example.db.in
|
|
|
|
zonefile=rsasha512.example.db
|
|
|
|
|
2009-10-28 00:27:10 +00:00
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA512 -b 1024 -n zone $zone`
|
2009-10-27 22:25:37 +00:00
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
2010-01-18 19:19:31 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
|
|
|
|
#
|
|
|
|
# A zone with the DNSKEY set only signed by the KSK
|
|
|
|
#
|
|
|
|
zone=kskonly.example.
|
|
|
|
infile=kskonly.example.db.in
|
|
|
|
zonefile=kskonly.example.db
|
|
|
|
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
cat $infile $kskname.key $zskname.key >$zonefile
|
|
|
|
$SIGNER -x -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2011-02-08 03:47:02 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A zone with the expired signatures
|
|
|
|
#
|
|
|
|
zone=expired.example.
|
|
|
|
infile=expired.example.db.in
|
|
|
|
zonefile=expired.example.db
|
|
|
|
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
cat $infile $kskname.key $zskname.key >$zonefile
|
2011-11-04 05:36:28 +00:00
|
|
|
$SIGNER -P -r $RANDFILE -o $zone -s -1d -e +1h $zonefile > /dev/null 2>&1
|
2011-02-08 03:47:02 +00:00
|
|
|
rm -f $kskname.* $zskname.*
|
2011-02-14 23:53:44 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A NSEC3 signed zone that will have a DNSKEY added to it via UPDATE.
|
|
|
|
#
|
|
|
|
zone=update-nsec3.example.
|
|
|
|
infile=update-nsec3.example.db.in
|
|
|
|
zonefile=update-nsec3.example.db
|
|
|
|
|
|
|
|
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
|
|
|
|
cat $infile $kskname.key $zskname.key >$zonefile
|
|
|
|
$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2011-02-15 22:02:36 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# A NSEC signed zone that will have auto-dnssec enabled and
|
|
|
|
# extra keys not in the initial signed zone.
|
|
|
|
#
|
|
|
|
zone=auto-nsec.example.
|
|
|
|
infile=auto-nsec.example.db.in
|
|
|
|
zonefile=auto-nsec.example.db
|
|
|
|
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
cat $infile $kskname.key $zskname.key >$zonefile
|
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
|
|
|
|
#
|
|
|
|
# A NSEC3 signed zone that will have auto-dnssec enabled and
|
|
|
|
# extra keys not in the initial signed zone.
|
|
|
|
#
|
|
|
|
zone=auto-nsec3.example.
|
|
|
|
infile=auto-nsec3.example.db.in
|
|
|
|
zonefile=auto-nsec3.example.db
|
|
|
|
|
|
|
|
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
|
|
|
|
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
|
|
|
|
cat $infile $kskname.key $zskname.key >$zonefile
|
|
|
|
$SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2011-02-23 11:30:35 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Secure below cname test zone.
|
|
|
|
#
|
|
|
|
zone=secure.below-cname.example.
|
|
|
|
infile=secure.below-cname.example.db.in
|
|
|
|
zonefile=secure.below-cname.example.db
|
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 1024 -n zone $zone`
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2011-02-28 14:21:35 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Patched TTL test zone.
|
|
|
|
#
|
|
|
|
zone=ttlpatch.example.
|
|
|
|
infile=ttlpatch.example.db.in
|
|
|
|
zonefile=ttlpatch.example.db
|
|
|
|
signedfile=ttlpatch.example.db.signed
|
|
|
|
patchedfile=ttlpatch.example.db.patched
|
|
|
|
|
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 768 -n zone $zone`
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
|
|
|
$SIGNER -P -r $RANDFILE -f $signedfile -o $zone $zonefile > /dev/null 2>&1
|
2011-03-31 15:58:51 +00:00
|
|
|
$CHECKZONE -D -s full $zone $signedfile 2> /dev/null | \
|
|
|
|
awk '{$2 = "3600"; print}' > $patchedfile
|
2011-03-05 06:35:41 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# Seperate DNSSEC records.
|
|
|
|
#
|
|
|
|
zone=split-dnssec.example.
|
|
|
|
infile=split-dnssec.example.db.in
|
|
|
|
zonefile=split-dnssec.example.db
|
|
|
|
signedfile=split-dnssec.example.db.signed
|
|
|
|
|
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 768 -n zone $zone`
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
echo '$INCLUDE "'"$signedfile"'"' >> $zonefile
|
|
|
|
: > $signedfile
|
|
|
|
$SIGNER -P -r $RANDFILE -D -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
|
|
|
|
#
|
|
|
|
# Seperate DNSSEC records smart signing.
|
|
|
|
#
|
|
|
|
zone=split-smart.example.
|
|
|
|
infile=split-smart.example.db.in
|
|
|
|
zonefile=split-smart.example.db
|
|
|
|
signedfile=split-smart.example.db.signed
|
|
|
|
|
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 768 -n zone $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
echo '$INCLUDE "'"$signedfile"'"' >> $zonefile
|
|
|
|
: > $signedfile
|
|
|
|
$SIGNER -P -S -r $RANDFILE -D -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
|
2011-05-23 20:10:03 +00:00
|
|
|
#
|
|
|
|
# Zone with signatures about to expire, but no private key to replace them
|
|
|
|
#
|
2011-05-19 00:31:57 +00:00
|
|
|
zone="expiring.example."
|
|
|
|
infile="expiring.example.db.in"
|
|
|
|
zonefile="expiring.example.db"
|
|
|
|
signedfile="expiring.example.db.signed"
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE -f KSK $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
$SIGNER -S -r $RANDFILE -e now+1mi -o $zone $zonefile > /dev/null 2>&1
|
2012-07-25 17:06:34 -05:00
|
|
|
mv -f ${zskname}.private ${zskname}.private.moved
|
|
|
|
mv -f ${kskname}.private ${kskname}.private.moved
|
2011-05-19 00:31:57 +00:00
|
|
|
|
2012-05-17 10:44:16 -07:00
|
|
|
#
|
|
|
|
# A zone where the signer's name has been forced to uppercase.
|
|
|
|
#
|
|
|
|
zone="upper.example."
|
|
|
|
infile="upper.example.db.in"
|
|
|
|
zonefile="upper.example.db"
|
|
|
|
lower="upper.example.db.lower"
|
|
|
|
signedfile="upper.example.db.signed"
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE -f KSK $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
$SIGNER -P -S -r $RANDFILE -o $zone -f $lower $zonefile > /dev/null 2>&1
|
|
|
|
$CHECKZONE -D upper.example $lower 2>&- | \
|
2012-05-21 10:13:08 +10:00
|
|
|
sed '/RRSIG/s/ upper.example. / UPPER.EXAMPLE. /' > $signedfile
|
2012-05-17 10:44:16 -07:00
|
|
|
|
|
|
|
#
|
|
|
|
# Check that the signer's name is in lower case when zone name is in
|
|
|
|
# upper case.
|
|
|
|
#
|
|
|
|
zone="LOWER.EXAMPLE."
|
|
|
|
infile="lower.example.db.in"
|
|
|
|
zonefile="lower.example.db"
|
|
|
|
signedfile="lower.example.db.signed"
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE -f KSK $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
$SIGNER -P -S -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
|
2011-05-23 20:10:03 +00:00
|
|
|
#
|
|
|
|
# Zone with signatures about to expire, and dynamic, but configured
|
|
|
|
# not to resign with 'auto-resign no;'
|
|
|
|
#
|
|
|
|
zone="nosign.example."
|
|
|
|
infile="nosign.example.db.in"
|
|
|
|
zonefile="nosign.example.db"
|
|
|
|
signedfile="nosign.example.db.signed"
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE -f KSK $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
$SIGNER -S -r $RANDFILE -e now+1mi -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
# preserve a normalized copy of the NS RRSIG for comparison later
|
|
|
|
$CHECKZONE -D nosign.example nosign.example.db.signed 2>&- | \
|
|
|
|
awk '$4 == "RRSIG" && $5 == "NS" {$2 = ""; print}' | \
|
|
|
|
sed 's/[ ][ ]*/ /g'> ../nosign.before
|
|
|
|
|
2012-08-13 22:24:36 -07:00
|
|
|
#
|
|
|
|
# An inline signing zone
|
|
|
|
#
|
|
|
|
zone=inline.example.
|
|
|
|
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
|
2013-08-15 10:48:05 +10:00
|
|
|
|
|
|
|
#
|
|
|
|
# publish a new key while deactivating another key at the same time.
|
|
|
|
#
|
|
|
|
zone=publish-inactive.example
|
|
|
|
infile=publish-inactive.example.db.in
|
|
|
|
zonefile=publish-inactive.example.db
|
|
|
|
now=`date -u +%Y%m%d%H%M%S`
|
|
|
|
kskname=`$KEYGEN -q -r $RANDFILE -f KSK $zone`
|
|
|
|
kskname=`$KEYGEN -P $now+90s -A $now+3600s -q -r $RANDFILE -f KSK $zone`
|
|
|
|
kskname=`$KEYGEN -I $now+90s -q -r $RANDFILE -f KSK $zone`
|
|
|
|
zskname=`$KEYGEN -q -r $RANDFILE $zone`
|
|
|
|
cp $infile $zonefile
|
|
|
|
$SIGNER -S -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
2013-09-04 13:45:00 +10:00
|
|
|
|
|
|
|
#
|
|
|
|
# A zone which will change its sig-validity-interval
|
|
|
|
#
|
|
|
|
zone=siginterval.example
|
|
|
|
infile=siginterval.example.db.in
|
|
|
|
zonefile=siginterval.example.db
|
|
|
|
kskname=`$KEYGEN -q -3 -r $RANDFILE -fk $zone`
|
|
|
|
zskname=`$KEYGEN -q -3 -r $RANDFILE $zone`
|
|
|
|
cp $infile $zonefile
|
2014-06-18 16:47:22 -07:00
|
|
|
|
|
|
|
#
|
|
|
|
# A zone with a bad DS in the parent
|
|
|
|
# (sourced from bogus.example.db.in)
|
|
|
|
#
|
|
|
|
zone=badds.example.
|
|
|
|
infile=bogus.example.db.in
|
|
|
|
zonefile=badds.example.db
|
|
|
|
|
|
|
|
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
|
|
|
|
|
|
|
|
cat $infile $keyname.key >$zonefile
|
|
|
|
|
|
|
|
$SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
|
|
|
|
sed -e 's/bogus/badds/g' < dsset-bogus.example. > dsset-badds.example.
|