Nmap Development mailing list archives

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


From: Henri Doreau <henri.doreau () greenbone net>
Date: Thu, 22 Sep 2011 19:26:12 +0200

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.

Regards


[1] http://seclists.org/nmap-dev/2011/q3/801

-- 
Henri

Attachment: dns_fix.diff
Description:

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

Current thread: