sign.sh revision 60988462e5d6db53205851d056e3482a29239be9
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2010, 2012, 2014 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Permission to use, copy, modify, and/or distribute this software for any
dafcb997e390efa4423883dafd100c975c4095d6Mark Andrews# purpose with or without fee is hereby granted, provided that the above
0f5542c35c24e78f92182850bcd87e72cd6e1d49Andreas Gustafsson# copyright notice and this permission notice appear in all copies.
0f5542c35c24e78f92182850bcd87e72cd6e1d49Andreas Gustafsson# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
9c3531d72aeaad6c5f01efe6a1c82023e1379e4dDavid Lawrence# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
c2bc56dc65b4b103a5600565680eb5f33fa4c90bMark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
0f5542c35c24e78f92182850bcd87e72cd6e1d49Andreas Gustafsson# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt# PERFORMANCE OF THIS SOFTWARE.
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt(cd ../ns4 && $SHELL -e sign.sh )
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Huntkeyname1=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $zone`
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Huntkeyname2=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 2048 -f KSK -n zone $zone`
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Huntcat $infile $keyname1.key $keyname2.key > $zonefile
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt$SIGNER -g -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt# Configure the resolving server with a trusted key.
d8ecccc889a73a496de29e263ede0e1105b3b8c3Michael Sawyercat $keyname2.key | grep -v '^; ' | $PERL -n -e '
d8ecccc889a73a496de29e263ede0e1105b3b8c3Michael Sawyerlocal ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
d8ecccc889a73a496de29e263ede0e1105b3b8c3Michael Sawyerlocal $key = join("", @rest);
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunttrusted-keys {
45fd95544cd650a8e6a0fc39b656d1109b811ac0Evan Hunt "$dn" $flags $proto $alg "$key";