]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Move private_type_record() to conf.sh.common
authorMatthijs Mekking <matthijs@isc.org>
Wed, 30 Jun 2021 07:23:56 +0000 (09:23 +0200)
committerMatthijs Mekking <matthijs@isc.org>
Wed, 30 Jun 2021 15:29:14 +0000 (17:29 +0200)
The function 'private_type_record()' is now used in multiple system
setup scripts and should be moved to the common configuration script
conf.sh.common.

bin/tests/system/checkds/ns2/setup.sh
bin/tests/system/checkds/ns5/setup.sh
bin/tests/system/checkds/ns9/setup.sh
bin/tests/system/conf.sh.common
bin/tests/system/kasp/ns3/setup.sh
bin/tests/system/kasp/ns6/setup.sh
bin/tests/system/keymgr2kasp/ns3/setup.sh
bin/tests/system/keymgr2kasp/ns4/setup.sh

index 7fb586afee70d2d5d65c60b36e8b3a837f78adf3..d3f178408ad94872a9eb92f3546e6172b943d524 100644 (file)
@@ -22,16 +22,6 @@ do
        cp "../ns9/dsset-$subdomain.checkds$TP" .
 done
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
 zone="checkds"
 infile="checkds.db.infile"
 zonefile="checkds.db"
index 100cd5dbecb42a6fc3be3d4d2546b92d97c9dca5..8759366780894bde9d8f7b3b8912a3799daa305f 100644 (file)
 
 echo_i "ns5/setup.sh"
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
 zone="checkds"
 infile="checkds.db.infile"
 zonefile="checkds.db"
index efb4a1e2c2e7586719125d6c733fbb23b8312548..57554d3dd3f25114a01d99d47570ffb28e086291 100644 (file)
@@ -22,16 +22,6 @@ setup() {
        echo "$zone" >> zones
 }
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
 # Short environment variable names for key states and times.
 H="HIDDEN"
 R="RUMOURED"
index b68c93dd93a3e4bdf09ab4cae6ba9db9c173c99d..bbc6ade2eaeaa8b62d7f3792bc9d200c563c717d 100644 (file)
@@ -397,6 +397,22 @@ keyfile_to_key_id() {
        echo "$1" | sed "s/.*+0\{0,4\}//"
 }
 
+# private_type_record: write a private type record recording the state of the
+# signing process
+#
+# For a given zone ($1), algorithm number ($2) and key file ($3), print the
+# private type record with default type value of 65534, indicating that the
+# signing process for this key is completed.
+private_type_record() {
+        _zone=$1
+        _algorithm=$2
+        _keyfile=$3
+
+        _id=$(keyfile_to_key_id "$_keyfile")
+
+        printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
+}
+
 # nextpart*() - functions for reading files incrementally
 #
 # These functions aim to facilitate looking for (or waiting for)
index d487619f3b1f8e5eea32bdf056852941de53e7cb..a25bc619fbd74891766dd68a630aa1346f43f1af 100644 (file)
@@ -22,16 +22,6 @@ setup() {
        echo "$zone" >> zones
 }
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
 # Set in the key state files the Predecessor/Successor fields.
 # Key $1 is the predecessor of key $2.
 key_successor() {
index e8a3c21af1af6c4d3dc1f956a972986070e9d1a4..6f1d07bf431b0cff3d3389b22d07482e3b5af13d 100644 (file)
@@ -21,17 +21,6 @@ setup() {
        infile="${zone}.db.infile"
 }
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
-
 # Make lines shorter by storing key states in environment variables.
 H="HIDDEN"
 R="RUMOURED"
index 1bb89ad37b1313f742efa2cb26166616e85f4724..f2d8c3bab605ae844c7a3cb61e2d79c4516b649a 100644 (file)
@@ -21,17 +21,6 @@ setup() {
        infile="${zone}.db.infile"
 }
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
-
 # Make lines shorter by storing key states in environment variables.
 H="HIDDEN"
 R="RUMOURED"
index 148de97570d8f9b11bb7c8f9cc503a937009cb4f..18f6f322de63ca1f7cdbadd0d09830a08506125b 100644 (file)
 
 echo_i "ns4/setup.sh"
 
-private_type_record() {
-       _zone=$1
-       _algorithm=$2
-       _keyfile=$3
-
-       _id=$(keyfile_to_key_id "$_keyfile")
-
-       printf "%s. 0 IN TYPE65534 %s 5 %02x%04x0000\n" "$_zone" "\\#" "$_algorithm" "$_id"
-}
-
 # Make lines shorter by storing key states in environment variables.
 H="HIDDEN"
 R="RUMOURED"