mirror of
https://github.com/nmap/nmap.git
synced 2025-12-06 12:41:29 +00:00
Fix for bug that would make Nmap fail to run when compile without SSL support.
The wsdd library incorrectly assumed OpenSSL to always be available and the ssh-hostkey used the undeclared SCRIPT_NAME in message when evaluating SSL support. The bug was reported by Michael Pattrick on nmap-dev: http://seclists.org/nmap-dev/2011/q1/312 [Patrik]
This commit is contained in:
@@ -34,9 +34,14 @@
|
||||
|
||||
module(... or "wsdd", package.seeall)
|
||||
|
||||
require 'openssl'
|
||||
require 'target'
|
||||
|
||||
local HAVE_SSL = false
|
||||
|
||||
if pcall(require,'openssl') then
|
||||
HAVE_SSL = true
|
||||
end
|
||||
|
||||
-- The different probes
|
||||
local probes = {
|
||||
|
||||
@@ -332,6 +337,8 @@ Helper = {
|
||||
-- @return matches table containing responses, suitable for printing using
|
||||
-- the <code>stdnse.format_output</code> function
|
||||
discoverServices = function( self, probename )
|
||||
if ( not(HAVE_SSL) ) then return false, "The wsdd library requires OpenSSL" end
|
||||
|
||||
local comm = Comm:new(self.host, self.port, self.mcast)
|
||||
local probe = Util.getProbeByName(probename)
|
||||
comm:setProbe( probe )
|
||||
|
||||
@@ -51,7 +51,7 @@ else
|
||||
portrule = function() return false end
|
||||
action = function() end
|
||||
stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.",
|
||||
SCRIPT_NAME)
|
||||
filename)
|
||||
return;
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user