a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#!/bin/sh
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2009, 2010, 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
bf8267aa453e5d2a735ed732a043b77a0b355b20Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# This Source Code Form is subject to the terms of the Mozilla Public
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# License, v. 2.0. If a copy of the MPL was not distributed with this
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# file, You can obtain one at http://mozilla.org/MPL/2.0/.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark AndrewsSYSTEMTESTTOP=../..
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews. $SYSTEMTESTTOP/conf.sh
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewszone=.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsinfile=root.db.in
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewszonefile=root.db
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
60988462e5d6db53205851d056e3482a29239be9Evan Hunt(cd ../ns2 && $SHELL -e sign.sh )
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecickicp ../ns2/dsset-example$TP .
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecickicp ../ns2/dsset-example.com$TP .
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewskeyname1=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $zone`
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewskeyname2=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 2048 -f KSK -n zone $zone`
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewscat $infile $keyname1.key $keyname2.key > $zonefile
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
597642c0baaf66172ca44104ed5a18957a969748Evan Hunt$SIGNER -g -r $RANDFILE -o $zone $zonefile > /dev/null 2>&1
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews# Configure the resolving server with a trusted key.
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewscat $keyname2.key | grep -v '^; ' | $PERL -n -e '
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewslocal ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewslocal $key = join("", @rest);
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewsprint <<EOF
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewstrusted-keys {
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews "$dn" $flags $proto $alg "$key";
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews};
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark AndrewsEOF
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrews' > trusted.conf
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewscp trusted.conf ../ns2/trusted.conf
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewscp trusted.conf ../ns3/trusted.conf
a39a5f4d816ca7d3f43106712ca668dd1ab31d69Mark Andrewscp trusted.conf ../ns4/trusted.conf