setup.sh revision d58e33bfabfee19a035031dac633d36659738d56
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#!/bin/sh
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# Permission to use, copy, modify, and/or distribute this software for any
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# purpose with or without fee is hereby granted, provided that the above
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# copyright notice and this permission notice appear in all copies.
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews#
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews# PERFORMANCE OF THIS SOFTWARE.
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark AndrewsSYSTEMTESTTOP=..
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews. $SYSTEMTESTTOP/conf.sh
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsinfile=ns1/example.db.in
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews/bin/echo -n ${HSMPIN:-1234}> pin
4259095c8058beb9b475f1884dbeda375979e6f6Mark AndrewsPWD=`pwd`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewszone=rsa.example
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewszonefile=ns1/rsa.example.db
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$PK11GEN -a RSA -b 1024 -l robie-rsa-zsk1 -i 01
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$PK11GEN -a RSA -b 1024 -l robie-rsa-zsk2 -i 02
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$PK11GEN -a RSA -b 2048 -l robie-rsa-ksk
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsrsazsk1=`$KEYFRLAB -a RSASHA1 \
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews -l "robie-rsa-zsk1" rsa.example`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsrsazsk2=`$KEYFRLAB -a RSASHA1 \
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews -l "robie-rsa-zsk2" rsa.example`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsrsaksk=`$KEYFRLAB -a RSASHA1 -f ksk \
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews -l "robie-rsa-ksk" rsa.example`
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewscat $infile $rsazsk1.key $rsaksk.key > $zonefile
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews$SIGNER -a -P -g -r $RANDFILE -o $zone $zonefile \
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews > /dev/null 2> signer.err || cat signer.err
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewscp $rsazsk2.key ns1/rsa.key
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsmv Krsa* ns1
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrewsrm -f signer.err
4259095c8058beb9b475f1884dbeda375979e6f6Mark Andrews