Fix comments after RRs

zzzzz.miek.nl.  86400   IN      RRSIG   NSEC 8 3 86400 20110823011301
20110724011301 12051 miek.nl.  lyRljEQFOmajcdo6bBI67DsTlQTGU3ag9vlE07u7ynqt9aYBXyE9mkasAK4V0oI32YGb2pOSB6RbbdHwUmSt+cYhOA49tl2t0Qoi3pH21dicJiupdZuyjfqUEqJlQoEhNXGtP/pRvWjNA4pQeOsOAoWq/BDcWCSQB9mh2LvUOH4= ; {keyid = sksak}
zzzzz.miek.nl.  86400   IN      NSEC    miek.nl. TXT RRSIG NSEC

Is now parsed correctly. This is incidently the format as echoed by
ldns.
This commit is contained in:
Miek Gieben 2011-12-18 13:33:03 +01:00
parent 15e1c0961b
commit a4ac06b8c3
2 changed files with 14 additions and 5 deletions

View File

@ -26,9 +26,9 @@ const (
_RRTYPE
_OWNER
_CLASS
_DIRORIGIN // $ORIGIN
_DIRTTL // $TTL
_INCLUDE // $INCLUDE
_DIRORIGIN // $ORIGIN
_DIRTTL // $TTL
_INCLUDE // $INCLUDE
// Privatekey file
_VALUE
@ -330,17 +330,24 @@ func zlexer(s scanner.Scanner, c chan lex) {
commt = false
rrtype = false
str = ""
// If not in a brace this ends the comment AND the RR
if brace == 0 {
owner = true
}
l.value = _NEWLINE
l.token = "\n"
c <- l
break
}
if str != "" {
l.value = _STRING
l.token = str
if !rrtype {
if !rrtype {
if _, ok := Str_rr[strings.ToUpper(l.token)]; ok {
l.value = _RRTYPE
rrtype = true
}
}
}
c <- l
}
if brace > 0 {

View File

@ -267,6 +267,7 @@ func setRRSIG(h RR_Header, c chan lex) (RR, *ParseError) {
l = <-c
s := ""
for l.value != _NEWLINE && l.value != _EOF {
println("Wat hebben we hier", l.token, l.value)
switch l.value {
case _STRING:
s += l.token
@ -277,6 +278,7 @@ func setRRSIG(h RR_Header, c chan lex) (RR, *ParseError) {
}
l = <-c
}
println("S", s)
rr.Signature = s
return rr, nil
}