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 1873581 - Rebase python-cryptography to 2.6+ for ed25519 support
Summary: Rebase python-cryptography to 2.6+ for ed25519 support
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: python-cryptography
Version: 8.2
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: rc
: 8.4
Assignee: Christian Heimes
QA Contact: Kaleem
URL:
Whiteboard:
: 1669539 2003742 2011720 (view as bug list)
Depends On: 1891947 1907429
Blocks: 1668318 1669539 1778939 CVE-2020-25659 1908879 2011720 2011721
TreeView+ depends on / blocked
 
Reported: 2020-08-28 16:40 UTC by Mauro Oddi
Modified: 2021-10-19 16:03 UTC (History)
10 users (show)

Fixed In Version: python-cryptography-3.2.1-3.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 14:52:08 UTC
Type: Feature Request
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker FREEIPA-7052 0 None None None 2021-10-07 08:16:41 UTC

Description Mauro Oddi 2020-08-28 16:40:03 UTC
Description of problem:

The version of python3-cryptography shipped in RHEL 8.2 lacks support for twisted Edwards curves.

This creates a problem in OSP16 Nova:
 - https://bugzilla.redhat.com/show_bug.cgi?id=1669539
 

Version-Release number of selected component (if applicable):
RHEL 8.2
python3-cryptography-2.3-3.el8.x86_64
openssl-1.1.1c-15.el8.x86_64

How reproducible:
always

Steps to Reproduce:

1. Create an ssh keypair of key type ed25519 
(undercloud) [stack@undercloud-osp16 ~]$ ssh-keygen -t ed25519
...
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAHHlefD0G8ir1v/oirs3DDC9mR/ZkZ8+CMVUa9YBuLK stack.local

2. Try to load ssh pubkey using cryptography library:

(undercloud) [stack@undercloud-osp16 ~]$ LC_ALL=en_US.UTF-8 python3
Python 3.6.8 (default, Oct 11 2019, 15:04:54) 
[GCC 8.3.1 20190507 (Red Hat 8.3.1-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from cryptography.hazmat import backends
>>> from cryptography.hazmat.primitives import serialization

>>> serialization.load_ssh_public_key(data='ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAHHlefD0G8ir1v/oirs3DDC9mR/ZkZ8+CMVUa9YBuLK stack.local'.encode('utf-8'), backend=backends.default_backend())

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python3.6/site-packages/cryptography/hazmat/primitives/serialization.py", line 61, in load_ssh_public_key
    raise UnsupportedAlgorithm('Key type is not supported.')
cryptography.exceptions.UnsupportedAlgorithm: Key type is not supported.
>>>


Actual results:
raise UnsupportedAlgorithm('Key type is not supported.')

Expected results:
 ed25519 key type should be supported.

Additional info:
Version 2.7 or higher should be required.

Comment 2 Christian Heimes 2020-09-07 06:45:32 UTC
RHEL 8 ships PyCA cryptography 2.3, which does not support ed25519. In order to support ed25519 python-cryptography has to be rebased to 2.6 or newer. Version 2.6 contains some backwards incompatible changes [1], which I would have to revert. I can do a rebase for RHEL 8.4 earliest.


[1] https://cryptography.io/en/latest/changelog/#v2-6

Comment 3 Mauro Oddi 2020-09-07 07:59:07 UTC
Hi Christian,

Thanks for the confirmation.

Best Regards,
Mauro

Comment 4 Christian Heimes 2020-09-07 08:20:51 UTC
You are welcome!

Do you need a rebase for 8.4? It would be a good idea to start the rebase process early by filing a rebase request RHBZ with a business case.

Comment 6 Christian Heimes 2020-09-07 09:54:22 UTC
I recommend to rebase to either 2.6 (ed25519 support), 2.9 (Poly1305 and fixed rfc4514_string function), or 3.0 (OpenSSH serialization format for private keys)

python-cryptography depends on python-cryptography-vectors for testing. The vector package must be updated in sync. It is an internal development package and not shipped with RHEL.

python-cryptography 2.6 has removed three deprecated features. The features can be easily re-added:
* cryptography.hazmat.primitives.asymmetric.utils.encode_rfc6979_signature() and decode_rfc6979_signature() functions. The functions were removed in 2.6. Both are simple aliases for encode_dss_signature() and decode_dss_signature() in the same name space
* cryptography.hazmat.backends.openssl.x509._Certificate.serial. The property was removed in 2.6. It's a simple alias for Certificate.serial_number

2.7 removed cryptography.hazmat.primitives.mac.MACContext

The backwards incompatible changed to rfc4514_string() in 2.9 is not an issue for RHEL. The function is not available in RHEL 8 because it was added in 2.5.

3.0 removed support for passing an Extension instance to from_issuer_subject_key_identifier(). This feature can be patched back easily, too.

Comment 23 anuja 2020-12-17 12:09:51 UTC
Using version:
python3-cryptography-3.2.1-1.el8.x86_64
ipa-server-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.x86_64

Sanity check performed by executing:
bash: ipa-getcert
pytest: ipa-getcert
pytest: ipa-cert


2020-12-17T08:32:26 [ci-vm-10-0-153-197.h] |       ipa-client-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.x86_64
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h] |       ipa-client-common-4.9.0-0.5.rc3.module+el8.4.0+9124+ced20601.noarch
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h] |       sssd-ipa-2.4.0-3.el8.x86_64
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h] ------------------------------------------------------------------------------------------
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h]  +-----------------------------------------------------------------------------------------+
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h]      Test:[/ipa-server/rhel80/ipa-getcert/root]: [ Pass(242/242): 100% ] 
2020-12-17T08:32:26 [ci-vm-10-0-153-197.h]  +-----------------------------------------------------------------------------------------+


2020-12-17T08:47:47+0000 --------- generated xml file: /home/jenkins/tews/ipa-getcert/junit.xml ---------
2020-12-17T08:47:47+0000 ---- generated html file: file:///home/jenkins/tews/ipa-getcert/report.html ----
2020-12-17T08:47:47+0000 ========================== 1 passed in 323.62 seconds ==========================


2020-12-17T08:45:42+0000 ---------- generated xml file: /home/jenkins/tews/ipa-cert/junit.xml -----------
2020-12-17T08:45:42+0000 ----- generated html file: file:///home/jenkins/tews/ipa-cert/report.html ------
2020-12-17T08:45:42+0000 ========================== 3 passed in 397.12 seconds ==========================

Based on this marking bug as verified.

Comment 25 melanie witt 2021-02-19 04:07:13 UTC
*** Bug 1669539 has been marked as a duplicate of this bug. ***

Comment 27 errata-xmlrpc 2021-05-18 14:52:08 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 (Moderate: python-cryptography security, 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/RHSA-2021:1608

Comment 28 Christian Heimes 2021-10-07 08:12:06 UTC
*** Bug 2011720 has been marked as a duplicate of this bug. ***

Comment 29 Florence Blanc-Renaud 2021-10-19 16:03:15 UTC
*** Bug 2003742 has been marked as a duplicate of this bug. ***


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