45c5f403619029a363cf089e0a4b1bb44425dd84Tinderbox User# Copyright (C) 2009-2012, 2014-2017 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
2f4561bc9cd5e5cdc58e29e600303c812f6902eeAutomatic Updater# $Id: keygen.sh,v 1.15 2012/02/06 23:46:46 tbox Exp $
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -3 -q -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
75b8de87879ad017c9cd2ffc328e5d2391d16e99Evan Hunt# A nsec3 zone (non-optout).
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
79ce3a9e82384cc31fd6b86be8f3d1474fcfd9f4Evan Hunt# An NSEC3 zone, with NSEC3 parameters set prior to signing
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -G -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewszsk=`$KEYGEN -G -q -3 -r $RANDFILE $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
75b8de87879ad017c9cd2ffc328e5d2391d16e99Evan Hunt# A optout nsec3 zone.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
75b8de87879ad017c9cd2ffc328e5d2391d16e99Evan Hunt# A RSASHA256 zone.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -a RSASHA256 -b 2048 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -a RSASHA256 -b 1024 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
75b8de87879ad017c9cd2ffc328e5d2391d16e99Evan Hunt# A RSASHA512 zone.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -a RSASHA512 -b 2048 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -a RSASHA512 -b 1024 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
e11a0c114cdaf8f7e7832e9f1a011138248093a6Evan Hunt# NSEC-only zone.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
e11a0c114cdaf8f7e7832e9f1a011138248093a6Evan Hunt# Signature refresh test zone. Signatures are set to expire long
e11a0c114cdaf8f7e7832e9f1a011138248093a6Evan Hunt# in the past; they should be updated by autosign.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -PS -s now-1y -e now-6mo -o $zone -f $zonefile $infile > s.out 2>&1 || dumpit s.out
e11a0c114cdaf8f7e7832e9f1a011138248093a6Evan Hunt# NSEC3->NSEC transition test zone.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -a RSASHA512 -b 2048 -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -a RSASHA512 -b 1024 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -3 beef -A -o $zone -f $zonefile $infile > s.out 2>&1 || dumpit s.out
5ae2eac4c16bdbbef032544bd9fc86f47e7bdc2cMark Andrews# secure-to-insecure transition test zone; used to test removal of
5ae2eac4c16bdbbef032544bd9fc86f47e7bdc2cMark Andrews# keys via nsupdate
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -o $zone -f $zonefile $infile > s.out 2>&1 || dumpit s.out
5ae2eac4c16bdbbef032544bd9fc86f47e7bdc2cMark Andrews# another secure-to-insecure transition test zone; used to test
5ae2eac4c16bdbbef032544bd9fc86f47e7bdc2cMark Andrews# removal of keys on schedule.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewszsk=`$KEYGEN -q -3 -r $RANDFILE $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -3 beef -o $zone -f $zonefile $infile > s.out 2>&1 || dumpit s.out
bbedadf76ab670b01887fb9b41097120ea4fdf14Evan Hunt# Introducing a pre-published key test.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -3 beef -o $zone -f $zonefile $infile > s.out 2>&1 || dumpit s.out
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# Key TTL tests.
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# no default key TTL; DNSKEY should get SOA TTL
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# default key TTL should be used
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -fk -L 60 $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -L 60 $zone > kg.out 2>&1 || dumpit kg.out
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# mismatched key TTLs, should use shortest
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -fk -L 30 $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -L 60 $zone > kg.out 2>&1 || dumpit kg.out
61bcc232038f0a2cb77ed6269675fdc288f5ec98Evan Hunt# existing DNSKEY RRset, should retain TTL
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -L 30 -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -3 -q -r $RANDFILE -L 180 $zone > kg.out 2>&1 || dumpit kg.out
319b8a14881a95996af3a9ba4a20f144eb766b31Evan Hunt# A zone with a DNSKEY RRset that is published before it's activated
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewsksk=`$KEYGEN -G -q -3 -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrewszsk=`$KEYGEN -G -q -3 -r $RANDFILE $zone 2> kg.out` || dumpit kg.out
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# A zone with signatures that are already expired, and the private ZSK
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# is missing.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -P -s now-1mo -e now-1mi -o $zone -f $zonefile ${zonefile}.in > s.out 2>&1 || dumpit s.out
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# A zone with signatures that are already expired, and the private ZSK
b47c020d5c635b662ac57e5485d266fd62c796c0Evan Hunt# is inactive.
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SIGNER -S -P -s now-1mo -e now-1mi -o $zone -f $zonefile ${zonefile}.in > s.out 2>&1 || dumpit s.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$SETTIME -I now $zsk > st.out 2>&1 || dumpit st.out
99f6179191e583d23f3c5567d3c00b57b64eb52dEvan Hunt# A zone that is set to 'auto-dnssec maintain' during a recofnig
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE -fk $zone > kg.out 2>&1 || dumpit kg.out
ad127d839d2e7aa542939a8a336691407e23397eMark Andrews$KEYGEN -q -3 -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
e939674d53a127ddeeaf4b41fd72933f0b493308Mark Andrews# A zone which generates a CDS and CDNSEY RRsets automatically
e939674d53a127ddeeaf4b41fd72933f0b493308Mark Andrewsksk=`$KEYGEN -3 -q -r $RANDFILE -fk -P sync now $zone 2> kg.out` || dumpit kg.out
e939674d53a127ddeeaf4b41fd72933f0b493308Mark Andrews$KEYGEN -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews# A zone that has a published inactive key that is autosigned.
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrewsksk=`$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -Pnow -A now+3600 -fk $zone 2> kg.out` || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
677f507de7c546c187c1505c48bc7b440545485cMark Andrews# A zone that has a published inactive key that is autosigned.
677f507de7c546c187c1505c48bc7b440545485cMark Andrewsksk=`$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
677f507de7c546c187c1505c48bc7b440545485cMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews# A zone that starts with a active KSK + ZSK and a inactive ZSK.
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -P now -A now+3600 -fk $zone > kg.out 2>&1 || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrewsksk=`$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
15057131d5f815e8b6b2b9a58961d6707e317440Mark Andrews# A zone that starts with a active KSK + ZSK and a inactive ZSK.
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrewsksk=`$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -fk $zone 2> kg.out` || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE $zone > kg.out 2>&1 || dumpit kg.out
0d6328ce5f6b799f8e7c6cbbb3b965cf29bfb7baMark Andrews$KEYGEN -a NSEC3RSASHA1 -b 1024 -3 -q -r $RANDFILE -P now -A now+3600 $zone > kg.out 2>&1 || dumpit kg.out