mirror of
https://github.com/nmap/nmap.git
synced 2026-08-27 03:48:14 +00:00
Do base64-encoding of the SSH key before returning, not after.
Not all SSH key formats use base64 encoding, for example SSH1 keys looks different. So we can't blindly base64-encode the raw strings that we receive. Attempt to return keys in the same format as is used by the known_hosts file.
This commit is contained in:
parent
ea8995ebf7
commit
82df82b5fd
2 changed files with 2 additions and 2 deletions
|
|
@ -151,7 +151,7 @@ local function portaction(host, port)
|
|||
fingerprint=stdnse.tohex(key.fingerprint),
|
||||
type=key.key_type,
|
||||
bits=key.bits,
|
||||
key=base64.enc(key.key),
|
||||
key=key.key,
|
||||
})
|
||||
if format:find( 'hex', 1, true ) or all_formats then
|
||||
table.insert( output, ssh1.fingerprint_hex( key.fingerprint, key.algorithm, key.bits ) )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue