From 5c74f7285f4de5c7146c4fa1bdcda72522097a83 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Sun, 15 Jan 2012 16:00:40 +0100 Subject: [PATCH] Save some bytes in the dnssec signature validation --- dnssec.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dnssec.go b/dnssec.go index 0e02ab4c..bad4fe8a 100644 --- a/dnssec.go +++ b/dnssec.go @@ -144,7 +144,7 @@ func (k *RR_DNSKEY) ToDS(h int) *RR_DS { // DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key. // digest buffer - digest := append(owner, wire...) // another copy TODO(mg) + digest := append(owner, wire...) // another copy switch h { case SHA1: @@ -490,11 +490,11 @@ func rawSignatureData(rrset RRset, s *RR_RRSIG) (buf []byte) { // 6.2. Canonical RR Form. (5) - origTTL ttl := h.Ttl + wire := make([]byte, r.Len()) h.Ttl = s.OrigTtl - wire := make([]byte, DefaultMsgSize) off, ok1 := packRR(r, wire, 0, nil, false) - wire = wire[:off] h.Ttl = ttl // restore the order in the universe TODO(mg) work on copy + wire = wire[:off] h.Name = name if !ok1 { return nil