Changing from t3b to t4b signer
Olafur Gudmundsson
ogud at tislabs.com
Mon Sep 27 20:31:33 UTC 1999
Edward Lewis writes:
> There is a change in the way 8.2.2.-t3b's signer and 8.2.2.-t4b's signer
> parse the SIG record. The impact of this is that a signed master file
> generated by t3b ('s signer) will produce parsing errors when t4b reads it.
> (Specifically, reporting that the TTL field won't fit into 8 bits, for
> larger sizes of TTL's.)
>
> The fix to this is to delete all SIG records from the master file (via a
> text editor) and then use the file as input. Don't worry about the NXT or
> other records, the signer will make whatever other changes are required.
>
Or you can use the attached awk program that handles all "well formed"
signatures and all names that do not include . as non label separator.
Olafur
-- Attached file included as plaintext by Listar --
-- File: add_labels.awk
-- Desc: add_labels.awk
#
# A simple awk script to make sure SIG records contain the label count in
# text format
# This program handles:
# $ORIGIN lines.
# lines starting with a name
# lines starting with @
# special rule for label count for wild card records
# Not handled:
# names where . is not a label separator !
#
# Author: Olafur Gudmundsson ogud at tislabs.com
# Date: 1999-Sept
#
BEGIN{
tail = substr(".",1,1);
name = 0; # name not seen
}
# processing of $ORIGIN directive
/^\$ORIGIN/ {
olab = split($2,list,".");
if (substr($2,length($2),1) == tail)
olab--;
}
#
# all new names start at beginning of a line and must start with an
# alpanumeric character or the special two characters @ and *
#
/^[a-zA-Z0-9\*@]/ {
name = $1;
if (name == "@")
lab = olab;
else { # normal name ?
lab = split(name,list,".");
lastc = substr(name,length(name),1);
# printf "#split %d %s+%s!=%s\n", lab, list[lab-1], lastc,tail;
if (lastc != tail) # this is not FQDN add origin to it
lab += olab;
else
lab--;
if (substr(name, 1, 1) == "*") # wildcard name decrement
lab--;
}
# printf "# found name %s %d\n", name, lab;
}
# now process the SIG records there are following fields on the line
# [name] <TTL> IN SIG <alg> [<labels>] <OTTL> <expiry> <start> <keyid> <signer> (
#
/ IN /&&/ SIG /{
if ((name == 0) && (NF == 11)) { # labels missing assuming no name on line
$5 = $5 " " lab;
printf "\t\t\t%s\n", $0;
next;
}
else if((name != 0) && (NF==12)) { # name on line
$6 = $6 " " lab;
}
}
{
print $0; # print out current line
name = 0;
}
More information about the bind-workers
mailing list