Bug 1775693 - paramiko lacks support for rsa-sha2-256, leads to AuthenticationException
Summary: paramiko lacks support for rsa-sha2-256, leads to AuthenticationException
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-paramiko
Version: 34
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Paul Howarth
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-22 15:36 UTC by Christian Heimes
Modified: 2022-01-13 00:59 UTC (History)
10 users (show)

Fixed In Version: python-paramiko-2.9.1-1.fc35 python-paramiko-2.9.1-1.fc34
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-01-08 01:19:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github paramiko paramiko pull 1520 0 'None' open [RSA keys] Add support for rsa-sha2-256 and rsa-sha2-512 2021-02-02 02:13:39 UTC

Description Christian Heimes 2019-11-22 15:36:02 UTC
Description of problem:
python-paramiko lacks support for SHA2 based RSA public key authentication algorithms. rsa-sha2-256 and rsa-sha2-512 are specificed in RFC 8332. The lack of SHA2 support breaks pubkey auth with systems that have FUTURE or FIPS crypto policy enabled.

Version-Release number of selected component (if applicable):
python3-paramiko-2.6.0-2.fc31

How reproducible:
always

Steps to Reproduce:
1. Enable FUTURE crypto policy on a host: update-crypto-policies --set FUTURE
2. systemctl restart sshd
3. try to connect to host with Paramiko client

Actual results:
>>> from paramiko.client import SSHClient, AutoAddPolicy
>>> client = SSHClient()
>>> client.set_missing_host_key_policy(AutoAddPolicy())
>>> client.connect(host, key_filename="/path/to/id_rsa", username="root")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.7/site-packages/paramiko/client.py", line 446, in connect
    passphrase,
  File "/usr/lib/python3.7/site-packages/paramiko/client.py", line 764, in _auth
    raise saved_exception
  File "/usr/lib/python3.7/site-packages/paramiko/client.py", line 700, in _auth
    self._transport.auth_publickey(username, key)
  File "/usr/lib/python3.7/site-packages/paramiko/transport.py", line 1580, in auth_publickey
    return self.auth_handler.wait_for_response(my_event)
  File "/usr/lib/python3.7/site-packages/paramiko/auth_handler.py", line 250, in wait_for_response
    raise e
paramiko.ssh_exception.AuthenticationException: Authentication failed.

journald on the host contains:
userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedKeyTypes [preauth]
userauth_pubkey: key type ssh-ed25519 not in PubkeyAcceptedKeyTypes [preauth]Received disconnect from IP port 56120:11: disconnected by user

Expected results:
connection works

Additional info:
There is a new PR for RSA SHA2 https://github.com/paramiko/paramiko/pull/1520 but the PR is not yet finished. I commented on the PR and pointed out some missing bits.

Comment 1 Othman Madjoudj 2019-11-23 00:34:23 UTC
I'll include the PR once upstream accept/merge it since carrying downstream patch is not very practical.

Comment 2 Ben Cotton 2020-11-03 15:52:34 UTC
This message is a reminder that Fedora 31 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora 31 on 2020-11-24.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
Fedora 'version' of '31'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 31 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 3 Paul Howarth 2020-11-03 17:45:57 UTC
PR still not merged upstream.

Comment 4 Ben Cotton 2021-02-09 15:13:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 5 Karel Volný 2022-01-04 14:28:45 UTC
I just hit this issue too

2.9.1 taken from F36 fixes it

please, could we have the update also in stable branches?

Comment 6 Fedora Update System 2022-01-04 15:07:00 UTC
FEDORA-2022-ddd33f1a78 has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2022-ddd33f1a78

Comment 7 Fedora Update System 2022-01-04 15:22:21 UTC
FEDORA-2022-7ffb82f190 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2022-7ffb82f190

Comment 8 Fedora Update System 2022-01-05 01:06:10 UTC
FEDORA-2022-7ffb82f190 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-7ffb82f190`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-7ffb82f190

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 9 Fedora Update System 2022-01-05 01:14:46 UTC
FEDORA-2022-ddd33f1a78 has been pushed to the Fedora 35 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2022-ddd33f1a78`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-ddd33f1a78

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 10 Fedora Update System 2022-01-08 01:19:23 UTC
FEDORA-2022-ddd33f1a78 has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 11 Fedora Update System 2022-01-13 00:59:38 UTC
FEDORA-2022-7ffb82f190 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.


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