etc/services - sync with NetBSD-8
[minix.git] / external / bsd / bind / dist / bin / tests / system / pkcs11 / setup.sh
blobceebff50d4baa0dbad99e24b2da4e30a89dd20e8
1 #!/bin/sh
3 # Copyright (C) 2010, 2012-2014 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 SYSTEMTESTTOP=..
18 . $SYSTEMTESTTOP/conf.sh
20 infile=ns1/example.db.in
22 /bin/echo -n ${HSMPIN:-1234}> pin
23 PWD=`pwd`
25 supported=`cat supported`
27 zone=rsa.example
28 zonefile=ns1/rsa.example.db
29 if [ "$supported" != "ecconly" ]; then
30 $PK11GEN -a RSA -b 1024 -l robie-rsa-zsk1 -i 01
31 $PK11GEN -a RSA -b 1024 -l robie-rsa-zsk2 -i 02
32 $PK11GEN -a RSA -b 2048 -l robie-rsa-ksk
34 rsazsk1=`$KEYFRLAB -a RSASHA1 \
35 -l "object=robie-rsa-zsk1;pin-source=$PWD/pin" rsa.example`
36 rsazsk2=`$KEYFRLAB -a RSASHA1 \
37 -l "object=robie-rsa-zsk2;pin-source=$PWD/pin" rsa.example`
38 rsaksk=`$KEYFRLAB -a RSASHA1 -f ksk \
39 -l "object=robie-rsa-ksk;pin-source=$PWD/pin" rsa.example`
41 cat $infile $rsazsk1.key $rsaksk.key > $zonefile
42 $SIGNER -a -P -g -r $RANDFILE -o $zone $zonefile \
43 > /dev/null 2> signer.err || cat signer.err
44 cp $rsazsk2.key ns1/rsa.key
45 mv Krsa* ns1
46 else
47 # RSA not available and will not be tested; make a placeholder
48 cp $infile ${zonefile}.signed
51 zone=ecc.example
52 zonefile=ns1/ecc.example.db
53 if [ "$supported" != "rsaonly" ]; then
54 $PK11GEN -a ECC -b 256 -l robie-ecc-zsk1 -i 03
55 $PK11GEN -a ECC -b 256 -l robie-ecc-zsk2 -i 04
56 $PK11GEN -a ECC -b 384 -l robie-ecc-ksk
58 ecczsk1=`$KEYFRLAB -a ECDSAP256SHA256 \
59 -l "object=robie-ecc-zsk1;pin-source=$PWD/pin" ecc.example`
60 ecczsk2=`$KEYFRLAB -a ECDSAP256SHA256 \
61 -l "object=robie-ecc-zsk2;pin-source=$PWD/pin" ecc.example`
62 eccksk=`$KEYFRLAB -a ECDSAP384SHA384 -f ksk \
63 -l "object=robie-ecc-ksk;pin-source=$PWD/pin" ecc.example`
65 cat $infile $ecczsk1.key $eccksk.key > $zonefile
66 $SIGNER -a -P -g -r $RANDFILE -o $zone $zonefile \
67 > /dev/null 2> signer.err || cat signer.err
68 cp $ecczsk2.key ns1/ecc.key
69 mv Kecc* ns1
70 else
71 # ECC not available and will not be tested; make a placeholder
72 cp $infile ${zonefile}.signed
75 rm -f signer.err