mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 03:48:14 +00:00
Add X509v3 extension parsing to NSE's sslcert code. Show Subject Alternative Name.
This commit is contained in:
parent
0bb1dc6dc2
commit
087fb7be04
2 changed files with 66 additions and 0 deletions
|
|
@ -208,6 +208,7 @@ local function output_tab(cert)
|
|||
o.subject = name_to_table(cert.subject)
|
||||
o.issuer = name_to_table(cert.issuer)
|
||||
o.pubkey = cert.pubkey
|
||||
o.extensions = cert.extensions
|
||||
o.sig_algo = cert.sig_algorithm
|
||||
o.validity = {}
|
||||
for k, v in pairs(cert.validity) do
|
||||
|
|
@ -227,6 +228,14 @@ local function output_str(cert)
|
|||
local lines = {}
|
||||
|
||||
lines[#lines + 1] = "Subject: " .. stringify_name(cert.subject)
|
||||
if cert.extensions then
|
||||
for _, e in ipairs(cert.extensions) do
|
||||
if e.name == "X509v3 Subject Alternative Name" then
|
||||
lines[#lines + 1] = "Subject Alternative Name: " .. e.value
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if nmap.verbosity() > 0 then
|
||||
lines[#lines + 1] = "Issuer: " .. stringify_name(cert.issuer)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue