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 1974703 - RFE: Block SSH driver needs to support SHA256 host key fingerprints
Summary: RFE: Block SSH driver needs to support SHA256 host key fingerprints
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: qemu-kvm
Version: 9.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: beta
: ---
Assignee: Daniel Berrangé
QA Contact: Tingting Mao
URL:
Whiteboard:
Depends On: 2001100
Blocks: 1936650
TreeView+ depends on / blocked
 
Reported: 2021-06-22 10:47 UTC by Daniel Berrangé
Modified: 2021-12-07 22:40 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-09-16 02:16:43 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Daniel Berrangé 2021-06-22 10:47:56 UTC
Description of problem:

The SSH block driver supports only MD5 and SHA1:

##
# @SshHostKeyCheckHashType:
#
# @md5: The given hash is an md5 hash
# @sha1: The given hash is an sha1 hash
#
# Since: 2.12
##
{ 'enum': 'SshHostKeyCheckHashType',
  'data': [ 'md5', 'sha1' ] }


This is used for verifying host key fingerprints and thus is a cryptographically  sensitive use case. Both libssh and openssh support SHA256 for fingerprints. 

     SSH_PUBLICKEY_HASH_SHA256

This needs to be added to QEMU.

Version-Release number of selected component (if applicable):
qemu-kvm-6.0.0-6.el9

Comment 2 Daniel Berrangé 2021-06-22 12:26:51 UTC
Patch posted to https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg06085.html

Comment 4 Daniel Berrangé 2021-06-30 16:11:29 UTC
Included in a pull request: https://lists.gnu.org/archive/html/qemu-devel/2021-06/msg08004.html

We'll get it via rebase to 6.1

Comment 5 Jakub Jelen 2021-09-06 19:34:09 UTC
Hi Daniel,
sorry for a late follow-up. But from https://bugzilla.redhat.com/show_bug.cgi?id=1936650#c3

docs/system/qemu-block-drivers.rst.inc:``host_key_check=md5:78:45:8e:14:57:4f:d5:45:83:0a:0e:f3:49:82:c9:c8``
docs/system/qemu-block-drivers.rst.inc:(``sha1:`` can also be used as a prefix, but note that OpenSSH
docs/system/qemu-block-drivers.rst.inc:tools only use MD5 to print fingerprints).

  Documentation related to block/ssh.c 

  Needs updating when support for SHA256 is added

you mentioned that the documentation needs to be updated too. I see that it is still in qemu master:

https://git.qemu.org/?p=qemu.git;a=blob;f=docs/system/qemu-block-drivers.rst.inc;h=16225710ebbbc4a23f2bc8c60a542e01d87408bb;hb=HEAD#l783

Can you take care of updating this outdated comment too?

Note, that OpenSSH is for some time using only SHA256 and MD5 could be used for backward compatibility (but it is not recommended). The SHA1 was never officially used in OpenSSH:

https://github.com/openssh/openssh-portable/blob/7acb3578cdfec0b3d34501408071f7a96c1684ea/ssh-keygen.1#L318-L325

Comment 8 Daniel Berrangé 2021-11-18 15:44:12 UTC
(In reply to Jakub Jelen from comment #5)
> docs/system/qemu-block-drivers.rst.inc:``host_key_check=md5:78:45:8e:14:57:
> 4f:d5:45:83:0a:0e:f3:49:82:c9:c8``
> docs/system/qemu-block-drivers.rst.inc:(``sha1:`` can also be used as a
> prefix, but note that OpenSSH
> docs/system/qemu-block-drivers.rst.inc:tools only use MD5 to print
> fingerprints).
> 
>   Documentation related to block/ssh.c 
> 
>   Needs updating when support for SHA256 is added
> 
> you mentioned that the documentation needs to be updated too. I see that it
> is still in qemu master:
> 
> https://git.qemu.org/?p=qemu.git;a=blob;f=docs/system/qemu-block-drivers.rst.
> inc;h=16225710ebbbc4a23f2bc8c60a542e01d87408bb;hb=HEAD#l783
> 
> Can you take care of updating this outdated comment too?

Posted upstream in:

https://lists.gnu.org/archive/html/qemu-devel/2021-11/msg03847.html

> Note, that OpenSSH is for some time using only SHA256 and MD5 could be used
> for backward compatibility (but it is not recommended). The SHA1 was never
> officially used in OpenSSH:
> 
> https://github.com/openssh/openssh-portable/blob/
> 7acb3578cdfec0b3d34501408071f7a96c1684ea/ssh-keygen.1#L318-L325

No problem, the newly updated QEMU docs basically only describe sha256 usage and recommend against the other options as legacy / insecure.


Note You need to log in before you can comment on or make changes to this bug.