From 0be861959fffbbddece403ead0c8a14d0948f466 Mon Sep 17 00:00:00 2001 From: batrick Date: Thu, 16 Jul 2009 03:41:36 +0000 Subject: [PATCH] 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. --- scripts/ssh-hostkey.nse | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/ssh-hostkey.nse b/scripts/ssh-hostkey.nse index a840e1cf1..bcd16afba 100644 --- a/scripts/ssh-hostkey.nse +++ b/scripts/ssh-hostkey.nse @@ -48,9 +48,10 @@ if pcall(require,"openssl") then require("ssh1") require("ssh2") else - action = function() - stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.", filename ) - end + portrule = function() return false end + action = function() end + stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.", filename ) + return; end 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 ) end -action = action or function(host, port) +action = function(host, port) local output = {} local keys = {} local _,key