1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-18 05:29:02 +00:00

Remove unnecessary pcall and unsupported SSL 3.0 from ssl-heartbleed

This commit is contained in:
dmiller
2014-04-09 16:49:18 +00:00
parent c0078965e9
commit d1a86b7f57

View File

@@ -24,7 +24,7 @@ The code is based on the Python script ssltest.py authored by Jared Stafford (js
-- |_ http://cvedetails.com/cve/2014-0160/ -- |_ http://cvedetails.com/cve/2014-0160/
-- --
-- --
-- @args ssl-heartbleed.protocols (default tries all) SSL 3.0, TLS 1.0, TLS 1.1, or TLS 1.2 -- @args ssl-heartbleed.protocols (default tries all) TLS 1.0, TLS 1.1, or TLS 1.2
-- --
local bin = require('bin') local bin = require('bin')
@@ -44,9 +44,7 @@ categories = { "vuln", "safe" }
local arg_protocols = stdnse.get_script_args(SCRIPT_NAME .. ".protocols") or {'TLS 1.0', 'TLS 1.1', 'TLS 1.2'} local arg_protocols = stdnse.get_script_args(SCRIPT_NAME .. ".protocols") or {'TLS 1.0', 'TLS 1.1', 'TLS 1.2'}
portrule = function(host, port) portrule = function(host, port)
result = false return shortport.ssl(host, port) or sslcert.isPortSupported(port)
pcall(function () result = shortport.ssl(host, port) or sslcert.isPortSupported(port) end)
return result
end end
local function recvhdr(s) local function recvhdr(s)
@@ -164,7 +162,7 @@ local function testversion(host, port, version)
s:set_timeout(5000) s:set_timeout(5000)
if not s:connect(host, port, "tcp") then if not s:connect(host, port, "tcp") then
stndse.print_debug(3, "Connection to server failed") stdnse.print_debug(3, "Connection to server failed")
return return
end end
@@ -191,6 +189,7 @@ local function testversion(host, port, version)
break break
end end
if typ == 24 then if typ == 24 then
local pay
status, pay = recvmsg(s, len) status, pay = recvmsg(s, len)
s:close() s:close()
if #pay > 3 then if #pay > 3 then