1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Add support for SHA256 hostkey fingerprints. Closes #1644

This commit is contained in:
dmiller
2019-06-26 03:22:24 +00:00
parent 294f81a390
commit 9aebe62edb
3 changed files with 18 additions and 3 deletions

View File

@@ -318,9 +318,12 @@ local function portaction(host, port)
bits=key.bits,
key=key.key,
}
if format:find( 'hex', 1, true ) or all_formats then
if format:find( 'md5', 1, true) or format:find( 'hex', 1, true ) or all_formats then
table.insert( output, ssh1.fingerprint_hex( key.fingerprint, key.algorithm, key.bits ) )
end
if format:find( 'sha256', 1, true) or all_formats then
table.insert( output, ssh1.fingerprint_base64( key.fp_sha256, "SHA256", key.algorithm, key.bits ) )
end
if format:find( 'bubble', 1, true ) or all_formats then
table.insert( output, ssh1.fingerprint_bubblebabble( openssl.sha1(key.fp_input), key.algorithm, key.bits ) )
end