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

Resolved an "attempt to index a nil value (local 'certs')" error in find_ciphers_group that caused false negatives in script output.

This commit is contained in:
robert
2017-01-20 19:06:50 +00:00
parent 5493b5262d
commit 8cc713e534

View File

@@ -673,7 +673,12 @@ local function find_ciphers_group(host, port, protocol, group, scores)
-- This may not always be the case, so
-- TODO: reorder certificates and validate entire chain
-- TODO: certificate validation (date, self-signed, etc)
local c, err = sslcert.parse_ssl_certificate(certs.certificates[1])
local c, err
if certs == nil then
stdnse.debug1("Failed to retrieve certificate")
else
c, err = sslcert.parse_ssl_certificate(certs.certificates[1])
end
if not c then
stdnse.debug1("Failed to parse certificate: %s", err)
elseif c.pubkey.type == kex.pubkey then