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 2088916 - host-based authentication does not seem to work with rsa keys and gives an inscrutable error message
Summary: host-based authentication does not seem to work with rsa keys and gives an in...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: openssh
Version: CentOS Stream
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: ---
Assignee: Zoltan Fridrich
QA Contact: Marek Havrila
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-21 15:03 UTC by Andrew Schorr
Modified: 2022-11-15 13:18 UTC (History)
6 users (show)

Fixed In Version: openssh-8.7p1-12.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-11-15 11:21:51 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-7286 0 None None None 2022-05-23 09:22:02 UTC
Red Hat Issue Tracker RHELPLAN-122686 0 None None None 2022-05-21 15:11:44 UTC
Red Hat Product Errata RHBA-2022:8375 0 None None None 2022-11-15 11:21:57 UTC

Description Andrew Schorr 2022-05-21 15:03:55 UTC
Description of problem:
If I configure the ssh client to use host-based authentication with
ssh-keysign, it seems to be unable to use the rsa key and gives a fairly
incomprehensible error message saying:
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
Other key types like ecdsa seem to work OK. Was ssh-rsa key support disabled?
If so, that should be documented more clearly. Ideally, there would be a
clearer error message.

Version-Release number of selected component (if applicable):
openssh-8.7p1-8.el9

How reproducible:
always

Steps to Reproduce:
1. In a freshly installed CentOS Stream 9 qemu kvm, create /etc/ssh/sshd_config.d/99-local.conf with these contents:
HostKey /etc/ssh/ssh_host_rsa_key
HostKey /etc/ssh/ssh_host_ecdsa_key
HostbasedAuthentication yes
PasswordAuthentication no
Then create /etc/ssh/ssh_config.d/99-local.conf with these contents:
HostbasedAuthentication yes
EnableSSHKeysign yes
2. systemctl restart sshd
3. ssh -n localhost uptime

Actual results:
[root@localhost ssh]# ssh -n localhost uptime
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
sign using hostkey ssh-rsa SHA256:RUgzE2VqS2tcUzf1UM+x6UQX2GzQF25mL+4HPn+lScU failed
root@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,hostbased).


Expected results:
Either accept the rsa key or give a clearer error message.

Additional info:
With -v flags, you can see what's going on:
[root@localhost ssh]# ssh -v -n localhost uptime |& egrep 'hostbased|keysign'
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: Next authentication method: hostbased
debug1: userauth_hostbased: trying hostkey ssh-ed25519 SHA256:u1vXVwHOTDXzgvJ419yue2in9fqtxxJw2lVJJu8sARI
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: userauth_hostbased: trying hostkey ecdsa-sha2-nistp256 SHA256:R1JJaMNtqtfTqG/cb7neXwjw7q277TruFudn2HE9oa8
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,hostbased
debug1: userauth_hostbased: trying hostkey ssh-rsa SHA256:RUgzE2VqS2tcUzf1UM+x6UQX2GzQF25mL+4HPn+lScU
ssh-keysign: sshkey_sign failed: error in libcrypto
ssh_keysign: no reply
root@localhost: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,hostbased).

It looks like ssh_keysign is able to use the ecdsa and ed25519 keys, but it chockes on the ssh-rsa key. I can understand that maybe ssh-rsa was disabled for security reasons, but there should be a clearer error message explaining what's going on.

Comment 1 Andrew Schorr 2022-05-21 15:05:30 UTC
Also, if ssh-rsa host key types are not supported, then why is the key generated by sshd-keygen.target?

[root@localhost ssh]# cat /usr/lib/systemd/system/sshd-keygen.target 
[Unit]
Wants=sshd-keygen
Wants=sshd-keygen
Wants=sshd-keygen
PartOf=sshd.service

Just remove "rsa" if it is no longer supported.

Comment 2 Jakub Jelen 2022-05-23 06:07:45 UTC
RSA is still supported, but ssh-rsa signatures using SHA1 are no longer supported. What is the other system you are using? Does it support RFC 8332 [1]? Does it work with crypto policies set to legacy or DEFAULT:SHA1?

[1] https://datatracker.ietf.org/doc/html/rfc8332

Comment 3 Dmitry Belyavskiy 2022-05-23 09:17:18 UTC
Looks like a duplicate of https://bugzilla.redhat.com/show_bug.cgi?id=2068423 to me

*** This bug has been marked as a duplicate of bug 2068423 ***

Comment 4 Jakub Jelen 2022-06-01 09:05:28 UTC
Reopening. Indeed, this is a different issue than the bug #2068423 as this involves ssh-keysign, which ignores SHA2 in OpenSSH 8.7p1 version.

This should be fixed in upstream commit 7aa7b096cf2bafe2777085abdeed5ce00581f641 if I am right.

Comment 12 errata-xmlrpc 2022-11-15 11:21:51 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 (openssh bug fix and enhancement update), 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-2022:8375


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