rpz: use $DEFAULT_ALGORITHM

(cherry picked from commit 1861c3e503)
This commit is contained in:
Mark Andrews 2022-07-08 11:37:39 +10:00
parent b57457e754
commit bb981e0d68

View file

@ -17,7 +17,7 @@ set -e
. ../conf.sh
QPERF=`$SHELL qperf.sh`
QPERF=$($SHELL qperf.sh)
USAGE="$0: [-DNx]"
DEBUG=
@ -29,7 +29,7 @@ while getopts "DNx" c; do
*) echo "$USAGE" 1>&2; exit 1 ;;
esac
done
shift `expr $OPTIND - 1 || true`
shift $((OPTIND - 1))
if test "$#" -ne 0; then
echo "$USAGE" 1>&2
exit 1
@ -61,7 +61,7 @@ copy_setports dnsrpzd.conf.in dnsrpzd.conf
# Note that dnsrps.conf and dnsrps-secondary.conf are included in named.conf
# and differ from dnsrpz.conf which is used by dnsrpzd.
$SHELL ../ckdnsrps.sh -A $TEST_DNSRPS $DEBUG
test -z "`grep 'dnsrps-enable yes' dnsrps.conf`" && TEST_DNSRPS=
test -z "$(grep 'dnsrps-enable yes' dnsrps.conf)" && TEST_DNSRPS=
# set up test policy zones.
# bl is the main test zone
@ -87,7 +87,7 @@ cp ns5/expire.conf.in ns5/expire.conf
# $3=input zone file
# $4=output file
signzone () {
KEYNAME=`$KEYGEN -q -a rsasha256 -K $1 $2`
KEYNAME=$($KEYGEN -q -a ${DEFAULT_ALGORITHM} -K $1 $2)
cat $1/$3 $1/$KEYNAME.key > $1/tmp
$SIGNER -P -K $1 -o $2 -f $1/$4 $1/tmp >/dev/null
sed -n -e 's/\(.*\) IN DNSKEY \([0-9]\{1,\} [0-9]\{1,\} [0-9]\{1,\}\) \(.*\)/trust-anchors {"\1" static-key \2 "\3";};/p' $1/$KEYNAME.key >>trusted.conf
@ -171,7 +171,7 @@ cp ns5/empty.db.in ns5/policy2.db
# Run dnsrpzd to get the license and prime the static policy zones
if test -n "$TEST_DNSRPS"; then
DNSRPZD="`../rpz/dnsrps -p`"
DNSRPZD="$(../rpz/dnsrps -p)"
cd ns3
"$DNSRPZ" -D../dnsrpzd.rpzf -S../dnsrpzd.sock -C../dnsrpzd.conf \
-w 0 -dddd -L stdout >./dnsrpzd.run 2>&1