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

Don't run openssl-requiring tests if openssl isn't present.

This commit is contained in:
dmiller
2018-10-17 19:58:33 +00:00
parent a7495ac6c7
commit e93c2b4328
2 changed files with 68 additions and 62 deletions

View File

@@ -465,6 +465,8 @@ end
test_suite = unittest.TestSuite:new() test_suite = unittest.TestSuite:new()
-- Crypto tests require OpenSSL
if HAVE_SSL then
local _ = "ignored" local _ = "ignored"
local object = DigestMD5:new('Digest realm="test", domain="/HTTP/Digest",\z local object = DigestMD5:new('Digest realm="test", domain="/HTTP/Digest",\z
@@ -503,5 +505,6 @@ test_suite:add_test(unittest.keys_equal(
domain='/HTTP/Digest', domain='/HTTP/Digest',
} }
)) ))
end
return _ENV; return _ENV;

View File

@@ -792,6 +792,8 @@ if not unittest.testing() then
end end
test_suite = unittest.TestSuite:new() test_suite = unittest.TestSuite:new()
-- Crypto tests require OpenSSL
if HAVE_SSL then
local test_vectors = { local test_vectors = {
-- from John the Ripper's vnc_fmt_plug.c -- from John the Ripper's vnc_fmt_plug.c
-- pass, challenge, response -- pass, challenge, response
@@ -821,5 +823,6 @@ for _, v in ipairs(test_vectors) do
test_suite:add_test(unittest.equal( test_suite:add_test(unittest.equal(
VNC:encryptVNCDES(v[1], v[2]), v[3]), v[1]) VNC:encryptVNCDES(v[1], v[2]), v[3]), v[1])
end end
end
return _ENV return _ENV