sign.sh revision 247bf378605811d695e968dbe930a7fc45c0038e
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence#!/bin/sh -e
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews#
40f53fa8d9c6a4fc38c0014495e7a42b08f52481David Lawrence; Copyright (C) 2004, 2006-2011 Internet Systems Consortium, Inc. ("ISC")
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews; Copyright (C) 2000-2003 Internet Software Consortium.
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews;
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews; Permission to use, copy, modify, and/or distribute this software for any
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence; purpose with or without fee is hereby granted, provided that the above
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence; copyright notice and this permission notice appear in all copies.
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence;
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence; THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence; REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein; AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
ab023a65562e62b85a824509d829b6fad87e00b1Rob Austein; INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence; LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence; OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
91676aba5041ffeb9a9b6ce3b2984deba704cbb1David Lawrence; PERFORMANCE OF THIS SOFTWARE.
91676aba5041ffeb9a9b6ce3b2984deba704cbb1David Lawrence
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence# $Id: sign.sh,v 1.37 2011/05/03 16:07:44 marka Exp $
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrence
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid LawrenceSYSTEMTESTTOP=../..
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence. $SYSTEMTESTTOP/conf.sh
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan HuntRANDFILE=../random.data
2c25ca45a429e3afad8e6a9b77fdb7c00f8c2f40Mark Andrews
0c73b546ecfa49b9d1c8fdb9a48d4cd62176124aDavid Lawrencezone=.
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Huntinfile=root.db.in
f5898cf3484b1588d5239faa4062a2b2b606ce91Evan Huntzonefile=root.db
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence(cd ../ns2 && sh sign.sh )
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrence
ec32c6b36611bfc5e7bdd83f57a64e41f1eab873David Lawrencecp ../ns2/dsset-example. .
cp ../ns2/dsset-dlv. .
grep "8 [12] " ../ns2/dsset-algroll. > dsset-algroll.
keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
cat $infile $keyname.key > $zonefile
$SIGNER -P -g -r $RANDFILE -o $zone $zonefile > /dev/null
# Configure the resolving server with a trusted key.
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
local $key = join("", @rest);
print <<EOF
trusted-keys {
"$dn" $flags $proto $alg "$key";
};
EOF
' > trusted.conf
# ...or with a managed key.
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
local $key = join("", @rest);
print <<EOF
managed-keys {
"$dn" initial-key $flags $proto $alg "$key";
};
EOF
' > managed.conf
cp trusted.conf ../ns2/trusted.conf
cp trusted.conf ../ns3/trusted.conf
cp trusted.conf ../ns4/trusted.conf
cp trusted.conf ../ns6/trusted.conf
cp trusted.conf ../ns7/trusted.conf
cp managed.conf ../ns4/managed.conf
#
# Save keyid for managed key id test.
#
keyid=`expr $keyname : 'K.+001+\(.*\)'`
keyid=`expr $keyid + 0`
echo "$keyid" > managed.key.id