From d53102fc7b8418a8f0c503ef02bd9574c82794e4 Mon Sep 17 00:00:00 2001 From: Miek Gieben Date: Thu, 12 Jan 2012 13:01:43 +0100 Subject: [PATCH] Make alg_str public: Alg_str --- _examples/key2ds/key2ds.go | 9 +-------- dnssec.go | 2 +- keygen.go | 2 +- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/_examples/key2ds/key2ds.go b/_examples/key2ds/key2ds.go index 6933d776..bffeb2d0 100644 --- a/_examples/key2ds/key2ds.go +++ b/_examples/key2ds/key2ds.go @@ -18,14 +18,7 @@ func main() { } m := new(dns.Msg) m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeDNSKEY) - - // Set EDNS0's Do bit - e := new(dns.RR_OPT) - e.Hdr.Name = "." - e.Hdr.Rrtype = dns.TypeOPT - e.SetUDPSize(2048) - e.SetDo() - m.Extra = append(m.Extra, e) + m.SetEdns0(2048, true) c := dns.NewClient() r, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port) diff --git a/dnssec.go b/dnssec.go index b660b87a..45ce8ade 100644 --- a/dnssec.go +++ b/dnssec.go @@ -509,7 +509,7 @@ func rawSignatureData(rrset RRset, s *RR_RRSIG) (buf []byte) { } // Map for algorithm names. -var alg_str = map[uint8]string{ +var Alg_str = map[uint8]string{ RSAMD5: "RSAMD5", DH: "DH", DSA: "DSA", diff --git a/keygen.go b/keygen.go index 0fa6d145..476a0500 100644 --- a/keygen.go +++ b/keygen.go @@ -73,7 +73,7 @@ func (r *RR_DNSKEY) Generate(bits int) (PrivateKey, error) { func (r *RR_DNSKEY) PrivateKeyToString(p PrivateKey) (s string) { switch t := p.(type) { case *rsa.PrivateKey: - algorithm := strconv.Itoa(int(r.Algorithm)) + " (" + alg_str[r.Algorithm] + ")" + algorithm := strconv.Itoa(int(r.Algorithm)) + " (" + Alg_str[r.Algorithm] + ")" modulus := unpackBase64(t.PublicKey.N.Bytes()) e := big.NewInt(int64(t.PublicKey.E)) publicExponent := unpackBase64(e.Bytes())