Bug 3003

Summary: [PATCH] ssh-keygen does not print ASCII art fingerprint of knonw_hosts entry
Product: Portable OpenSSH Reporter: Ville Sinisalo <blaubosch>
Component: ssh-keygenAssignee: Damien Miller <djm>
Status: CLOSED FIXED    
Severity: minor CC: djm, dtucker
Priority: P5    
Version: 8.0p1   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 2988    
Attachments:
Description Flags
patch against current CVS version
none
patch for man page
none
corrected patch for both ssh-keygen.c & man page
none
tweak for style(9) none

Description Ville Sinisalo 2019-05-05 08:56:26 AEST
Created attachment 3274 [details]
patch against current CVS version

ssh-keygen -l -f keyfile prints the fingerprint of a public key. Combining the -l switch with -v additionally prints the key's "ASCII art" representation, which is visually easier to compare in case the key's fingerprint needs to be verified manually.

ssh-keygen -F host can be used to search the known_hosts file for a host's key and adding -l prints the key's fingerprint. But combining the -l switch with -v to get the ASCII art representation does not work in this context; the source code makes no attempt to generate or print the ASCII art fingerprint of the knonw_hosts key. This seems to be a bug.

Attached is a patch that should fix this (I just copied the ASCII art printing code from fingerprint_one_key() function used by do_fingerpint(), and added a missing NULL check that was present there.)
Comment 1 Ville Sinisalo 2019-05-05 09:11:18 AEST
Created attachment 3275 [details]
patch for man page
Comment 2 Ville Sinisalo 2019-05-06 03:34:09 AEST
Created attachment 3276 [details]
corrected patch for both ssh-keygen.c & man page
Comment 3 Damien Miller 2019-06-07 14:03:41 AEST
Created attachment 3289 [details]
tweak for style(9)
Comment 4 Damien Miller 2019-07-19 13:38:15 AEST
Applied - thanks
Comment 5 Damien Miller 2019-10-09 15:11:45 AEDT
Close bugs fixed in openssh-8.1 release cycle