Make alg_str public: Alg_str

This commit is contained in:
Miek Gieben 2012-01-12 13:01:43 +01:00
parent a3949750be
commit d53102fc7b
3 changed files with 3 additions and 10 deletions

View File

@ -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)

View File

@ -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",

View File

@ -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())