Remove building with NOCRYPTO option
[minix.git] / external / bsd / bind / dist / bin / tests / system / dnssec / ns1 / sign.sh
blob8e9005b803ff173bbb0547906607d611c06fd8a6
1 #!/bin/sh -e
3 # Copyright (C) 2004, 2006-2014 Internet Systems Consortium, Inc. ("ISC")
4 # Copyright (C) 2000-2003 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 SYSTEMTESTTOP=../..
19 . $SYSTEMTESTTOP/conf.sh
21 zone=.
22 infile=root.db.in
23 zonefile=root.db
25 (cd ../ns2 && $SHELL sign.sh )
26 (cd ../ns6 && $SHELL sign.sh )
27 (cd ../ns7 && $SHELL sign.sh )
29 cp ../ns2/dsset-example. .
30 cp ../ns2/dsset-dlv. .
31 cp ../ns2/dsset-in-addr.arpa. .
33 grep "8 [12] " ../ns2/dsset-algroll. > dsset-algroll.
34 cp ../ns6/dsset-optout-tld. .
36 keyname=`$KEYGEN -q -r $RANDFILE -a RSAMD5 -b 768 -n zone $zone`
38 cat $infile $keyname.key > $zonefile
40 $SIGNER -P -g -r $RANDFILE -o $zone $zonefile > /dev/null
42 # Configure the resolving server with a trusted key.
43 cat $keyname.key | grep -v '^; ' | $PERL -n -e '
44 local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
45 local $key = join("", @rest);
46 print <<EOF
47 trusted-keys {
48 "$dn" $flags $proto $alg "$key";
50 EOF
51 ' > trusted.conf
53 # ...or with a managed key.
54 cat $keyname.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 managed-keys {
59 "$dn" initial-key $flags $proto $alg "$key";
61 EOF
62 ' > managed.conf
63 cp trusted.conf ../ns2/trusted.conf
64 cp trusted.conf ../ns3/trusted.conf
65 cp trusted.conf ../ns4/trusted.conf
66 cp trusted.conf ../ns6/trusted.conf
67 cp trusted.conf ../ns7/trusted.conf
68 cp managed.conf ../ns4/managed.conf
70 # Save keyid for managed key id test.
72 keyid=`expr $keyname : 'K.+001+\(.*\)'`
73 keyid=`expr $keyid + 0`
74 echo "$keyid" > managed.key.id