]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
rpz: use $DEFAULT_ALGORITHM
authorMark Andrews <marka@isc.org>
Fri, 8 Jul 2022 01:37:39 +0000 (11:37 +1000)
committerMark Andrews <marka@isc.org>
Tue, 12 Jul 2022 03:29:07 +0000 (13:29 +1000)
bin/tests/system/rpz/setup.sh

index 2f29ed45e8c7e24896ab51a9c66f418421ff08e6..745b96dd50d7615a2a021f999862aa550b13959f 100644 (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