mirror of
https://github.com/miekg/dns.git
synced 2025-10-11 18:01:02 +02:00
Make alg_str public: Alg_str
This commit is contained in:
parent
a3949750be
commit
d53102fc7b
@ -18,14 +18,7 @@ func main() {
|
|||||||
}
|
}
|
||||||
m := new(dns.Msg)
|
m := new(dns.Msg)
|
||||||
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeDNSKEY)
|
m.SetQuestion(dns.Fqdn(os.Args[1]), dns.TypeDNSKEY)
|
||||||
|
m.SetEdns0(2048, true)
|
||||||
// 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)
|
|
||||||
|
|
||||||
c := dns.NewClient()
|
c := dns.NewClient()
|
||||||
r, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
|
r, _ := c.Exchange(m, conf.Servers[0] + ":" + conf.Port)
|
||||||
|
@ -509,7 +509,7 @@ func rawSignatureData(rrset RRset, s *RR_RRSIG) (buf []byte) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Map for algorithm names.
|
// Map for algorithm names.
|
||||||
var alg_str = map[uint8]string{
|
var Alg_str = map[uint8]string{
|
||||||
RSAMD5: "RSAMD5",
|
RSAMD5: "RSAMD5",
|
||||||
DH: "DH",
|
DH: "DH",
|
||||||
DSA: "DSA",
|
DSA: "DSA",
|
||||||
|
@ -73,7 +73,7 @@ func (r *RR_DNSKEY) Generate(bits int) (PrivateKey, error) {
|
|||||||
func (r *RR_DNSKEY) PrivateKeyToString(p PrivateKey) (s string) {
|
func (r *RR_DNSKEY) PrivateKeyToString(p PrivateKey) (s string) {
|
||||||
switch t := p.(type) {
|
switch t := p.(type) {
|
||||||
case *rsa.PrivateKey:
|
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())
|
modulus := unpackBase64(t.PublicKey.N.Bytes())
|
||||||
e := big.NewInt(int64(t.PublicKey.E))
|
e := big.NewInt(int64(t.PublicKey.E))
|
||||||
publicExponent := unpackBase64(e.Bytes())
|
publicExponent := unpackBase64(e.Bytes())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user