No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / autosign / ns1 / keygen.sh
blob9288df5529ef69b30e577b424ae59b0dd1b74b87
1 #!/bin/sh -e
3 # Copyright (C) 2009 Internet Systems Consortium, Inc. ("ISC")
5 # Permission to use, copy, modify, and/or distribute this software for any
6 # purpose with or without fee is hereby granted, provided that the above
7 # copyright notice and this permission notice appear in all copies.
9 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
10 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
12 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
14 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15 # PERFORMANCE OF THIS SOFTWARE.
17 # Id: keygen.sh,v 1.3 2009/11/30 23:48:02 tbox Exp
19 SYSTEMTESTTOP=../..
20 . $SYSTEMTESTTOP/conf.sh
22 RANDFILE=../random.data
24 zone=.
25 zonefile=root.db
26 infile=root.db.in
28 (cd ../ns2 && sh keygen.sh )
30 cat $infile ../ns2/dsset-example. > $zonefile
32 $KEYGEN -q -r $RANDFILE $zone > /dev/null
33 zskdel=`$KEYGEN -q -r $RANDFILE -D now $zone`
34 zskinact=`$KEYGEN -q -r $RANDFILE -I now $zone`
35 zskunpub=`$KEYGEN -q -r $RANDFILE -G $zone`
36 zsksby=`$KEYGEN -q -r $RANDFILE -A none $zone`
38 ksksby=`$KEYGEN -q -r $RANDFILE -P now -A now+15s -fk $zone`
39 kskrev=`$KEYGEN -q -r $RANDFILE -R now+15s -fk $zone`
41 cat $ksksby.key | grep -v '^; ' | $PERL -n -e '
42 local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
43 local $key = join("", @rest);
44 print <<EOF
45 trusted-keys {
46 "$dn" $flags $proto $alg "$key";
48 EOF
49 ' > trusted.conf
50 cp trusted.conf ../ns2/trusted.conf
51 cp trusted.conf ../ns3/trusted.conf
52 cp trusted.conf ../ns4/trusted.conf
54 cat $kskrev.key | grep -v '^; ' | $PERL -n -e '
55 local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
56 local $key = join("", @rest);
57 print <<EOF
58 trusted-keys {
59 "$dn" $flags $proto $alg "$key";
61 EOF
62 ' > trusted.conf
63 cp trusted.conf ../ns5/trusted.conf
65 echo $zskdel > ../del.key
66 echo $zskinact > ../inact.key
67 echo $zskunpub > ../unpub.key
68 echo $zsksby > ../standby.key
69 echo $kskrev > ../rev.key