1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-17 21:19:01 +00:00

ssh-hostkey no longer looks for the action global which

may not exist (and thus triggers an error from strict.lua). We instead
setup dummy portrule/action functions, print the debug error for why the script
will not run, and return.
This commit is contained in:
batrick
2009-07-16 03:41:36 +00:00
parent fd39bf6970
commit 0be861959f

View File

@@ -48,9 +48,10 @@ if pcall(require,"openssl") then
require("ssh1") require("ssh1")
require("ssh2") require("ssh2")
else else
action = function() portrule = function() return false end
stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.", filename ) action = function() end
end stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.", filename )
return;
end end
portrule = shortport.port_or_service(22, "ssh") portrule = shortport.port_or_service(22, "ssh")
@@ -65,7 +66,7 @@ local add_key_to_registry = function( host, key )
table.insert( nmap.registry.sshhostkey[host.ip], key ) table.insert( nmap.registry.sshhostkey[host.ip], key )
end end
action = action or function(host, port) action = function(host, port)
local output = {} local output = {}
local keys = {} local keys = {}
local _,key local _,key