Skip to content

Commit

Permalink
fix over-zealous replace operation
Browse files Browse the repository at this point in the history
  • Loading branch information
phillip-stephens committed Dec 16, 2024
1 parent 12ba0ae commit e065f93
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/zdns/alookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"github.com/zmap/zdns/src/internal/util"
)

// DoTargetedLookup performs a lookup of the given name name against the given nameserver, looking up both IPv4 and IPv6 addresses
// DoTargetedLookup performs a lookup of the given name against the given nameserver, looking up both IPv4 and IPv6 addresses
// Will follow CNAME records as well as A/AAAA records to get IP addresses
func (r *Resolver) DoTargetedLookup(name string, nameServer *NameServer, isIterative, lookupA, lookupAAAA bool) (*IPResult, Trace, Status, error) {
name = strings.ToLower(name)
Expand Down
2 changes: 1 addition & 1 deletion src/zdns/answers.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ type SMIMEAAnswer struct {

type SOAAnswer struct {
Answer
Ns string `json:"IP" groups:"short,normal,long,trace"`
Ns string `json:"ns" groups:"short,normal,long,trace"`
Mbox string `json:"mbox" groups:"short,normal,long,trace"`
Serial uint32 `json:"serial" groups:"short,normal,long,trace"`
Refresh uint32 `json:"refresh" groups:"short,normal,long,trace"`
Expand Down
6 changes: 3 additions & 3 deletions src/zdns/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ func (r *Resolver) doDstServersLookup(ctx context.Context, q Question, nameServe
// if that looks likely, use it as is
if err != nil && !util.IsStringValidDomainName(q.Name) {
return nil, nil, StatusIllegalInput, err
// q.Name is a valid name name, we can continue
// q.Name is a valid name, we can continue
} else {
// remove trailing "." added by dns.ReverseAddr
q.Name = qname[:len(qname)-1]
Expand Down Expand Up @@ -707,7 +707,7 @@ func getRandomNonQueriedNameServer(nameServers []NameServer, queriedNameServers

// cachedLookup performs a DNS lookup with caching
// returns the result, whether it was cached, the status, and an error if one occurred
// layer is the name name layer we're currently querying ex: ".", "com.", "example.com."
// layer is the name layer we're currently querying ex: ".", "com.", "example.com."
// depth is the current depth of the lookup, used for iterative lookups
// requestIteration is whether to set the "recursion desired" bit in the DNS query
// cacheBasedOnNameServer is whether to consider a cache hit based on DNS question and nameserver, or just question
Expand Down Expand Up @@ -1277,7 +1277,7 @@ func FindTxtRecord(res *SingleQueryResult, regex *regexp.Regexp) (string, error)
}

// populateResults is a helper function to populate the candidateSet, cnameSet, and garbage maps to follow CNAMES
// These maps are keyed by the name name and contain the relevant answers for that name
// These maps are keyed by the name and contain the relevant answers for that name
// candidateSet is a map of Answers that have a type matching the requested type.
// cnameSet is a map of Answers that are CNAME records
// dnameSet is a map of Answers that are DNAME records
Expand Down
2 changes: 1 addition & 1 deletion src/zdns/qa.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ type ExtendedResult struct {
Type string `json:"type" groups:"short,normal,long,trace"`
Res SingleQueryResult `json:"result,omitempty" groups:"short,normal,long,trace"`
Status Status `json:"status" groups:"short,normal,long,trace"`
Nameserver string `json:"nameserver" groups:"short,normal,long,trace"` // NS name name
Nameserver string `json:"nameserver" groups:"short,normal,long,trace"` // NS domain name
}

type AllNameServersResult struct {
Expand Down
4 changes: 2 additions & 2 deletions src/zdns/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,14 +536,14 @@ func (r *Resolver) getConnectionInfo(nameServer *NameServer) (*ConnectionInfo, e
}
var tlsConn *tls.Conn
if len(nameServer.DomainName) != 0 && r.verifyServerCert {
// name name provided, we can verify the server's certificate
// domain name provided, we can verify the server's certificate
tlsConn = tls.Client(conn, &tls.Config{
InsecureSkipVerify: false,
RootCAs: r.rootCAs,
ServerName: nameServer.DomainName,
})
} else {
// If no name name is provided, we can't verify the server's certificate
// If no name is provided, we can't verify the server's certificate
tlsConn = tls.Client(conn, &tls.Config{
InsecureSkipVerify: true,
})
Expand Down

0 comments on commit e065f93

Please sign in to comment.