From 15fedf72e7558c80969a607e0919c36b9050663a Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 9 Jan 2011 20:46:21 +0100 Subject: [PATCH] nsec type list must be uint16 --- install | 1 - tsig.go | 1 + types.go | 26 ++++++++++++++------------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/install b/install index aa94d06d..6d9a6a16 100755 --- a/install +++ b/install @@ -3,5 +3,4 @@ # small wrapper to easy installment make -make -C dnssec install make -C resolver install diff --git a/tsig.go b/tsig.go index 3751f8ee..2dcc0398 100644 --- a/tsig.go +++ b/tsig.go @@ -67,6 +67,7 @@ type tsig_generation_fmt struct { // Generate the HMAC for msg. The TSIG RR is modified // to include the MAC and MACSize. Note the the msg Id must // be set, otherwise the MAC is not correct +// secret is encoded in base64 in BIND9 func (rr *RR_TSIG) Generate(msg *Msg, secret string) bool { buf := make([]byte, 4096) // TODO(mg) bufsize! tsig := new(tsig_generation_fmt) diff --git a/types.go b/types.go index 7c28b2ed..089c1753 100644 --- a/types.go +++ b/types.go @@ -82,11 +82,11 @@ const ( RcodeNameError = 3 RcodeNotImplemented = 4 RcodeRefused = 5 - RcodeYXDomain = 6 - RcodeYXRrset = 7 - RcodeNXRrset = 8 - RcodeNotAuth = 9 - RcodeNotZone = 10 + RcodeYXDomain = 6 + RcodeYXRrset = 7 + RcodeNXRrset = 8 + RcodeNotAuth = 9 + RcodeNotZone = 10 // Tsig errors TsigBadSig = 16 TsigBadKey = 17 @@ -411,8 +411,8 @@ func (rr *RR_RRSIG) String() string { type RR_NSEC struct { Hdr RR_Header - NextDomain string "domain-name" - TypeBitMap []int "NSEC" + NextDomain string "domain-name" + TypeBitMap []uint16 "NSEC" } func (rr *RR_NSEC) Header() *RR_Header { @@ -420,7 +420,9 @@ func (rr *RR_NSEC) Header() *RR_Header { } func (rr *RR_NSEC) String() string { - return rr.Hdr.String() + "NSEC BLAH" + return rr.Hdr.String() + + " " + rr.NextDomain + + " " + "bitmap" } type RR_DS struct { @@ -471,8 +473,8 @@ type RR_NSEC3 struct { SaltLength uint8 Salt string "hex" HashLength uint8 - NextDomain string "domain-name" - TypeBitMap []int "NSEC3" // &{TypeSOA,TypeDS,etc} + NextDomain string "domain-name" + TypeBitMap []uint16 "NSEC" } func (rr *RR_NSEC3) Header() *RR_Header { @@ -520,8 +522,8 @@ func (rr *RR_TKEY) Header() *RR_Header { } func (rr *RR_TKEY) String() string { - // It has no presentation format - return "" + // It has no presentation format + return "" } // Translate the RRSIG's incep. and expir. time to the correct date.