From 974b4430e24c670278c3dadc9219b619659c03da Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 21 May 2014 15:04:13 +0000 Subject: [PATCH] Pass dates directly to format_timestamp, avoid timestamp overflow Should fix: http://seclists.org/nmap-dev/2014/q2/184 --- scripts/ssl-cert.nse | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/ssl-cert.nse b/scripts/ssl-cert.nse index 0f0114fbf..2e766c9a9 100644 --- a/scripts/ssl-cert.nse +++ b/scripts/ssl-cert.nse @@ -137,7 +137,7 @@ function date_to_string(date) if type(date) == "string" then return string.format("Can't parse; string is \"%s\"", date) else - return stdnse.format_timestamp(stdnse.date_to_timestamp(date, 0), 0) + return stdnse.format_timestamp(date) end end @@ -193,7 +193,7 @@ local function output_tab(cert) if type(v)=="string" then o.validity[k] = v else - o.validity[k] = stdnse.format_timestamp(stdnse.date_to_timestamp(v, 0), 0) + o.validity[k] = stdnse.format_timestamp(v) end end o.md5 = stdnse.tohex(cert:digest("md5"))