ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews#!/bin/sh -e
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews#
0c27b3fe77ac1d5094ba3521e8142d9e7973133fMark Andrews# Copyright (C) 2012, 2014, 2016 Internet Systems Consortium, Inc. ("ISC")
ecd851b8327b364378a5b7a50d116af923b683a1Mark 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/.
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews# $Id$
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark AndrewsSYSTEMTESTTOP=../..
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews. $SYSTEMTESTTOP/conf.sh
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewszone1=good.
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewsinfile1=good.db.in
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewszonefile1=good.db
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewszone2=bad.
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewsinfile2=bad.db.in
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewszonefile2=bad.db
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewskeyname11=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $zone1`
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewskeyname12=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 2048 -n zone -f KSK $zone1`
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewskeyname21=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 1024 -n zone $zone2`
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewskeyname22=`$KEYGEN -q -r $RANDFILE -a RSASHA256 -b 2048 -n zone -f KSK $zone2`
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewscat $infile1 $keyname11.key $keyname12.key >$zonefile1
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewscat $infile2 $keyname21.key $keyname22.key >$zonefile2
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews$SIGNER -P -g -r $RANDFILE -o $zone1 $zonefile1 > /dev/null
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews$SIGNER -P -g -r $RANDFILE -o $zone2 $zonefile2 > /dev/null
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold KrecickiDSFILENAME1=dsset-`echo $zone1 |sed -e "s/\.$//g"`$TP
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold KrecickiDSFILENAME2=dsset-`echo $zone2 |sed -e "s/\.$//g"`$TP
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DSFROMKEY -a SHA-256 $keyname12 > $DSFILENAME1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DSFROMKEY -a SHA-256 $keyname22 > $DSFILENAME2
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewssupported=`cat ../supported`
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewscase "$supported" in
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews gost) algo=GOST ;;
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews *) algo=SHA-384 ;;
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrewsesac
ecd851b8327b364378a5b7a50d116af923b683a1Mark Andrews
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DSFROMKEY -a $algo $keyname12 >> $DSFILENAME1
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki$DSFROMKEY -a $algo $keyname22 > $DSFILENAME2
cc51cd2d2076e33117c60c9effcb8caccde4983bWitold Krecicki