63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews#!/bin/sh -e
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark 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/.
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews# $Id: sign.sh,v 1.43 2011/11/04 05:36:28 each Exp $
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark AndrewsSYSTEMTESTTOP=../..
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews. $SYSTEMTESTTOP/conf.sh
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewszone=split-rrsig
fce704e7515fbd1ed70cb3781ff8d5b50ae87b8aMark Andrewsinfile=split-rrsig.db.in
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewszonefile=split-rrsig.db
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewsk1=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 768 -n zone $zone`
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewsk2=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 768 -n zone $zone`
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewscat $infile $k1.key $k2.key >$zonefile
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews$SIGNER -P -3 - -A -r $RANDFILE -o $zone -O full -f $zonefile.unsplit -e now-3600 -s now-7200 $zonefile > /dev/null 2>&1
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrewsawk 'BEGIN { r = ""; }
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews $4 == "RRSIG" && $5 == "SOA" && r == "" { r = $0; next; }
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews { print }
63e1ac1e0915dd1089493d6d092d39a3da817e59Mark Andrews END { print r }' $zonefile.unsplit > $zonefile.signed