From c5d1fe5590e5942937739a0daadc03b5dd889c7e Mon Sep 17 00:00:00 2001 From: tomsellers Date: Tue, 13 Oct 2009 03:01:51 +0000 Subject: [PATCH] Minor change to ssl-cert.nse to bring display of certificate fingerprints (MD5/SHA) in line with documentation which indicates that they are not displayed unless verbose output is requested. --- scripts/ssl-cert.nse | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/ssl-cert.nse b/scripts/ssl-cert.nse index 7672b95c2..6e889b7a1 100644 --- a/scripts/ssl-cert.nse +++ b/scripts/ssl-cert.nse @@ -118,8 +118,10 @@ action = function(host, port) lines[#lines + 1] = "Not valid after: " .. date_to_string(cert.validity.notAfter) - lines[#lines + 1] = "MD5: " .. stdnse.tohex(cert:digest("md5"), { separator = " ", group = 4 }) - lines[#lines + 1] = "SHA-1: " .. stdnse.tohex(cert:digest("sha1"), { separator = " ", group = 4 }) + if nmap.verbosity() > 0 then + lines[#lines + 1] = "MD5: " .. stdnse.tohex(cert:digest("md5"), { separator = " ", group = 4 }) + lines[#lines + 1] = "SHA-1: " .. stdnse.tohex(cert:digest("sha1"), { separator = " ", group = 4 }) + end if nmap.verbosity() > 1 then lines[#lines + 1] = cert.pem