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