Bug 1637182

Summary: SHA256 fingerprint support
Product: Red Hat Enterprise Linux 7 Reporter: Martin Pitt <mpitt>
Component: libsshAssignee: Martin Pitt <mpitt>
Status: CLOSED ERRATA QA Contact: Nobody <nobody>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.6CC: asn, mthacker, nmavrogi, tbowling
Target Milestone: rcKeywords: Extras
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-11-28 08:01:31 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1585191    

Description Martin Pitt 2018-10-08 20:49:34 UTC
Description of problem: libssh 0.8 introduces some API to generate and show SHA256 fingerprints of host keys. The current 0.7 version only offers MD5 and SHA1, both of which are cryptographically broken now. Trying to use them causes assertion errors in OpenSSL when enabling FIPS mode (see bug 1585191).

To solve that in Cockpit, I just sent https://github.com/cockpit-project/cockpit/pull/10241 to use SSH_PUBLICKEY_HASH_SHA256 and 
ssh_get_fingerprint_hash() instead of ssh_get_hexa() (as SHA256 FPs are shown as base64 instead of hex by ssh, and hex keys are rather unwieldy at that length).

But to fix this cockpit-ssh bug in RHEL 7, I'd need these new APIs backported.

In https://bugzilla.redhat.com/show_bug.cgi?id=1585191#c13, Andreas already put a backport patch for SSH_PUBLICKEY_HASH_SHA256. Hopefully ssh_get_fingerprint_hash() is also not too intrusive to backport?

Comment 2 Andreas Schneider 2018-10-09 08:18:47 UTC
Anderson, could you please take care of this? The patches have all been backported to the v0-7 branch of libssh upstream.

Comment 5 Martin Pitt 2018-10-28 13:39:17 UTC
I pushed SHA256 support patches to dist-git, plus the fix for the "interactive keyboard" authentication (bug 1640812). I locally mockbuilt libssh and cockpit with the corresponding fix, and everything works -- I get SHA256 fingerprints, and it does not crash in FIPS mode.

Comment 13 errata-xmlrpc 2018-11-28 08:01:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3712