Nmap Development mailing list archives

Re: Inconsistent return values from dns.query (was: ssl-cert: add support for Google Certificate Catalog)


From: David Fifield <david () bamsoftware com>
Date: Thu, 22 Sep 2011 10:52:20 -0700

On Thu, Sep 22, 2011 at 07:26:12PM +0200, Henri Doreau wrote:
Hello,

(starting a new thread for this specific DNS question).

while reviewing the ssl-google-cert-catalog.nse[1] from Vasiliy
Kulikov I noticed that dns.query doesn't always behave as expected.
The documentation states that the function should return two values (a
boolean and a string), but it appears that
dns.answerFetcher[types.TXT] and dns.additionalFetcher[typed.TXT]
functions sometimes simply return a string:

eg; dns.lua:373 "return string.sub(dec.answers[1].data, 2)"


The asn-query.nse script is affected but works around this by checking
the type of the first returned value.

The patch attached addresses the issue.

Looks good, do it.

David Fifield
_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://seclists.org/nmap-dev/


Current thread: