mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-04 00:25:29 +00:00
Replace duplicated code snippet with calls to helper functions
Reduce code duplication by replacing a code snippet repeated throughout system tests using "trusted-keys" and/or "managed-keys" configuration sections with calls to keyfile_to_{managed,trusted}_keys() helper functions.
This commit is contained in:
@@ -33,28 +33,12 @@ rm $zsknopriv.private
|
|||||||
ksksby=`$KEYGEN -3 -a RSASHA1 -q -P now -A now+15s -fk $zone`
|
ksksby=`$KEYGEN -3 -a RSASHA1 -q -P now -A now+15s -fk $zone`
|
||||||
kskrev=`$KEYGEN -3 -a RSASHA1 -q -R now+15s -fk $zone`
|
kskrev=`$KEYGEN -3 -a RSASHA1 -q -R now+15s -fk $zone`
|
||||||
|
|
||||||
cat $ksksby.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $ksksby > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
cp trusted.conf ../ns4/trusted.conf
|
cp trusted.conf ../ns4/trusted.conf
|
||||||
|
|
||||||
cat $kskrev.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $kskrev > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns5/trusted.conf
|
cp trusted.conf ../ns5/trusted.conf
|
||||||
|
|
||||||
echo $zskact > ../active.key
|
echo $zskact > ../active.key
|
||||||
|
@@ -36,15 +36,7 @@ zonefile="${zone}.db"
|
|||||||
infile="${zonefile}.in"
|
infile="${zonefile}.in"
|
||||||
ksk=`$KEYGEN -a RSASHA1 -3 -q -fk $zone`
|
ksk=`$KEYGEN -a RSASHA1 -3 -q -fk $zone`
|
||||||
$KEYGEN -a RSASHA1 -3 -q $zone > /dev/null
|
$KEYGEN -a RSASHA1 -3 -q $zone > /dev/null
|
||||||
cat $ksk.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $ksk > private.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > private.conf
|
|
||||||
cp private.conf ../ns4/private.conf
|
cp private.conf ../ns4/private.conf
|
||||||
$SIGNER -S -3 beef -A -o $zone -f $zonefile $infile > /dev/null 2>&1
|
$SIGNER -S -3 beef -A -o $zone -f $zonefile $infile > /dev/null 2>&1
|
||||||
|
|
||||||
|
@@ -32,14 +32,5 @@ $SIGNER -g -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signe
|
|||||||
|
|
||||||
echo_i "signed $zone"
|
echo_i "signed $zone"
|
||||||
|
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns5
|
cp trusted.conf ../ns5
|
||||||
|
|
||||||
|
@@ -280,16 +280,7 @@ cat $infile $dlvsets $keyname1.key $keyname2.key >$zonefile
|
|||||||
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
echo_i "signed $zone"
|
echo_i "signed $zone"
|
||||||
|
|
||||||
|
keyfile_to_trusted_keys $keyname2 > trusted-dlv.conf
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted-dlv.conf
|
|
||||||
cp trusted-dlv.conf ../ns5
|
cp trusted-dlv.conf ../ns5
|
||||||
|
|
||||||
cp $dssets ../ns2
|
cp $dssets ../ns2
|
||||||
|
@@ -34,32 +34,17 @@ cat $infile $keyname.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
# ...or with a managed key.
|
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
managed-keys {
|
|
||||||
"$dn" initial-key $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > managed.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
cp trusted.conf ../ns4/trusted.conf
|
cp trusted.conf ../ns4/trusted.conf
|
||||||
cp trusted.conf ../ns6/trusted.conf
|
cp trusted.conf ../ns6/trusted.conf
|
||||||
cp trusted.conf ../ns7/trusted.conf
|
cp trusted.conf ../ns7/trusted.conf
|
||||||
|
|
||||||
|
# ...or with a managed key.
|
||||||
|
keyfile_to_managed_keys $keyname > managed.conf
|
||||||
cp managed.conf ../ns4/managed.conf
|
cp managed.conf ../ns4/managed.conf
|
||||||
|
|
||||||
#
|
#
|
||||||
# Save keyid for managed key id test.
|
# Save keyid for managed key id test.
|
||||||
#
|
#
|
||||||
|
@@ -19,15 +19,7 @@ zonefile=root.db.signed
|
|||||||
keyname=`$KEYGEN -a RSASHA1 -qfk $zone`
|
keyname=`$KEYGEN -a RSASHA1 -qfk $zone`
|
||||||
|
|
||||||
# copy the KSK out first, then revoke it
|
# copy the KSK out first, then revoke it
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_managed_keys $keyname > revoked.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
managed-keys {
|
|
||||||
"$dn" initial-key $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > revoked.conf
|
|
||||||
|
|
||||||
$SETTIME -R now ${keyname}.key > /dev/null
|
$SETTIME -R now ${keyname}.key > /dev/null
|
||||||
|
|
||||||
|
@@ -29,16 +29,7 @@ cat $infile $key1.key $key2.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
|
keyfile_to_trusted_keys $key2 > trusted.conf
|
||||||
cat $key2.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
cp trusted.conf ../ns4/trusted.conf
|
cp trusted.conf ../ns4/trusted.conf
|
||||||
|
@@ -25,14 +25,5 @@ cat $infile $key1.key $key2.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -P -g -o $zone $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
|
keyfile_to_trusted_keys $key1 > trusted.conf
|
||||||
cat $key1.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
|
@@ -26,16 +26,7 @@ cat $infile $key1.key $key2.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -P -g -o $zone $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
|
keyfile_to_trusted_keys $key1 > trusted.conf
|
||||||
cat $key1.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
|
|
||||||
cd ../ns2 && $SHELL sign.sh
|
cd ../ns2 && $SHELL sign.sh
|
||||||
|
@@ -20,14 +20,5 @@ keyname=`$KEYGEN -q -a RSASHA1 -b 1024 -n zone -f KSK $zone`
|
|||||||
$SIGNER -S -x -T 1200 -o ${zone} root.db > signer.out 2>&1
|
$SIGNER -S -x -T 1200 -o ${zone} root.db > signer.out 2>&1
|
||||||
[ $? = 0 ] || cat signer.out
|
[ $? = 0 ] || cat signer.out
|
||||||
|
|
||||||
cat ${keyname}.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
cp trusted.conf ../ns6/trusted.conf
|
cp trusted.conf ../ns6/trusted.conf
|
||||||
|
@@ -28,13 +28,5 @@ cat $infile $keyname1.key $keyname2.key >$zonefile
|
|||||||
|
|
||||||
$SIGNER -g -o $zone -f $outfile -e +30y $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -g -o $zone -f $outfile -e +30y $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
|
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns1
|
cp trusted.conf ../ns1
|
||||||
|
@@ -21,29 +21,13 @@ zskkeyname=`$KEYGEN -a rsasha256 -q $zone`
|
|||||||
$SIGNER -Sg -o $zone $zonefile > /dev/null 2>/dev/null
|
$SIGNER -Sg -o $zone $zonefile > /dev/null 2>/dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a managed trusted key.
|
# Configure the resolving server with a managed trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_managed_keys $keyname > managed.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
managed-keys {
|
|
||||||
"$dn" initial-key $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > managed.conf
|
|
||||||
cp managed.conf ../ns2/managed.conf
|
cp managed.conf ../ns2/managed.conf
|
||||||
cp managed.conf ../ns4/managed.conf
|
cp managed.conf ../ns4/managed.conf
|
||||||
cp managed.conf ../ns5/managed.conf
|
cp managed.conf ../ns5/managed.conf
|
||||||
|
|
||||||
# Configure a trusted key statement (used by delve)
|
# Configure a trusted key statement (used by delv)
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Save keyname and keyid for managed key id test.
|
# Save keyname and keyid for managed key id test.
|
||||||
|
@@ -298,17 +298,7 @@ status=`expr $status + $ret`
|
|||||||
echo_i "reinitialize trust anchors, add second key to bind.keys"
|
echo_i "reinitialize trust anchors, add second key to bind.keys"
|
||||||
$PERL $SYSTEMTESTTOP/stop.pl --use-rndc --port ${CONTROLPORT} . ns2
|
$PERL $SYSTEMTESTTOP/stop.pl --use-rndc --port ${CONTROLPORT} . ns2
|
||||||
rm -f ns2/managed-keys.bind*
|
rm -f ns2/managed-keys.bind*
|
||||||
cat ns1/$standby1.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_managed_keys ns1/`cat ns1/managed.key` ns1/$standby1 > ns2/managed.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
local $originalkey = `grep initial-key ns2/managed1.conf`;
|
|
||||||
print <<EOF
|
|
||||||
managed-keys {
|
|
||||||
$originalkey
|
|
||||||
"$dn" initial-key $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > ns2/managed.conf
|
|
||||||
nextpart ns2/named.run > /dev/null
|
nextpart ns2/named.run > /dev/null
|
||||||
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} . ns2
|
$PERL $SYSTEMTESTTOP/start.pl --noclean --restart --port ${PORT} . ns2
|
||||||
|
|
||||||
|
@@ -28,16 +28,7 @@ cat $infile $keyname1.key $keyname2.key > $zonefile
|
|||||||
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
|
keyfile_to_trusted_keys $keyname2 > trusted.conf
|
||||||
cat $keyname2.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
cp trusted.conf ../ns4/trusted.conf
|
cp trusted.conf ../ns4/trusted.conf
|
||||||
|
@@ -30,13 +30,5 @@ zsk=`$KEYGEN -q -a rsasha256 $zone`
|
|||||||
cat $ksk.key $zsk.key dsset-ds.example.net$TP >> $zonefile
|
cat $ksk.key $zsk.key dsset-ds.example.net$TP >> $zonefile
|
||||||
$SIGNER -P -o $zone $zonefile > /dev/null 2>&1
|
$SIGNER -P -o $zone $zonefile > /dev/null 2>&1
|
||||||
|
|
||||||
# Configure a trusted key statement (used by delve)
|
# Configure a trusted key statement (used by delv)
|
||||||
cat $ksk.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $ksk > ../ns5/trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > ../ns5/trusted.conf
|
|
||||||
|
@@ -28,16 +28,7 @@ cat $infile $keyname.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
cp trusted.conf ../ns4/trusted.conf
|
cp trusted.conf ../ns4/trusted.conf
|
||||||
|
@@ -25,16 +25,7 @@ cat $infile $keyname.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
cp trusted.conf ../ns3/trusted.conf
|
cp trusted.conf ../ns3/trusted.conf
|
||||||
|
|
||||||
|
@@ -27,24 +27,8 @@ cat $infile $keyname.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
# ...or with a managed key.
|
# ...or with a managed key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_managed_keys $keyname > managed.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
managed-keys {
|
|
||||||
"$dn" initial-key $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > managed.conf
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
|
||||||
|
@@ -27,16 +27,7 @@ cat $infile $keyname1.key $keyname2.key > $zonefile
|
|||||||
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
|
keyfile_to_trusted_keys $keyname2 > trusted.conf
|
||||||
cat $keyname2.key | grep -v '^; ' | $PERL -n -e '
|
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
|
||||||
zone=undelegated
|
zone=undelegated
|
||||||
infile=undelegated.db.in
|
infile=undelegated.db.in
|
||||||
@@ -47,14 +38,5 @@ cat $infile $keyname1.key $keyname2.key > $zonefile
|
|||||||
|
|
||||||
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
$SIGNER -g -o $zone $zonefile > /dev/null 2>&1
|
||||||
|
|
||||||
cat $keyname2.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 >> trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' >> trusted.conf
|
|
||||||
|
|
||||||
cp trusted.conf ../ns2/trusted.conf
|
cp trusted.conf ../ns2/trusted.conf
|
||||||
|
@@ -32,12 +32,4 @@ cat $infile $keyname.key > $zonefile
|
|||||||
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
$SIGNER -P -g -o $zone $zonefile > /dev/null
|
||||||
|
|
||||||
# Configure the resolving server with a trusted key.
|
# Configure the resolving server with a trusted key.
|
||||||
cat $keyname.key | grep -v '^; ' | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
@@ -57,15 +57,7 @@ cat $infile $keyname1.key $keyname2.key > $zonefile
|
|||||||
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
echo_i "signed $zone"
|
echo_i "signed $zone"
|
||||||
|
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 > private.nsec.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > private.nsec.conf
|
|
||||||
|
|
||||||
zone=nsec3.
|
zone=nsec3.
|
||||||
infile=nsec3.db.in
|
infile=nsec3.db.in
|
||||||
@@ -94,15 +86,7 @@ cat $infile $keyname1.key $keyname2.key > $zonefile
|
|||||||
$SIGNER -3 - -H 10 -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -3 - -H 10 -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
echo_i "signed $zone"
|
echo_i "signed $zone"
|
||||||
|
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 > private.nsec3.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > private.nsec3.conf
|
|
||||||
|
|
||||||
zone=.
|
zone=.
|
||||||
infile=root.db.in
|
infile=root.db.in
|
||||||
@@ -117,12 +101,4 @@ cat $infile $keyname1.key $keyname2.key $dssets >$zonefile
|
|||||||
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
$SIGNER -o $zone -f $outfile $zonefile > /dev/null 2> signer.err || cat signer.err
|
||||||
echo_i "signed $zone"
|
echo_i "signed $zone"
|
||||||
|
|
||||||
grep -v '^;' $keyname2.key | $PERL -n -e '
|
keyfile_to_trusted_keys $keyname2 > trusted.conf
|
||||||
local ($dn, $class, $type, $flags, $proto, $alg, @rest) = split;
|
|
||||||
local $key = join("", @rest);
|
|
||||||
print <<EOF
|
|
||||||
trusted-keys {
|
|
||||||
"$dn" $flags $proto $alg "$key";
|
|
||||||
};
|
|
||||||
EOF
|
|
||||||
' > trusted.conf
|
|
||||||
|
Reference in New Issue
Block a user