Skip to content

Commit

Permalink
adds AuthenticatedData flag for DNSSEC
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-burns committed Aug 5, 2024
1 parent 85d3d25 commit a65520a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion golang/sig0/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ func QueryAny(name string) (*dns.Msg, error) {
return QueryWithType(name, dns.TypeANY)
}

// uses ANY query type
func QueryNSEC(name string) (*dns.Msg, error) {
return QueryWithType(name, dns.TypeNSEC)
}

func QueryWithType(name string, qtype uint16) (*dns.Msg, error) {
q := dns.Question{
Name: dns.Fqdn(name),
Expand All @@ -40,7 +45,7 @@ func QueryWithType(name string, qtype uint16) (*dns.Msg, error) {
}

m := &dns.Msg{
MsgHdr: dns.MsgHdr{Id: dns.Id(), Opcode: dns.OpcodeQuery, RecursionDesired: true},
MsgHdr: dns.MsgHdr{Id: dns.Id(), Opcode: dns.OpcodeQuery, RecursionDesired: true, AuthenticatedData: true},
Question: []dns.Question{q},
}

Expand Down Expand Up @@ -83,6 +88,8 @@ func QueryTypeFromString(value string) (uint16, error) {
t = dns.TypeSRV
case "soa":
t = dns.TypeSOA
case "nsec":
t = dns.TypeNSEC
default:
asNum, err := strconv.ParseUint(value, 10, 16)
if err != nil {
Expand Down

0 comments on commit a65520a

Please sign in to comment.