Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1049921

Summary: [RFE] libssh2 should support SHA2 fingerprints for host verification
Product: Red Hat Enterprise Linux 7 Reporter: Karel Srot <ksrot>
Component: libssh2Assignee: Kamil Dudka <kdudka>
Status: CLOSED CURRENTRELEASE QA Contact: qe-baseos-daemons
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: fsumsal, hkario, kdudka, ovasik, rsahoo, rupatel, sbalasub, szidek
Target Milestone: rcKeywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-17 06:29:35 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: 1057566, 1295396    

Description Karel Srot 2014-01-08 13:44:41 UTC
Description of problem:

openssh switched to using SHA2 fingerprints in known_host file. 
Due to that libssh cannot verify the host.
For curl it requires to skip the host verification using the --insecure option.

Version-Release number of selected component (if applicable):
libssh2-1.4.3-6.el7.ppc64

How reproducible:
always

Steps to Reproduce:

# cat /root/.ssh/known_hosts
127.0.0.1 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGH7hS2S/XuosioeCywH0ddJ/tEpRjsa2/KRVmObXa5brWgnA2NA2jIX5M/5TM+ORfPKxlSNxCfmJP0eEIqsX4M=

# curl -vu karel:password scp://127.0.0.1/home/karel/test
* About to connect() to 127.0.0.1 port 22 (#0)
*   Trying 127.0.0.1...
* Connected to 127.0.0.1 (127.0.0.1) port 22 (#0)
* Failed to read known hosts from /root/.ssh/known_hosts
* SSH MD5 fingerprint: 459d100bffb5fc60b51882a674de2942
* SSH host check: 2, key: <none>
* Closing connection 0
curl: (51) SSL peer certificate or SSH remote key was not OK

Comment 1 Kamil Dudka 2014-01-08 14:01:19 UTC
This is not implemented upstream yet and I am not aware of anybody working on it right now...

Comment 2 Alicja Kario 2014-03-25 13:21:12 UTC
The issue is not limited to fingerprints, connection that uses pubkey authentication with ecdsa don't work at all:

$ curl --insecure -vv --key ~/.ssh/id_ecdsa --pubkey ~/.ssh/id_ecdsa.pub scp://hkario.0.1/tmp/file
* About to connect() to 192.168.0.1 port 22 (#0)
*   Trying 192.168.0.1...
* Connected to 192.168.0.1 (192.168.0.1) port 22 (#0)
* SSH MD5 fingerprint: e32ff1129434ed70310a075ad940f4c3
* SSH authentication methods available: publickey
* Using ssh public key file /home/hkario/.ssh/id_ecdsa.pub
* Using ssh private key file /home/hkario/.ssh/id_ecdsa
* SSH public key authentication failed: Callback returned error
* No identity would match
* Authentication failure
* Closing connection 0
curl: (67) Authentication failure

Comment 13 Kamil Dudka 2019-01-21 12:22:59 UTC
*** Bug 1661540 has been marked as a duplicate of this bug. ***

Comment 14 Kamil Dudka 2019-02-14 15:41:38 UTC
The rebase of libssh2 to 1.8.0 (currently the latest upstream release) will not make ecdsa-sha2-nistp256 work for host verification.