1
0
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:
patrik
2011-01-30 10:39:17 +00:00
parent 2ffa4e7e02
commit a139a26fd7
2 changed files with 9 additions and 2 deletions

View File

@@ -34,9 +34,14 @@
module(... or "wsdd", package.seeall) module(... or "wsdd", package.seeall)
require 'openssl'
require 'target' require 'target'
local HAVE_SSL = false
if pcall(require,'openssl') then
HAVE_SSL = true
end
-- The different probes -- The different probes
local probes = { local probes = {
@@ -332,6 +337,8 @@ Helper = {
-- @return matches table containing responses, suitable for printing using -- @return matches table containing responses, suitable for printing using
-- the <code>stdnse.format_output</code> function -- the <code>stdnse.format_output</code> function
discoverServices = function( self, probename ) 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 comm = Comm:new(self.host, self.port, self.mcast)
local probe = Util.getProbeByName(probename) local probe = Util.getProbeByName(probename)
comm:setProbe( probe ) comm:setProbe( probe )

View File

@@ -51,7 +51,7 @@ else
portrule = function() return false end portrule = function() return false end
action = function() end action = function() end
stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.", stdnse.print_debug( 3, "Skipping %s script because OpenSSL is missing.",
SCRIPT_NAME) filename)
return; return;
end end