No empty .Rs/.Re
[netbsd-mini2440.git] / external / bsd / bind / dist / bin / tests / system / dnssec / ns3 / sign.sh
blob616a9357b139c1d7b6670a8670d0a56405e36631
1 #!/bin/sh -e
3 # Copyright (C) 2004, 2006-2009 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000-2002 Internet Software Consortium.
6 # Permission to use, copy, modify, and/or distribute this software for any
7 # purpose with or without fee is hereby granted, provided that the above
8 # copyright notice and this permission notice appear in all copies.
10 # THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
11 # REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
12 # AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
13 # INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
14 # LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
15 # OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16 # PERFORMANCE OF THIS SOFTWARE.
18 # Id: sign.sh,v 1.30 2009/10/28 00:27:10 marka Exp
20 SYSTEMTESTTOP=../..
21 . $SYSTEMTESTTOP/conf.sh
23 RANDFILE=../random.data
25 zone=secure.example.
26 infile=secure.example.db.in
27 zonefile=secure.example.db
29 keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA1 -b 768 -n zone $zone`
31 cat $infile $keyname.key >$zonefile
33 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
35 zone=bogus.example.
36 infile=bogus.example.db.in
37 zonefile=bogus.example.db
39 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
41 cat $infile $keyname.key >$zonefile
43 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
45 zone=dynamic.example.
46 infile=dynamic.example.db.in
47 zonefile=dynamic.example.db
49 keyname1=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
50 keyname2=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 1024 -n zone -f KSK $zone`
52 cat $infile $keyname1.key $keyname2.key >$zonefile
54 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
56 zone=keyless.example.
57 infile=keyless.example.db.in
58 zonefile=keyless.example.db
60 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
62 cat $infile $keyname.key >$zonefile
64 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
66 # Change the signer field of the a.b.keyless.example SIG A
67 # to point to a provably nonexistent KEY record.
68 mv $zonefile.signed $zonefile.tmp
69 <$zonefile.tmp perl -p -e 's/ keyless.example/ b.keyless.example/
70 if /^a.b.keyless.example/../NXT/;' >$zonefile.signed
71 rm -f $zonefile.tmp
74 # NSEC3/NSEC test zone
76 zone=secure.nsec3.example.
77 infile=secure.nsec3.example.db.in
78 zonefile=secure.nsec3.example.db
80 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
82 cat $infile $keyname.key >$zonefile
84 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
87 # NSEC3/NSEC3 test zone
89 zone=nsec3.nsec3.example.
90 infile=nsec3.nsec3.example.db.in
91 zonefile=nsec3.nsec3.example.db
93 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
95 cat $infile $keyname.key >$zonefile
97 $SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
100 # OPTOUT/NSEC3 test zone
102 zone=optout.nsec3.example.
103 infile=optout.nsec3.example.db.in
104 zonefile=optout.nsec3.example.db
106 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
108 cat $infile $keyname.key >$zonefile
110 $SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
113 # A nsec3 zone (non-optout).
115 zone=nsec3.example.
116 infile=nsec3.example.db.in
117 zonefile=nsec3.example.db
119 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
121 cat $infile $keyname.key >$zonefile
123 $SIGNER -P -g -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
126 # OPTOUT/NSEC test zone
128 zone=secure.optout.example.
129 infile=secure.optout.example.db.in
130 zonefile=secure.optout.example.db
132 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
134 cat $infile $keyname.key >$zonefile
136 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
139 # OPTOUT/NSEC3 test zone
141 zone=nsec3.optout.example.
142 infile=nsec3.optout.example.db.in
143 zonefile=nsec3.optout.example.db
145 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
147 cat $infile $keyname.key >$zonefile
149 $SIGNER -P -3 - -r $RANDFILE -o $zone $zonefile > /dev/null
152 # OPTOUT/OPTOUT test zone
154 zone=optout.optout.example.
155 infile=optout.optout.example.db.in
156 zonefile=optout.optout.example.db
158 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
160 cat $infile $keyname.key >$zonefile
162 $SIGNER -P -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
165 # A optout nsec3 zone.
167 zone=optout.example.
168 infile=optout.example.db.in
169 zonefile=optout.example.db
171 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
173 cat $infile $keyname.key >$zonefile
175 $SIGNER -P -g -3 - -A -r $RANDFILE -o $zone $zonefile > /dev/null
178 # A nsec3 zone (non-optout) with unknown hash algorithm.
180 zone=nsec3-unknown.example.
181 infile=nsec3-unknown.example.db.in
182 zonefile=nsec3-unknown.example.db
184 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
186 cat $infile $keyname.key >$zonefile
188 $SIGNER -P -3 - -U -r $RANDFILE -o $zone $zonefile > /dev/null
191 # A optout nsec3 zone.
193 zone=optout-unknown.example.
194 infile=optout-unknown.example.db.in
195 zonefile=optout-unknown.example.db
197 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
199 cat $infile $keyname.key >$zonefile
201 $SIGNER -P -3 - -U -A -r $RANDFILE -o $zone $zonefile > /dev/null
204 # A multiple parameter nsec3 zone.
206 zone=multiple.example.
207 infile=multiple.example.db.in
208 zonefile=multiple.example.db
210 keyname=`$KEYGEN -q -r $RANDFILE -a NSEC3RSASHA1 -b 768 -n zone $zone`
212 cat $infile $keyname.key >$zonefile
214 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
215 mv $zonefile.signed $zonefile
216 $SIGNER -P -u3 - -r $RANDFILE -o $zone $zonefile > /dev/null
217 mv $zonefile.signed $zonefile
218 $SIGNER -P -u3 AAAA -r $RANDFILE -o $zone $zonefile > /dev/null
219 mv $zonefile.signed $zonefile
220 $SIGNER -P -u3 BBBB -r $RANDFILE -o $zone $zonefile > /dev/null
221 mv $zonefile.signed $zonefile
222 $SIGNER -P -u3 CCCC -r $RANDFILE -o $zone $zonefile > /dev/null
223 mv $zonefile.signed $zonefile
224 $SIGNER -P -u3 DDDD -r $RANDFILE -o $zone $zonefile > /dev/null
227 # A RSASHA256 zone.
229 zone=rsasha256.example.
230 infile=rsasha256.example.db.in
231 zonefile=rsasha256.example.db
233 keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 768 -n zone $zone`
235 cat $infile $keyname.key >$zonefile
237 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null
240 # A RSASHA512 zone.
242 zone=rsasha512.example.
243 infile=rsasha512.example.db.in
244 zonefile=rsasha512.example.db
246 keyname=`$KEYGEN -q -r $RANDFILE -a RSASHA512 -b 1024 -n zone $zone`
248 cat $infile $keyname.key >$zonefile
250 $SIGNER -P -r $RANDFILE -o $zone $zonefile > /dev/null