Sync usage with man page.
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / dlv / ns3 / sign.sh
blob602962f88acd1d32a0272c50a3904194129cb39d
1 #!/bin/sh
3 # Copyright (C) 2004, 2007, 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: sign.sh,v 1.6 2009/10/27 23:47:44 tbox Exp
19 SYSTEMTESTTOP=../..
20 . $SYSTEMTESTTOP/conf.sh
22 RANDFILE=../random.data
23 dlvsets=
25 zone=child1.utld.
26 infile=child.db.in
27 zonefile=child1.utld.db
28 outfile=child1.signed
29 dlvzone=dlv.utld.
30 dlvsets="$dlvsets dlvset-$zone"
32 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
33 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
35 cat $infile $keyname1.key $keyname2.key >$zonefile
37 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
38 echo "I: signed $zone"
41 zone=child3.utld.
42 infile=child.db.in
43 zonefile=child3.utld.db
44 outfile=child3.signed
45 dlvzone=dlv.utld.
46 dlvsets="$dlvsets dlvset-$zone"
48 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
49 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
51 cat $infile $keyname1.key $keyname2.key >$zonefile
53 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
54 echo "I: signed $zone"
57 zone=child4.utld.
58 infile=child.db.in
59 zonefile=child4.utld.db
60 outfile=child4.signed
61 dlvzone=dlv.utld.
62 dlvsets="$dlvsets dlvset-$zone"
64 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
65 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
67 cat $infile $keyname1.key $keyname2.key >$zonefile
69 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
70 echo "I: signed $zone"
73 zone=child5.utld.
74 infile=child.db.in
75 zonefile=child5.utld.db
76 outfile=child5.signed
77 dlvzone=dlv.utld.
78 dlvsets="$dlvsets dlvset-$zone"
80 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
81 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
83 cat $infile $keyname1.key $keyname2.key >$zonefile
85 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
86 echo "I: signed $zone"
89 zone=child7.utld.
90 infile=child.db.in
91 zonefile=child7.utld.db
92 outfile=child7.signed
93 dlvzone=dlv.utld.
95 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
96 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
98 cat $infile $keyname1.key $keyname2.key >$zonefile
100 $SIGNER -g -r $RANDFILE -o $zone -f $outfile $zonefile > /dev/null
101 echo "I: signed $zone"
104 zone=child8.utld.
105 infile=child.db.in
106 zonefile=child8.utld.db
107 outfile=child8.signed
108 dlvzone=dlv.utld.
110 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
111 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
113 cat $infile $keyname1.key $keyname2.key >$zonefile
115 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
116 echo "I: signed $zone"
119 zone=child9.utld.
120 infile=child.db.in
121 zonefile=child9.utld.db
122 outfile=child9.signed
123 dlvzone=dlv.utld.
124 dlvsets="$dlvsets dlvset-$zone"
126 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
127 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
129 cat $infile $keyname1.key $keyname2.key >$zonefile
131 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
132 echo "I: signed $zone"
134 zone=child10.utld.
135 infile=child.db.in
136 zonefile=child10.utld.db
137 outfile=child10.signed
138 dlvzone=dlv.utld.
139 dlvsets="$dlvsets dlvset-$zone"
141 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
142 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
144 cat $infile $keyname1.key $keyname2.key >$zonefile
146 $SIGNER -g -r $RANDFILE -l $dlvzone -o $zone -f $outfile $zonefile > /dev/null
147 echo "I: signed $zone"
150 zone=dlv.utld.
151 infile=dlv.db.in
152 zonefile=dlv.utld.db
153 outfile=dlv.signed
154 dlvzone=dlv.utld.
156 keyname1=`$KEYGEN -r $RANDFILE -a DSA -b 768 -n zone $zone`
157 keyname2=`$KEYGEN -f KSK -r $RANDFILE -a DSA -b 768 -n zone $zone`
159 cat $infile $dlvsets $keyname1.key $keyname2.key >$zonefile
161 $SIGNER -g -r $RANDFILE -o $zone -f $outfile $zonefile > /dev/null
162 echo "I: signed $zone"
165 grep -v '^;' $keyname2.key | $PERL -n -e '
166 local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
167 local $key = join("", @rest);
168 print <<EOF
169 trusted-keys {
170 "$dn" $flags $proto $alg "$key";
173 ' > trusted.conf
174 cp trusted.conf ../ns5